Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add createX preinstall #29

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/contracts-bedrock/scripts/L2Genesis.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ contract L2Genesis is Deployer {
_setPreinstallCode(Preinstalls.SenderCreator_v070); // ERC 4337 v0.7.0
_setPreinstallCode(Preinstalls.EntryPoint_v070); // ERC 4337 v0.7.0
_setPreinstallCode(Preinstalls.BeaconBlockRoots);
_setPreinstallCode(Preinstalls.CreateXDeployer);
// 4788 sender nonce must be incremented, since it's part of later upgrade-transactions.
// For the upgrade-tx to not create a contract that conflicts with an already-existing copy,
// the nonce must be bumped.
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts-bedrock/src/libraries/Preinstalls.sol

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contracts-bedrock/test/L2Genesis.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ contract L2GenesisTest is Test {
expected += 2048 - 2; // predeploy proxies
expected += 21; // predeploy implementations (excl. legacy erc20-style eth and legacy message sender)
expected += 256; // precompiles
expected += 12; // preinstalls
expected += 13; // preinstalls
expected += 1; // 4788 deployer account
// 16 prefunded dev accounts are excluded
assertEq(expected, getJSONKeyCount(_path), "key count check");
Expand Down
4 changes: 4 additions & 0 deletions packages/contracts-bedrock/test/Preinstalls.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,8 @@ contract PreinstallsTest is CommonTest {
assertPreinstall(Preinstalls.BeaconBlockRoots, Preinstalls.BeaconBlockRootsCode);
assertEq(vm.getNonce(Preinstalls.BeaconBlockRootsSender), 1, "4788 sender must have nonce=1");
}

function test_preinstall_createXDeployer_succeeds() external view {
assertPreinstall(Preinstalls.CreateXDeployer, Preinstalls.CreateXDeployerCode);
}
}
1 change: 1 addition & 0 deletions packages/contracts-bedrock/test/setup/Setup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ contract Setup {
labelPreinstall(Preinstalls.SenderCreator_v070);
labelPreinstall(Preinstalls.EntryPoint_v070);
labelPreinstall(Preinstalls.BeaconBlockRoots);
labelPreinstall(Preinstalls.CreateXDeployer);

console.log("Setup: completed L2 genesis");
}
Expand Down