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
591d967a
Commit
591d967a
authored
Dec 14, 2022
by
Will Cory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- make deployment scripts a little more typesafe
- add some sanity checks in postDeploymentAction
parent
88dbdffd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
14 deletions
+32
-14
AttestationStationProxy.ts
...tracts-periphery/deploy/op-nft/AttestationStationProxy.ts
+6
-1
OptimistImpl.ts
packages/contracts-periphery/deploy/op-nft/OptimistImpl.ts
+8
-4
OptimistProxy.ts
packages/contracts-periphery/deploy/op-nft/OptimistProxy.ts
+18
-9
No files found.
packages/contracts-periphery/deploy/op-nft/AttestationStationProxy.ts
View file @
591d967a
...
...
@@ -9,12 +9,16 @@ import {
}
from
'
@eth-optimism/contracts-bedrock/src/deploy-utils
'
import
{
utils
}
from
'
ethers
'
import
type
{
DeployConfig
}
from
'
../../src
'
const
{
getAddress
}
=
utils
/**
* Deploys the AttestationStationProxy
*/
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
deployConfig
=
hre
.
deployConfig
as
DeployConfig
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
console
.
log
(
`Deploying AttestationStationProxy with
${
deployer
}
`
)
...
...
@@ -30,6 +34,7 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
args
:
[
deployer
],
postDeployAction
:
async
(
contract
)
=>
{
await
assertContractVariable
(
contract
,
'
admin
'
,
deployer
)
await
assertContractVariable
(
contract
,
'
version
'
,
'
1.0.0
'
)
},
})
...
...
@@ -62,7 +67,7 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
console
.
log
(
'
implementation already set to AttestationStation contract
'
)
}
const
l2ProxyOwnerAddress
=
hre
.
deployConfig
.
l2ProxyOwnerAddress
const
l2ProxyOwnerAddress
=
deployConfig
.
l2ProxyOwnerAddress
const
admin
=
await
Proxy
.
callStatic
.
admin
()
console
.
log
(
`admin is set to
${
admin
}
`
)
if
(
getAddress
(
admin
)
!==
getAddress
(
l2ProxyOwnerAddress
))
{
...
...
packages/contracts-periphery/deploy/op-nft/OptimistImpl.ts
View file @
591d967a
/* 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
'
import
type
{
DeployConfig
}
from
'
../../src
'
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
deployConfig
=
hre
.
deployConfig
as
DeployConfig
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
console
.
log
(
`Deploying Optimist implementation with
${
deployer
}
`
)
...
...
@@ -16,15 +20,15 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const
attestationStationAddress
=
Deployment__AttestationStation
.
address
console
.
log
(
`Using
${
attestationStationAddress
}
as the AttestationStation`
)
console
.
log
(
`Using
${
hre
.
deployConfig
.
attestorAddress
}
as ATTESTOR`
)
console
.
log
(
`Using
${
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
,
deployConfig
.
optimistName
,
deployConfig
.
optimistSymbol
,
deployConfig
.
attestorAddress
,
attestationStationAddress
,
],
log
:
true
,
...
...
packages/contracts-periphery/deploy/op-nft/OptimistProxy.ts
View file @
591d967a
...
...
@@ -7,11 +7,15 @@ import 'hardhat-deploy'
import
{
assertContractVariable
}
from
'
@eth-optimism/contracts-bedrock/src/deploy-utils
'
import
{
utils
}
from
'
ethers
'
import
type
{
DeployConfig
}
from
'
../../src
'
const
{
getAddress
}
=
utils
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
deployConfig
=
hre
.
deployConfig
as
DeployConfig
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
ddd
=
hre
.
deployConfig
.
ddd
const
ddd
=
deployConfig
.
ddd
if
(
getAddress
(
deployer
)
!==
getAddress
(
ddd
))
{
throw
new
Error
(
'
Must deploy with the ddd
'
)
...
...
@@ -51,8 +55,8 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
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
name
=
deployConfig
.
optimistName
const
symbol
=
deployConfig
.
optimistSymbol
const
calldata
=
Optimist
.
interface
.
encodeFunctionData
(
'
initialize
'
,
[
name
,
symbol
,
...
...
@@ -68,7 +72,7 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
console
.
log
(
'
implementation already set to Optimist contract
'
)
}
const
l2ProxyOwnerAddress
=
hre
.
deployConfig
.
l2ProxyOwnerAddress
const
l2ProxyOwnerAddress
=
deployConfig
.
l2ProxyOwnerAddress
const
admin
=
await
Proxy
.
callStatic
.
admin
()
console
.
log
(
`admin set to
${
admin
}
`
)
if
(
getAddress
(
admin
)
!==
getAddress
(
l2ProxyOwnerAddress
))
{
...
...
@@ -86,15 +90,20 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
'
AttestationStationProxy
'
)
assertContractVariable
(
Optimist
,
'
name
'
,
hre
.
deployConfig
.
optimistName
)
assertContractVariable
(
Optimist
,
'
symbol
'
,
hre
.
deployConfig
.
optimistSymbol
)
assertContractVariable
(
await
assertContractVariable
(
Optimist
,
'
admin
'
,
deployer
)
await
assertContractVariable
(
Optimist
,
'
name
'
,
deployConfig
.
optimistName
)
await
assertContractVariable
(
Optimist
,
'
verson
'
,
'
1.0.0
'
)
await
assertContractVariable
(
Optimist
,
'
symbol
'
,
deployConfig
.
optimistSymbol
)
await
assertContractVariable
(
Optimist
,
'
ATTESTOR
'
,
deployConfig
.
attestorAddress
)
await
assertContractVariable
(
Optimist
,
'
ATTESTATION_STATION
'
,
Deployment__AttestationStation
.
address
)
assertContractVariable
(
Optimist
,
'
ATTESTOR
'
,
hre
.
deployConfig
.
attestorAddress
)
assertContractVariable
(
Optimist
,
'
version
'
,
'
0.0.1
'
)
}
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