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
2c32cde9
Unverified
Commit
2c32cde9
authored
Jun 28, 2022
by
Mark Tyneway
Committed by
GitHub
Jun 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: fix genesis builder (#2877)
Updates to foundry/hardhat broke the genesis builder, this fixes them
parent
0c92db90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
devnetL1.ts
packages/contracts-bedrock/deploy-config/devnetL1.ts
+1
-1
genesis-l2.ts
packages/contracts-bedrock/tasks/genesis-l2.ts
+11
-4
No files found.
packages/contracts-bedrock/deploy-config/devnetL1.ts
View file @
2c32cde9
...
...
@@ -5,7 +5,7 @@ const { env } = process
const
startingTimestamp
=
typeof
env
.
L2OO_STARTING_BLOCK_TIMESTAMP
===
'
string
'
?
ethers
.
BigNumber
.
from
(
env
.
L2OO_STARTING_BLOCK_TIMESTAMP
).
toNumber
()
:
Date
.
now
()
/
1000
:
Math
.
floor
(
Date
.
now
()
/
1000
)
const
config
=
{
submissionInterval
:
6
,
...
...
packages/contracts-bedrock/tasks/genesis-l2.ts
View file @
2c32cde9
import
fs
from
'
fs
'
import
path
from
'
path
'
import
assert
from
'
assert
'
import
{
OptimismGenesis
,
State
}
from
'
@eth-optimism/core-utils
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
{
ethers
}
from
'
ethers
'
import
{
task
}
from
'
hardhat/config
'
import
{
HardhatRuntimeEnvironment
}
from
'
hardhat/types
'
...
...
@@ -26,15 +28,20 @@ const assertEvenLength = (str: string) => {
assert
(
str
.
length
%
2
===
0
,
str
)
}
// TODO: this can be replaced with the smock version after
// a new release of foundry-rs/hardhat
// TODO: fix this to be compatible with smock's version
const
getStorageLayout
=
async
(
hre
:
HardhatRuntimeEnvironment
,
name
:
string
)
=>
{
const
buildInfo
=
await
hre
.
artifacts
.
getBuildInfo
(
name
)
const
key
=
Object
.
keys
(
buildInfo
.
output
.
contracts
)[
0
]
return
(
buildInfo
.
output
.
contracts
[
key
][
name
]
as
any
).
storageLayout
const
keys
=
Object
.
keys
(
buildInfo
.
output
.
contracts
)
for
(
const
key
of
keys
)
{
if
(
name
===
path
.
basename
(
key
,
'
.sol
'
))
{
const
contract
=
buildInfo
.
output
.
contracts
[
key
]
return
(
contract
[
name
]
as
any
).
storageLayout
}
}
throw
new
Error
(
`Cannot locate storageLayout for
${
name
}
`
)
}
task
(
'
genesis-l2
'
,
'
create a genesis config
'
)
...
...
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