Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
9c3a4a66
Unverified
Commit
9c3a4a66
authored
Dec 13, 2022
by
Mark Tyneway
Committed by
GitHub
Dec 13, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4373 from ethereum-optimism/willc/deploy-optimist
feat(contracts-periphery): Add Optimist SBT deploy script
parents
5be495e0
746ce554
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
181 additions
and
8 deletions
+181
-8
thick-ligers-smell.md
.changeset/thick-ligers-smell.md
+5
-0
ethereum.ts
packages/contracts-periphery/config/deploy/ethereum.ts
+3
-0
hardhat.ts
packages/contracts-periphery/config/deploy/hardhat.ts
+3
-0
kovan.ts
packages/contracts-periphery/config/deploy/kovan.ts
+3
-0
optimism-goerli.ts
...ages/contracts-periphery/config/deploy/optimism-goerli.ts
+3
-0
optimism-kovan.ts
packages/contracts-periphery/config/deploy/optimism-kovan.ts
+3
-0
optimism.ts
packages/contracts-periphery/config/deploy/optimism.ts
+3
-1
OptimistImpl.ts
packages/contracts-periphery/deploy/op-nft/OptimistImpl.ts
+38
-0
OptimistProxy.ts
packages/contracts-periphery/deploy/op-nft/OptimistProxy.ts
+87
-0
deploy.ts
packages/contracts-periphery/src/config/deploy.ts
+33
-7
No files found.
.changeset/thick-ligers-smell.md
0 → 100644
View file @
9c3a4a66
---
'
@eth-optimism/contracts-periphery'
:
patch
---
Add deployment scripts for optimist
packages/contracts-periphery/config/deploy/ethereum.ts
View file @
9c3a4a66
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
l2ProxyOwnerAddress
:
''
,
l2ProxyOwnerAddress
:
''
,
optimistName
:
''
,
optimistSymbol
:
''
,
attestorAddress
:
''
,
}
}
export
default
config
export
default
config
packages/contracts-periphery/config/deploy/hardhat.ts
View file @
9c3a4a66
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
l2ProxyOwnerAddress
:
'
0x70997970c51812dc3a010c7d01b50e0d17dc79c8
'
,
l2ProxyOwnerAddress
:
'
0x70997970c51812dc3a010c7d01b50e0d17dc79c8
'
,
optimistName
:
'
OP Citizenship
'
,
optimistSymbol
:
'
OPNFT
'
,
attestorAddress
:
'
0x70997970c51812dc3a010c7d01b50e0d17dc79c8
'
,
}
}
export
default
config
export
default
config
packages/contracts-periphery/config/deploy/kovan.ts
View file @
9c3a4a66
...
@@ -4,6 +4,9 @@ import { DeployConfig } from '../../src'
...
@@ -4,6 +4,9 @@ import { DeployConfig } from '../../src'
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
l2ProxyOwnerAddress
:
''
,
l2ProxyOwnerAddress
:
''
,
optimistName
:
''
,
optimistSymbol
:
''
,
attestorAddress
:
''
,
}
}
export
default
config
export
default
config
packages/contracts-periphery/config/deploy/optimism-goerli.ts
View file @
9c3a4a66
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
l2ProxyOwnerAddress
:
''
,
l2ProxyOwnerAddress
:
''
,
optimistName
:
''
,
optimistSymbol
:
''
,
attestorAddress
:
''
,
}
}
export
default
config
export
default
config
packages/contracts-periphery/config/deploy/optimism-kovan.ts
View file @
9c3a4a66
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
...
@@ -3,6 +3,9 @@ import { DeployConfig } from '../../src'
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
l2ProxyOwnerAddress
:
''
,
l2ProxyOwnerAddress
:
''
,
optimistName
:
''
,
optimistSymbol
:
''
,
attestorAddress
:
''
,
}
}
export
default
config
export
default
config
packages/contracts-periphery/config/deploy/optimism.ts
View file @
9c3a4a66
import
{
DeployConfig
}
from
'
../../src
'
import
{
DeployConfig
}
from
'
../../src
'
// TODO(tynes): optimism-kovan is deprecated, delete this file
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
l2ProxyOwnerAddress
:
''
,
l2ProxyOwnerAddress
:
''
,
optimistName
:
''
,
optimistSymbol
:
''
,
attestorAddress
:
''
,
}
}
export
default
config
export
default
config
packages/contracts-periphery/deploy/op-nft/OptimistImpl.ts
0 → 100644
View file @
9c3a4a66
/* Imports: External */
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
HardhatRuntimeEnvironment
}
from
'
hardhat/types
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
hardhat-deploy
'
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
console
.
log
(
`Deploying Optimist implementation with
${
deployer
}
`
)
const
Deployment__AttestationStation
=
await
hre
.
deployments
.
get
(
'
AttestationStationProxy
'
)
const
attestationStationAddress
=
Deployment__AttestationStation
.
address
console
.
log
(
`Using
${
attestationStationAddress
}
as the AttestationStation`
)
console
.
log
(
`Using
${
hre
.
deployConfig
.
attestorAddress
}
as ATTESTOR`
)
const
{
deploy
}
=
await
hre
.
deployments
.
deterministic
(
'
Optimist
'
,
{
salt
:
hre
.
ethers
.
utils
.
solidityKeccak256
([
'
string
'
],
[
'
Optimist
'
]),
from
:
deployer
,
args
:
[
hre
.
deployConfig
.
optimistName
,
hre
.
deployConfig
.
optimistSymbol
,
hre
.
deployConfig
.
attestorAddress
,
attestationStationAddress
,
],
log
:
true
,
})
await
deploy
()
}
deployFn
.
tags
=
[
'
Optimist
'
,
'
OptimistEnvironment
'
]
export
default
deployFn
packages/contracts-periphery/deploy/op-nft/OptimistProxy.ts
0 → 100644
View file @
9c3a4a66
/* Imports: External */
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
HardhatRuntimeEnvironment
}
from
'
hardhat/types
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
hardhat-deploy
'
import
{
assertContractVariable
,
deploy
,
}
from
'
@eth-optimism/contracts-bedrock/src/deploy-utils
'
import
{
utils
}
from
'
ethers
'
const
{
getAddress
}
=
utils
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
Deployment__Optimist
=
await
hre
.
deployments
.
get
(
'
Optimist
'
)
console
.
log
(
`Deploying OptimistProxy with
${
deployer
}
`
)
await
deploy
({
hre
,
name
:
'
OptimistProxy
'
,
contract
:
'
Proxy
'
,
args
:
[
deployer
],
postDeployAction
:
async
(
contract
)
=>
{
await
assertContractVariable
(
contract
,
'
admin
'
,
deployer
)
},
})
const
Deployment__OptimistProxy
=
await
hre
.
deployments
.
get
(
'
OptimistProxy
'
)
console
.
log
(
`OptimistProxy deployed to
${
Deployment__OptimistProxy
.
address
}
`
)
const
Proxy
=
await
hre
.
ethers
.
getContractAt
(
'
Proxy
'
,
Deployment__OptimistProxy
.
address
)
const
Optimist
=
await
hre
.
ethers
.
getContractAt
(
'
Optimist
'
,
Deployment__OptimistProxy
.
address
)
const
implementation
=
await
Proxy
.
callStatic
.
implementation
()
console
.
log
(
`implementation set to
${
implementation
}
`
)
if
(
getAddress
(
implementation
)
!==
getAddress
(
Deployment__Optimist
.
address
))
{
console
.
log
(
'
implementation not set to Optimist contract
'
)
console
.
log
(
`Setting implementation to
${
Deployment__Optimist
.
address
}
`
)
// Create the calldata for the call to `initialize()`
const
name
=
hre
.
deployConfig
.
optimistName
const
symbol
=
hre
.
deployConfig
.
optimistSymbol
const
calldata
=
Optimist
.
interface
.
encodeFunctionData
(
'
initialize
'
,
[
name
,
symbol
,
])
const
tx
=
await
Proxy
.
upgradeToAndCall
(
Deployment__Optimist
.
address
,
calldata
)
const
receipt
=
await
tx
.
wait
()
console
.
log
(
`implementation set in
${
receipt
.
transactionHash
}
`
)
}
else
{
console
.
log
(
'
implementation already set to Optimist contract
'
)
}
const
l2ProxyOwnerAddress
=
hre
.
deployConfig
.
l2ProxyOwnerAddress
const
admin
=
await
Proxy
.
callStatic
.
admin
()
console
.
log
(
`admin set to
${
admin
}
`
)
if
(
getAddress
(
admin
)
!==
getAddress
(
l2ProxyOwnerAddress
))
{
console
.
log
(
'
detected admin is not set
'
)
console
.
log
(
`Setting admin to
${
l2ProxyOwnerAddress
}
`
)
const
tx
=
await
Proxy
.
changeAdmin
(
l2ProxyOwnerAddress
)
const
receipt
=
await
tx
.
wait
()
console
.
log
(
`admin set in
${
receipt
.
transactionHash
}
`
)
}
else
{
console
.
log
(
'
admin already set to proxy owner address
'
)
}
}
deployFn
.
tags
=
[
'
OptimistProxy
'
]
deployFn
.
dependencies
=
[
'
AttestationStationProxy
'
,
'
Optimist
'
]
export
default
deployFn
packages/contracts-periphery/src/config/deploy.ts
View file @
9c3a4a66
...
@@ -14,14 +14,31 @@ export interface DeployConfig {
...
@@ -14,14 +14,31 @@ export interface DeployConfig {
ddd
:
string
ddd
:
string
/**
/**
*
Address of the Proxy owner on L2
*
Number of confs before considering it final
*/
*/
l2ProxyOwnerAddress
:
string
numDeployConfirmations
?:
number
/**
/**
* N
umber of confs before considering it final
* N
ame of the NFT in the Optimist contract.
*/
*/
numDeployConfirmations
?:
number
optimistName
:
string
/**
* Symbol of the NFT in the Optimist contract.
*/
optimistSymbol
:
string
/**
* Address of the priviledged attestor for the Optimist contract.
*/
attestorAddress
:
string
/**
* Address of the owner of the proxies on L2. There will be a ProxyAdmin deployed as a predeploy
* after bedrock, so the owner of proxies should be updated to that after the upgrade.
* This currently is used as the owner of the nft related proxies.
*/
l2ProxyOwnerAddress
:
string
}
}
/**
/**
...
@@ -31,11 +48,20 @@ export const configSpec: DeployConfigSpec<DeployConfig> = {
...
@@ -31,11 +48,20 @@ export const configSpec: DeployConfigSpec<DeployConfig> = {
ddd
:
{
ddd
:
{
type
:
'
address
'
,
type
:
'
address
'
,
},
},
l2ProxyOwnerAddress
:
{
type
:
'
address
'
,
},
numDeployConfirmations
:
{
numDeployConfirmations
:
{
type
:
'
number
'
,
type
:
'
number
'
,
default
:
1
,
default
:
1
,
},
},
optimistName
:
{
type
:
'
string
'
,
},
optimistSymbol
:
{
type
:
'
string
'
,
},
attestorAddress
:
{
type
:
'
address
'
,
},
l2ProxyOwnerAddress
:
{
type
:
'
address
'
,
},
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment