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
8fc55444
Commit
8fc55444
authored
Sep 25, 2022
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: add deploy files
Add the L1 deployment files for: - `L1ERC721Bridge` - `L1ERC721BridgeProxy`
parent
0fe6c13a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
000-InitProxies.deploy.ts
packages/contracts-bedrock/deploy/000-InitProxies.deploy.ts
+1
-0
001-InitImplementations.deploy.ts
...ontracts-bedrock/deploy/001-InitImplementations.deploy.ts
+39
-0
002-ConfigureProxyAdmin.ts
packages/contracts-bedrock/deploy/002-ConfigureProxyAdmin.ts
+1
-0
No files found.
packages/contracts-bedrock/deploy/000-InitProxies.deploy.ts
View file @
8fc55444
...
...
@@ -9,6 +9,7 @@ const proxies = [
'
L1StandardBridgeProxy
'
,
'
OptimismPortalProxy
'
,
'
OptimismMintableERC20FactoryProxy
'
,
'
L1ERC721BridgeProxy
'
,
]
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
...
packages/contracts-bedrock/deploy/001-InitImplementations.deploy.ts
View file @
8fc55444
...
...
@@ -5,6 +5,8 @@ import 'hardhat-deploy'
import
'
@nomiclabs/hardhat-ethers
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
{
predeploys
}
from
'
../src/constants
'
const
upgradeABIs
=
{
L2OutputOracleProxy
:
async
(
deployConfig
)
=>
[
'
initialize(bytes32,address,address)
'
,
...
...
@@ -39,6 +41,7 @@ const deployFn: DeployFunction = async (hre) => {
const
portalProxy
=
await
get
(
'
OptimismPortalProxy
'
)
const
messengerProxy
=
await
get
(
'
L1CrossDomainMessengerProxy
'
)
const
bridgeProxy
=
await
get
(
'
L1StandardBridgeProxy
'
)
const
erc721BridgeProxy
=
await
get
(
'
L1ERC721BridgeProxy
'
)
let
nonce
=
await
l1
.
getTransactionCount
(
deployer
)
const
implTxs
=
[
...
...
@@ -100,6 +103,13 @@ const deployFn: DeployFunction = async (hre) => {
waitConfirmations
:
deployConfig
.
deploymentWaitConfirmations
,
nonce
:
++
nonce
,
}),
deploy
(
'
L1ERC721Bridge
'
,
{
from
:
deployer
,
args
:
[
messengerProxy
.
address
,
predeploys
.
L2ERC721Bridge
],
log
:
true
,
waitConfirmations
:
deployConfig
.
waitConfirmations
,
nonce
:
++
nonce
,
}),
]
await
Promise
.
all
(
implTxs
)
...
...
@@ -154,11 +164,23 @@ const deployFn: DeployFunction = async (hre) => {
await
tx
.
wait
()
console
.
log
(
'
Done
'
)
const
erc721Bridge
=
await
get
(
'
L1ERC721Bridge
'
)
const
erc721BridgeProxyContract
=
await
hre
.
ethers
.
getContractAt
(
'
Proxy
'
,
erc721BridgeProxy
.
address
)
console
.
log
(
`Upgrading L1ERC721Bridge at
${
erc721Bridge
.
address
}
`
)
tx
=
await
erc721BridgeProxyContract
.
upgradeTo
(
erc721Bridge
.
address
)
console
.
log
(
`Awaiting TX hash
${
tx
.
hash
}
.`
)
await
tx
.
wait
()
console
.
log
(
'
Done
'
)
await
validateOracle
(
hre
,
deployConfig
,
deployL2StartingTimestamp
)
await
validatePortal
(
hre
)
await
validateMessenger
(
hre
)
await
validateBridge
(
hre
)
await
validateTokenFactory
(
hre
)
await
validateERC721Bridge
(
hre
)
}
const
validateOracle
=
async
(
hre
,
deployConfig
,
deployL2StartingTimestamp
)
=>
{
...
...
@@ -244,6 +266,23 @@ const validateBridge = async (hre) => {
}
}
// The messenger address should be set to the proxy messenger
// The other bridge should be set to the predeploy on L2
const
validateERC721Bridge
=
async
(
hre
)
=>
{
const
messenger
=
await
hre
.
deployments
.
get
(
'
L1CrossDomainMessengerProxy
'
)
const
proxy
=
await
hre
.
deployments
.
get
(
'
L1ERC721BridgeProxy
'
)
const
L1ERC721Bridge
=
await
hre
.
ethers
.
getContractAt
(
'
L1ERC721Bridge
'
,
proxy
.
address
)
if
(
messenger
.
address
!==
(
await
L1ERC721Bridge
.
messenger
()))
{
throw
new
Error
(
'
misconfigured messenger
'
)
}
if
((
await
L1ERC721Bridge
.
otherBridge
())
!==
predeploys
.
L2ERC721Bridge
)
{
throw
new
Error
(
'
misconfigured otherBridge
'
)
}
}
const
validateTokenFactory
=
async
(
hre
)
=>
{
const
bridge
=
await
hre
.
deployments
.
get
(
'
L1StandardBridgeProxy
'
)
const
proxy
=
await
hre
.
deployments
.
get
(
'
OptimismMintableERC20FactoryProxy
'
)
...
...
packages/contracts-bedrock/deploy/002-ConfigureProxyAdmin.ts
View file @
8fc55444
...
...
@@ -14,6 +14,7 @@ const deployFn: DeployFunction = async (hre) => {
'
L1StandardBridgeProxy
'
,
'
OptimismPortalProxy
'
,
'
OptimismMintableERC20FactoryProxy
'
,
'
L1ERC721BridgeProxy
'
,
]
// Wait on all the txs in parallel so that the deployment goes faster
...
...
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