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
88dbdffd
Commit
88dbdffd
authored
Dec 13, 2022
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctp: deterministic deployment optimist proxy
Deterministic deployment of the `OptimistProxy` contract
parent
9c3a4a66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
hardhat.ts
packages/contracts-periphery/config/deploy/hardhat.ts
+1
-1
OptimistProxy.ts
packages/contracts-periphery/deploy/op-nft/OptimistProxy.ts
+26
-10
No files found.
packages/contracts-periphery/config/deploy/hardhat.ts
View file @
88dbdffd
import
{
DeployConfig
}
from
'
../../src
'
import
{
DeployConfig
}
from
'
../../src
'
const
config
:
DeployConfig
=
{
const
config
:
DeployConfig
=
{
ddd
:
'
0x
9C6373dE60c2D3297b18A8f964618ac46E011B58
'
,
ddd
:
'
0x
f39fd6e51aad88f6f4ce6ab8827279cfffb92266
'
,
l2ProxyOwnerAddress
:
'
0x70997970c51812dc3a010c7d01b50e0d17dc79c8
'
,
l2ProxyOwnerAddress
:
'
0x70997970c51812dc3a010c7d01b50e0d17dc79c8
'
,
optimistName
:
'
OP Citizenship
'
,
optimistName
:
'
OP Citizenship
'
,
optimistSymbol
:
'
OPNFT
'
,
optimistSymbol
:
'
OPNFT
'
,
...
...
packages/contracts-periphery/deploy/op-nft/OptimistProxy.ts
View file @
88dbdffd
...
@@ -4,31 +4,33 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'
...
@@ -4,31 +4,33 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
hardhat-deploy
'
import
'
hardhat-deploy
'
import
{
import
{
assertContractVariable
}
from
'
@eth-optimism/contracts-bedrock/src/deploy-utils
'
assertContractVariable
,
deploy
,
}
from
'
@eth-optimism/contracts-bedrock/src/deploy-utils
'
import
{
utils
}
from
'
ethers
'
import
{
utils
}
from
'
ethers
'
const
{
getAddress
}
=
utils
const
{
getAddress
}
=
utils
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
ddd
=
hre
.
deployConfig
.
ddd
if
(
getAddress
(
deployer
)
!==
getAddress
(
ddd
))
{
throw
new
Error
(
'
Must deploy with the ddd
'
)
}
const
Deployment__Optimist
=
await
hre
.
deployments
.
get
(
'
Optimist
'
)
const
Deployment__Optimist
=
await
hre
.
deployments
.
get
(
'
Optimist
'
)
console
.
log
(
`Deploying OptimistProxy with
${
deployer
}
`
)
console
.
log
(
`Deploying OptimistProxy with
${
deployer
}
`
)
await
deploy
({
const
{
deploy
}
=
await
hre
.
deployments
.
deterministic
(
'
OptimistProxy
'
,
{
hre
,
salt
:
hre
.
ethers
.
utils
.
solidityKeccak256
([
'
string
'
],
[
'
OptimistProxy
'
]),
name
:
'
OptimistProxy
'
,
contract
:
'
Proxy
'
,
contract
:
'
Proxy
'
,
from
:
deployer
,
args
:
[
deployer
],
args
:
[
deployer
],
postDeployAction
:
async
(
contract
)
=>
{
log
:
true
,
await
assertContractVariable
(
contract
,
'
admin
'
,
deployer
)
},
})
})
await
deploy
()
const
Deployment__OptimistProxy
=
await
hre
.
deployments
.
get
(
'
OptimistProxy
'
)
const
Deployment__OptimistProxy
=
await
hre
.
deployments
.
get
(
'
OptimistProxy
'
)
console
.
log
(
`OptimistProxy deployed to
${
Deployment__OptimistProxy
.
address
}
`
)
console
.
log
(
`OptimistProxy deployed to
${
Deployment__OptimistProxy
.
address
}
`
)
...
@@ -79,6 +81,20 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
...
@@ -79,6 +81,20 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
}
else
{
}
else
{
console
.
log
(
'
admin already set to proxy owner address
'
)
console
.
log
(
'
admin already set to proxy owner address
'
)
}
}
const
Deployment__AttestationStation
=
await
hre
.
deployments
.
get
(
'
AttestationStationProxy
'
)
assertContractVariable
(
Optimist
,
'
name
'
,
hre
.
deployConfig
.
optimistName
)
assertContractVariable
(
Optimist
,
'
symbol
'
,
hre
.
deployConfig
.
optimistSymbol
)
assertContractVariable
(
Optimist
,
'
ATTESTATION_STATION
'
,
Deployment__AttestationStation
.
address
)
assertContractVariable
(
Optimist
,
'
ATTESTOR
'
,
hre
.
deployConfig
.
attestorAddress
)
assertContractVariable
(
Optimist
,
'
version
'
,
'
0.0.1
'
)
}
}
deployFn
.
tags
=
[
'
OptimistProxy
'
]
deployFn
.
tags
=
[
'
OptimistProxy
'
]
...
...
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