diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 988cc6b0..042a0ab8 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -33,17 +33,21 @@ 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 { 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"); @@ -72,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); @@ -108,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)));