From 3075b19b15f029b0372221155e242f296a153467 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 26 Jul 2024 11:23:09 -0400 Subject: [PATCH 1/2] start broadcast --- script/Deploy.s.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 988cc6b0..5cdbc330 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -33,10 +33,12 @@ contract DeployScript is Script { console2.log("EP: ", address(entryPoint)); console2.log("Factory owner: ", owner); + vm.startBroadcast(); _deployAccountImpl(accountImplSalt, accountImpl); _deploySingleSignerValidation(singleSignerValidationSalt, singleSignerValidation); _deployAccountFactory(factorySalt, factory); _addStakeForFactory(uint32(requiredUnstakeDelay), requiredStakeAmount); + vm.stopBroadcast(); } function _deployAccountImpl(bytes32 salt, address expected) internal { From 265c2a621df7ba9a1245572e104cff9efe95423e Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 26 Jul 2024 11:33:51 -0400 Subject: [PATCH 2/2] fix test --- script/Deploy.s.sol | 12 ++++++++---- test/script/Deploy.s.t.sol | 9 +++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 5cdbc330..042a0ab8 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -45,7 +45,9 @@ contract DeployScript is Script { console2.log(string.concat("Deploying AccountImpl with salt: ", vm.toString(salt))); address addr = Create2.computeAddress( - salt, keccak256(abi.encodePacked(type(UpgradeableModularAccount).creationCode, abi.encode(entryPoint))) + salt, + keccak256(abi.encodePacked(type(UpgradeableModularAccount).creationCode, abi.encode(entryPoint))), + CREATE2_FACTORY ); if (addr != expected) { console2.log("Expected address mismatch"); @@ -74,8 +76,9 @@ contract DeployScript is Script { function _deploySingleSignerValidation(bytes32 salt, address expected) internal { console2.log(string.concat("Deploying SingleSignerValidation with salt: ", vm.toString(salt))); - address addr = - Create2.computeAddress(salt, keccak256(abi.encodePacked(type(SingleSignerValidation).creationCode))); + address addr = Create2.computeAddress( + salt, keccak256(abi.encodePacked(type(SingleSignerValidation).creationCode)), CREATE2_FACTORY + ); if (addr != expected) { console2.log("Expected address mismatch"); console2.log("Expected: ", expected); @@ -110,7 +113,8 @@ contract DeployScript is Script { type(AccountFactory).creationCode, abi.encode(entryPoint, accountImpl, singleSignerValidation, owner) ) - ) + ), + CREATE2_FACTORY ); if (addr != expected) { console2.log("Expected address mismatch"); diff --git a/test/script/Deploy.s.t.sol b/test/script/Deploy.s.t.sol index c0b09c17..105ce9b8 100644 --- a/test/script/Deploy.s.t.sol +++ b/test/script/Deploy.s.t.sol @@ -30,19 +30,16 @@ contract DeployTest is Test { vm.setEnv("ENTRYPOINT", vm.toString(address(_entryPoint))); vm.setEnv("OWNER", vm.toString(_owner)); - // Create1 derivation of the 2nd address deployed - address deployScriptAddr = address(0x2e234DAe75C793f67A35089C9d99245E1C58470b); - _accountImpl = Create2.computeAddress( bytes32(0), keccak256( abi.encodePacked(type(UpgradeableModularAccount).creationCode, abi.encode(address(_entryPoint))) ), - deployScriptAddr + CREATE2_FACTORY ); _singleSignerValidation = Create2.computeAddress( - bytes32(0), keccak256(abi.encodePacked(type(SingleSignerValidation).creationCode)), deployScriptAddr + bytes32(0), keccak256(abi.encodePacked(type(SingleSignerValidation).creationCode)), CREATE2_FACTORY ); _factory = Create2.computeAddress( @@ -53,7 +50,7 @@ contract DeployTest is Test { abi.encode(address(_entryPoint), _accountImpl, _singleSignerValidation, _owner) ) ), - deployScriptAddr + CREATE2_FACTORY ); vm.setEnv("ACCOUNT_IMPL", vm.toString(address(_accountImpl)));