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
6beca3f4
Unverified
Commit
6beca3f4
authored
May 01, 2023
by
mergify[bot]
Committed by
GitHub
May 01, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into aj/fpp-server
parents
6851d171
0aa7e8c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
check-l2.ts
packages/contracts-bedrock/tasks/check-l2.ts
+29
-10
No files found.
packages/contracts-bedrock/tasks/check-l2.ts
View file @
6beca3f4
...
@@ -33,14 +33,37 @@ const checkPredeploys = async (
...
@@ -33,14 +33,37 @@ const checkPredeploys = async (
provider
:
providers
.
Provider
provider
:
providers
.
Provider
)
=>
{
)
=>
{
console
.
log
(
'
Checking predeploys are configured correctly
'
)
console
.
log
(
'
Checking predeploys are configured correctly
'
)
const
admin
=
hre
.
ethers
.
utils
.
hexConcat
([
'
0x000000000000000000000000
'
,
predeploys
.
ProxyAdmin
,
])
const
codeReq
=
[]
const
slotReq
=
[]
// First loop for requests
for
(
let
i
=
0
;
i
<
2048
;
i
++
)
{
for
(
let
i
=
0
;
i
<
2048
;
i
++
)
{
const
num
=
hre
.
ethers
.
utils
.
hexZeroPad
(
'
0x
'
+
i
.
toString
(
16
),
2
)
const
num
=
hre
.
ethers
.
utils
.
hexZeroPad
(
'
0x
'
+
i
.
toString
(
16
),
2
)
const
addr
=
hre
.
ethers
.
utils
.
getAddress
(
const
addr
=
hre
.
ethers
.
utils
.
getAddress
(
hre
.
ethers
.
utils
.
hexConcat
([
prefix
,
num
])
hre
.
ethers
.
utils
.
hexConcat
([
prefix
,
num
])
)
)
const
code
=
await
provider
.
getCode
(
addr
)
codeReq
.
push
(
provider
.
getCode
(
addr
))
if
(
code
===
'
0x
'
)
{
slotReq
.
push
(
provider
.
getStorageAt
(
addr
,
adminSlot
))
}
// Wait for all requests to finish
// The `JsonRpcBatchProvider` will batch requests in the background.
const
codeRes
=
await
Promise
.
all
(
codeReq
)
const
slotRes
=
await
Promise
.
all
(
slotReq
)
// Second loop for response checks
for
(
let
i
=
0
;
i
<
2048
;
i
++
)
{
const
num
=
hre
.
ethers
.
utils
.
hexZeroPad
(
'
0x
'
+
i
.
toString
(
16
),
2
)
const
addr
=
hre
.
ethers
.
utils
.
getAddress
(
hre
.
ethers
.
utils
.
hexConcat
([
prefix
,
num
])
)
if
(
codeRes
[
i
]
===
'
0x
'
)
{
throw
new
Error
(
`no code found at
${
addr
}
`
)
throw
new
Error
(
`no code found at
${
addr
}
`
)
}
}
...
@@ -52,13 +75,7 @@ const checkPredeploys = async (
...
@@ -52,13 +75,7 @@ const checkPredeploys = async (
continue
continue
}
}
const
slot
=
await
provider
.
getStorageAt
(
addr
,
adminSlot
)
if
(
slotRes
[
i
]
!==
admin
)
{
const
admin
=
hre
.
ethers
.
utils
.
hexConcat
([
'
0x000000000000000000000000
'
,
predeploys
.
ProxyAdmin
,
])
if
(
admin
!==
slot
)
{
throw
new
Error
(
`incorrect admin slot in
${
addr
}
`
)
throw
new
Error
(
`incorrect admin slot in
${
addr
}
`
)
}
}
...
@@ -686,7 +703,9 @@ task('check-l2', 'Checks a freshly migrated L2 system for correct migration')
...
@@ -686,7 +703,9 @@ task('check-l2', 'Checks a freshly migrated L2 system for correct migration')
if
(
args
.
l2RpcUrl
!==
''
)
{
if
(
args
.
l2RpcUrl
!==
''
)
{
console
.
log
(
'
Using CLI URL for provider instead of hardhat network
'
)
console
.
log
(
'
Using CLI URL for provider instead of hardhat network
'
)
const
provider
=
new
hre
.
ethers
.
providers
.
JsonRpcProvider
(
args
.
l2RpcUrl
)
const
provider
=
new
hre
.
ethers
.
providers
.
JsonRpcBatchProvider
(
args
.
l2RpcUrl
)
signer
=
Wallet
.
createRandom
().
connect
(
provider
)
signer
=
Wallet
.
createRandom
().
connect
(
provider
)
}
}
...
...
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