Commit 814c9de7 authored by AgusDuha's avatar AgusDuha Committed by GitHub

feat: add createX preinstall (#29) (#11618)

* feat: add createX preinstall

* feat: change name from CreateXDeployer to CreateX
parent f370113e
......@@ -525,6 +525,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.CreateX);
// 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.
......
......@@ -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");
......
......@@ -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_createX_succeeds() external view {
assertPreinstall(Preinstalls.CreateX, Preinstalls.CreateXCode);
}
}
......@@ -233,6 +233,7 @@ contract Setup {
labelPreinstall(Preinstalls.SenderCreator_v070);
labelPreinstall(Preinstalls.EntryPoint_v070);
labelPreinstall(Preinstalls.BeaconBlockRoots);
labelPreinstall(Preinstalls.CreateX);
console.log("Setup: completed L2 genesis");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment