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
75b1e727
Unverified
Commit
75b1e727
authored
Oct 22, 2021
by
Maurelian
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(contracts): move Proxy__L1CrossDomainMessenger init to end
parent
bba041d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
18 deletions
+33
-18
070-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
...ts/deploy/070-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
+0
-14
120-initialize-Proxy__L1CrossDomainMessenger.ts
...ts/deploy/120-initialize-Proxy__L1CrossDomainMessenger.ts
+29
-0
130-finalize.ts
packages/contracts/deploy/130-finalize.ts
+2
-2
140-fund-accounts.ts
packages/contracts/deploy/140-fund-accounts.ts
+2
-2
No files found.
packages/contracts/deploy/070-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
View file @
75b1e727
...
...
@@ -24,20 +24,6 @@ const deployFn: DeployFunction = async (hre) => {
contract
:
'
Lib_ResolvedDelegateProxy
'
,
iface
:
'
L1CrossDomainMessenger
'
,
args
:
[
Lib_AddressManager
.
address
,
'
OVM_L1CrossDomainMessenger
'
],
// This reverts on a fresh deploy, because the implementation is not yet added to the AddressManager.
// I think the best option is to do the initialization atomically from within the AddressSetter.
// postDeployAction: async (contract) => {
// console.log(`Initializing Proxy__OVM_L1CrossDomainMessenger...`)
// await contract.initialize(Lib_AddressManager.address)
// console.log(`Checking that contract was correctly initialized...`)
// await waitUntilTrue(async () => {
// return hexStringEquals(
// await contract.libAddressManager(),
// Lib_AddressManager.address
// )
// })
// },
})
}
...
...
packages/contracts/deploy/120-initialize-Proxy__L1CrossDomainMessenger.ts
0 → 100644
View file @
75b1e727
/* Imports: External */
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
import
{
getLiveContract
,
waitUntilTrue
,
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
// There is a risk that on a fresh deployment we could get front-run,
// and the Proxy would be bricked. But that feels unlikely, and we can recover from it.
console
.
log
(
`Initializing Proxy__L1CrossDomainMessenger...`
)
const
proxy
=
getLiveContract
(
'
Proxy__L1CrossDomainMessenger
'
)
await
proxy
.
initialize
(
Lib_AddressManager
.
address
)
console
.
log
(
`Checking that contract was correctly initialized...`
)
await
waitUntilTrue
(
async
()
=>
{
return
hexStringEquals
(
await
proxy
.
libAddressManager
(),
Lib_AddressManager
.
address
)
})
}
deployFn
.
tags
=
[
'
fresh
'
,
'
finalize
'
]
export
default
deployFn
packages/contracts/deploy/1
2
0-finalize.ts
→
packages/contracts/deploy/1
3
0-finalize.ts
View file @
75b1e727
...
...
@@ -4,13 +4,13 @@ import { hexStringEquals } from '@eth-optimism/core-utils'
/* Imports: Internal */
import
{
get
Deployed
Contract
,
get
Live
Contract
,
waitUntilTrue
,
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
Lib_AddressManager
=
await
get
Deployed
Contract
(
const
Lib_AddressManager
=
await
get
Live
Contract
(
hre
,
'
Lib_AddressManager
'
,
{
...
...
packages/contracts/deploy/1
3
0-fund-accounts.ts
→
packages/contracts/deploy/1
4
0-fund-accounts.ts
View file @
75b1e727
...
...
@@ -8,7 +8,7 @@ import {
import
{
normalizeHardhatNetworkAccountsConfig
}
from
'
hardhat/internal/core/providers/util
'
/* Imports: Internal */
import
{
get
Deployed
Contract
}
from
'
../src/hardhat-deploy-ethers
'
import
{
get
Live
Contract
}
from
'
../src/hardhat-deploy-ethers
'
// This is a TEMPORARY way to fund the default hardhat accounts on L2. The better way to do this is
// to make a modification to hardhat-ovm. However, I don't have the time right now to figure the
...
...
@@ -17,7 +17,7 @@ const deployFn: DeployFunction = async (hre) => {
// Only execute this step if we're on the hardhat chain ID.
const
{
chainId
}
=
await
hre
.
ethers
.
provider
.
getNetwork
()
if
(
chainId
===
defaultHardhatNetworkParams
.
chainId
)
{
const
L1StandardBridge
=
await
get
Deployed
Contract
(
const
L1StandardBridge
=
await
get
Live
Contract
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
,
{
...
...
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