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
7ac556ad
Commit
7ac556ad
authored
Dec 07, 2022
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: check l2 log loud
parent
748f5e02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
check-l2.ts
packages/contracts-bedrock/tasks/check-l2.ts
+34
-1
No files found.
packages/contracts-bedrock/tasks/check-l2.ts
View file @
7ac556ad
...
@@ -14,6 +14,10 @@ const adminSlot =
...
@@ -14,6 +14,10 @@ const adminSlot =
'
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
'
'
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
'
const
prefix
=
'
0x420000000000000000000000000000000000
'
const
prefix
=
'
0x420000000000000000000000000000000000
'
const
logLoud
=
()
=>
{
console
.
log
(
'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'
)
}
// checkPredeploys will ensure that all of the predeploys are set
// checkPredeploys will ensure that all of the predeploys are set
const
checkPredeploys
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
checkPredeploys
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
console
.
log
(
'
Checking predeploys are configured correctly
'
)
console
.
log
(
'
Checking predeploys are configured correctly
'
)
...
@@ -162,7 +166,9 @@ const check = {
...
@@ -162,7 +166,9 @@ const check = {
if
(
otherMessenger
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
otherMessenger
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
otherMessenger misconfigured
'
)
throw
new
Error
(
'
otherMessenger misconfigured
'
)
}
}
console
.
log
(
` - otherMessenger:
${
otherMessenger
}
`
)
logLoud
()
console
.
log
(
` - OTHER_MESSENGER:
${
otherMessenger
}
`
)
logLoud
()
const
l1CrossDomainMessenger
=
const
l1CrossDomainMessenger
=
await
L2CrossDomainMessenger
.
l1CrossDomainMessenger
()
await
L2CrossDomainMessenger
.
l1CrossDomainMessenger
()
...
@@ -175,7 +181,9 @@ const check = {
...
@@ -175,7 +181,9 @@ const check = {
if
(
owner
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
owner
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
owner misconfigured
'
)
throw
new
Error
(
'
owner misconfigured
'
)
}
}
logLoud
()
console
.
log
(
` - owner:
${
owner
}
`
)
console
.
log
(
` - owner:
${
owner
}
`
)
logLoud
()
const
MESSAGE_VERSION
=
await
L2CrossDomainMessenger
.
MESSAGE_VERSION
()
const
MESSAGE_VERSION
=
await
L2CrossDomainMessenger
.
MESSAGE_VERSION
()
console
.
log
(
` - MESSAGE_VERSION:
${
MESSAGE_VERSION
}
`
)
console
.
log
(
` - MESSAGE_VERSION:
${
MESSAGE_VERSION
}
`
)
...
@@ -246,7 +254,9 @@ const check = {
...
@@ -246,7 +254,9 @@ const check = {
if
(
OTHER_BRIDGE
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
OTHER_BRIDGE
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
invalid OTHER_BRIDGE
'
)
throw
new
Error
(
'
invalid OTHER_BRIDGE
'
)
}
}
logLoud
()
console
.
log
(
` - OTHER_BRIDGE:
${
OTHER_BRIDGE
}
`
)
console
.
log
(
` - OTHER_BRIDGE:
${
OTHER_BRIDGE
}
`
)
logLoud
()
const
MESSENGER
=
await
L2StandardBridge
.
MESSENGER
()
const
MESSENGER
=
await
L2StandardBridge
.
MESSENGER
()
if
(
MESSENGER
!==
predeploys
.
L2CrossDomainMessenger
)
{
if
(
MESSENGER
!==
predeploys
.
L2CrossDomainMessenger
)
{
...
@@ -273,7 +283,9 @@ const check = {
...
@@ -273,7 +283,9 @@ const check = {
if
(
RECIPIENT
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
RECIPIENT
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
undefined RECIPIENT
'
)
throw
new
Error
(
'
undefined RECIPIENT
'
)
}
}
logLoud
()
console
.
log
(
` - RECIPIENT:
${
RECIPIENT
}
`
)
console
.
log
(
` - RECIPIENT:
${
RECIPIENT
}
`
)
logLoud
()
const
l1FeeWallet
=
await
SequencerFeeVault
.
l1FeeWallet
()
const
l1FeeWallet
=
await
SequencerFeeVault
.
l1FeeWallet
()
if
(
l1FeeWallet
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
l1FeeWallet
===
hre
.
ethers
.
constants
.
AddressZero
)
{
...
@@ -438,7 +450,9 @@ const check = {
...
@@ -438,7 +450,9 @@ const check = {
console
.
log
(
` - symbol:
${
symbol
}
`
)
console
.
log
(
` - symbol:
${
symbol
}
`
)
const
owner
=
await
GovernanceToken
.
owner
()
const
owner
=
await
GovernanceToken
.
owner
()
logLoud
()
console
.
log
(
` - owner:
${
owner
}
`
)
console
.
log
(
` - owner:
${
owner
}
`
)
logLoud
()
const
totalSupply
=
await
GovernanceToken
.
totalSupply
()
const
totalSupply
=
await
GovernanceToken
.
totalSupply
()
console
.
log
(
` - totalSupply:
${
totalSupply
}
`
)
console
.
log
(
` - totalSupply:
${
totalSupply
}
`
)
...
@@ -461,11 +475,18 @@ const check = {
...
@@ -461,11 +475,18 @@ const check = {
if
(
MESSENGER
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
MESSENGER
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
MESSENGER misconfigured
'
)
throw
new
Error
(
'
MESSENGER misconfigured
'
)
}
}
console
.
log
(
` - MESSENGER:
${
MESSENGER
}
`
)
const
OTHER_BRIDGE
=
await
L2ERC721Bridge
.
OTHER_BRIDGE
()
const
OTHER_BRIDGE
=
await
L2ERC721Bridge
.
OTHER_BRIDGE
()
if
(
OTHER_BRIDGE
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
OTHER_BRIDGE
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
OTHER_BRIDGE misconfigured
'
)
throw
new
Error
(
'
OTHER_BRIDGE misconfigured
'
)
}
}
logLoud
()
console
.
log
(
` - OTHER_BRIDGE:
${
OTHER_BRIDGE
}
`
)
logLoud
()
await
checkProxy
(
hre
,
'
L2ERC721Bridge
'
)
await
assertProxy
(
hre
,
'
L2ERC721Bridge
'
)
},
},
// OptimismMintableERC721Factory
// OptimismMintableERC721Factory
// - check version
// - check version
...
@@ -500,7 +521,9 @@ const check = {
...
@@ -500,7 +521,9 @@ const check = {
if
(
owner
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
owner
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
misconfigured owner
'
)
throw
new
Error
(
'
misconfigured owner
'
)
}
}
logLoud
()
console
.
log
(
` - owner:
${
owner
}
`
)
console
.
log
(
` - owner:
${
owner
}
`
)
logLoud
()
const
addressManager
=
await
ProxyAdmin
.
addressManager
()
const
addressManager
=
await
ProxyAdmin
.
addressManager
()
console
.
log
(
` - addressManager:
${
addressManager
}
`
)
console
.
log
(
` - addressManager:
${
addressManager
}
`
)
...
@@ -525,7 +548,9 @@ const check = {
...
@@ -525,7 +548,9 @@ const check = {
if
(
RECIPIENT
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
RECIPIENT
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
`RECIPIENT misconfigured`
)
throw
new
Error
(
`RECIPIENT misconfigured`
)
}
}
logLoud
()
console
.
log
(
` - RECIPIENT:
${
RECIPIENT
}
`
)
console
.
log
(
` - RECIPIENT:
${
RECIPIENT
}
`
)
logLoud
()
assertSemver
(
version
,
'
BaseFeeVault
'
)
assertSemver
(
version
,
'
BaseFeeVault
'
)
await
checkProxy
(
hre
,
'
BaseFeeVault
'
)
await
checkProxy
(
hre
,
'
BaseFeeVault
'
)
...
@@ -551,7 +576,9 @@ const check = {
...
@@ -551,7 +576,9 @@ const check = {
if
(
RECIPIENT
===
hre
.
ethers
.
constants
.
AddressZero
)
{
if
(
RECIPIENT
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
`RECIPIENT misconfigured`
)
throw
new
Error
(
`RECIPIENT misconfigured`
)
}
}
logLoud
()
console
.
log
(
` - RECIPIENT:
${
RECIPIENT
}
`
)
console
.
log
(
` - RECIPIENT:
${
RECIPIENT
}
`
)
logLoud
()
assertSemver
(
version
,
'
L1FeeVault
'
)
assertSemver
(
version
,
'
L1FeeVault
'
)
await
checkProxy
(
hre
,
'
L1FeeVault
'
)
await
checkProxy
(
hre
,
'
L1FeeVault
'
)
...
@@ -583,9 +610,15 @@ task(
...
@@ -583,9 +610,15 @@ task(
'
check-l2
'
,
'
check-l2
'
,
'
Checks a freshly migrated L2 system for correct migration
'
'
Checks a freshly migrated L2 system for correct migration
'
).
setAction
(
async
(
_
,
hre
:
HardhatRuntimeEnvironment
)
=>
{
).
setAction
(
async
(
_
,
hre
:
HardhatRuntimeEnvironment
)
=>
{
logLoud
()
console
.
log
(
'
Manually check values wrapped in !!!!
'
)
logLoud
()
console
.
log
()
// Ensure that all the predeploys exist, including the not
// Ensure that all the predeploys exist, including the not
// currently configured ones
// currently configured ones
await
checkPredeploys
(
hre
)
await
checkPredeploys
(
hre
)
console
.
log
()
// Check the currently configured predeploys
// Check the currently configured predeploys
for
(
const
[
name
,
fn
]
of
Object
.
entries
(
check
))
{
for
(
const
[
name
,
fn
]
of
Object
.
entries
(
check
))
{
const
address
=
predeploys
[
name
]
const
address
=
predeploys
[
name
]
...
...
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