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
abe9d790
Commit
abe9d790
authored
Nov 27, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: fixup
parent
943ca86f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
package.json
packages/contracts-bedrock/package.json
+1
-1
generate-l2-genesis.sh
packages/contracts-bedrock/scripts/generate-l2-genesis.sh
+3
-6
Setup.sol
packages/contracts-bedrock/test/setup/Setup.sol
+7
-0
No files found.
packages/contracts-bedrock/package.json
View file @
abe9d790
...
...
@@ -17,7 +17,7 @@
"build"
:
"forge build"
,
"build:go-ffi"
:
"(cd scripts/go-ffi && go build)"
,
"autogen:invariant-docs"
:
"npx tsx scripts/invariant-doc-gen.ts"
,
"test"
:
"pnpm build:go-ffi &&
pnpm genesis &&
forge test"
,
"test"
:
"pnpm build:go-ffi && forge test"
,
"genesis"
:
"./scripts/generate-l2-genesis.sh"
,
"coverage"
:
"pnpm build:go-ffi && forge coverage"
,
"coverage:lcov"
:
"pnpm build:go-ffi && forge coverage --report lcov"
,
...
...
packages/contracts-bedrock/scripts/generate-l2-genesis.sh
View file @
abe9d790
...
...
@@ -16,20 +16,17 @@ TESTDATA_DIR="$CONTRACTS_DIR/.testdata"
OUTFILE_L2
=
"
$TESTDATA_DIR
/genesis.json"
OUTFILE_ROLLUP
=
"
$TESTDATA_DIR
/rollup.json"
mkdir
-p
"
$TESTDATA_DIR
"
if
[
!
-f
"
$DEPLOY_ARTIFACT
"
]
;
then
forge script
$CONTRACTS_DIR
/scripts/Deploy.s.sol:Deploy
forge script
$CONTRACTS_DIR
/scripts/Deploy.s.sol:Deploy
>
/dev/null 2>&1
fi
mkdir
-p
"
$TESTDATA_DIR
"
if
[
!
-f
"
$OUTFILE_L2
"
]
;
then
echo
"Generating L2 genesis"
go run
$OP_NODE
genesis l2
\
--deploy-config
"
$CONTRACTS_DIR
/deploy-config/hardhat.json"
\
--l1-deployments
"
$DEPLOY_ARTIFACT
"
\
--l1-starting-block
"
$L1_STARTING_BLOCK_PATH
"
\
--outfile
.l2
"
$OUTFILE_L2
"
\
--outfile
.rollup
"
$OUTFILE_ROLLUP
"
--outfile
.rollup
"
$OUTFILE_ROLLUP
"
>
/dev/null 2>&1
fi
packages/contracts-bedrock/test/setup/Setup.sol
View file @
abe9d790
...
...
@@ -28,6 +28,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { AddressManager } from "src/legacy/AddressManager.sol";
import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
import { Executables } from "scripts/Executables.sol";
/// @title Setup
/// @dev This contact is responsible for setting up the contracts in state. It currently
...
...
@@ -108,6 +109,12 @@ contract Setup is Deploy {
/// @dev Sets up the L2 contracts. Depends on `L1()` being called first.
function L2(DeployConfig cfg) public {
string[] memory args = new string[](3);
args[0] = Executables.bash;
args[1] = "-c";
args[2] = string.concat(vm.projectRoot(), "/scripts/generate-l2-genesis.sh");
vm.ffi(args);
string memory allocsPath = string.concat(vm.projectRoot(), "/.testdata/genesis.json");
vm.loadAllocs(allocsPath);
...
...
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