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
da62e26d
Unverified
Commit
da62e26d
authored
Nov 02, 2022
by
nfl0
Committed by
GitHub
Nov 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete check-l2-config.ts
parent
e122d568
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
79 deletions
+0
-79
check-l2-config.ts
packages/contracts-bedrock/tasks/check-l2-config.ts
+0
-79
No files found.
packages/contracts-bedrock/tasks/check-l2-config.ts
deleted
100644 → 0
View file @
e122d568
import
{
task
,
types
}
from
'
hardhat/config
'
import
{
providers
,
Contract
}
from
'
ethers
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
hardhat-deploy
'
import
{
predeploys
}
from
'
../src
'
task
(
'
check-l2-config
'
,
'
Validate L2 config
'
)
.
addParam
(
'
l2ProviderUrl
'
,
'
L2 provider URL.
'
,
'
http://localhost:9545
'
,
types
.
string
)
.
setAction
(
async
(
args
,
hre
)
=>
{
const
l2Provider
=
new
providers
.
JsonRpcProvider
(
args
.
l2ProviderUrl
)
const
loadPredeploy
=
async
(
name
:
string
):
Promise
<
Contract
>
=>
{
const
artifact
=
await
hre
.
artifacts
.
readArtifact
(
name
)
return
new
Contract
(
predeploys
[
name
],
artifact
.
abi
,
l2Provider
)
}
const
getContractAddress
=
async
(
name
:
string
):
Promise
<
string
>
=>
{
const
deployment
=
await
hre
.
deployments
.
get
(
name
)
return
deployment
.
address
}
// Verify that all predeploys have code.
// TODO: Actually check that the predeploys have the expected code.
for
(
const
[
name
,
address
]
of
Object
.
entries
(
predeploys
))
{
const
code
=
await
l2Provider
.
getCode
(
address
)
if
(
code
===
'
0x
'
)
{
throw
new
Error
(
`Missing code for
${
name
}
`
)
}
}
// Confirming that L2CrossDomainMessenger.otherMessenger() is set properly.
const
L2CrossDomainMessenger
=
await
loadPredeploy
(
'
L2CrossDomainMessenger
'
)
const
actualOtherMessenger
=
await
getContractAddress
(
'
L1CrossDomainMessengerProxy
'
)
const
expectedOtherMessenger
=
await
L2CrossDomainMessenger
.
otherMessenger
()
if
(
expectedOtherMessenger
!==
actualOtherMessenger
)
{
throw
new
Error
(
`L2CrossDomainMessenger otherMessenger not set correctly. Got
${
actualOtherMessenger
}
, expected
${
actualOtherMessenger
}
`
)
}
// Confirming that L2StandardBridge.messenger() is set properly.
const
L2StandardBridge
=
await
loadPredeploy
(
'
L2StandardBridge
'
)
const
actualMessenger
=
await
L2StandardBridge
.
messenger
()
const
expectedMessenger
=
predeploys
.
L2CrossDomainMessenger
if
(
expectedMessenger
!==
actualMessenger
)
{
throw
new
Error
(
`L2StandardBridge messenger not set correctly. Got
${
actualMessenger
}
, expected
${
expectedMessenger
}
`
)
}
// Confirming that L2StandardBridge.otherBridge() is set properly.
const
actualOtherBridge
=
await
getContractAddress
(
'
L1StandardBridgeProxy
'
)
const
expectedOtherBridge
=
await
L2StandardBridge
.
otherBridge
()
if
(
expectedOtherBridge
!==
actualOtherBridge
)
{
throw
new
Error
(
`L2StandardBridge otherBridge not set correctly. Got
${
actualMessenger
}
, expected
${
expectedOtherBridge
}
`
)
}
// Confirming that OptimismMintableERC20Factory.bridge() is set properly.
const
OptimismMintableERC20Factory
=
await
loadPredeploy
(
'
OptimismMintableERC20Factory
'
)
const
actualBridge
=
await
OptimismMintableERC20Factory
.
bridge
()
const
expectedBridge
=
predeploys
.
L2StandardBridge
if
(
expectedBridge
!==
actualBridge
)
{
throw
new
Error
(
`OptimismMintableERC20Factory bridge not set correctly. Got
${
actualBridge
}
, expected
${
expectedBridge
}
`
)
}
})
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