From bb86bf57c8a0915c48d368b9fed5be849cf15248 Mon Sep 17 00:00:00 2001 From: JohnGuilding Date: Sun, 7 Jul 2024 14:07:06 +0200 Subject: [PATCH] Fix deployment bug --- script/ComputeSafeRecoveryCalldata.s.sol | 19 +++++++++++++++++++ script/DeploySafeNativeRecovery.s.sol | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 script/ComputeSafeRecoveryCalldata.s.sol diff --git a/script/ComputeSafeRecoveryCalldata.s.sol b/script/ComputeSafeRecoveryCalldata.s.sol new file mode 100644 index 00000000..44e5a603 --- /dev/null +++ b/script/ComputeSafeRecoveryCalldata.s.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import { Script } from "forge-std/Script.sol"; +import { console } from "forge-std/console.sol"; + +contract ComputeSafeRecoveryCalldataScript is Script { + function run() public { + address oldOwner = vm.envAddress("OLD_OWNER"); + address newOwner = vm.envAddress("NEW_OWNER"); + address previousOwnerInLinkedList = address(1); + + bytes memory recoveryCalldata = abi.encodeWithSignature( + "swapOwner(address,address,address)", previousOwnerInLinkedList, oldOwner, newOwner + ); + + console.log("recoveryCalldata", vm.toString(recoveryCalldata)); + } +} diff --git a/script/DeploySafeNativeRecovery.s.sol b/script/DeploySafeNativeRecovery.s.sol index 087eccf2..0bb5f14d 100644 --- a/script/DeploySafeNativeRecovery.s.sol +++ b/script/DeploySafeNativeRecovery.s.sol @@ -14,7 +14,7 @@ contract DeploySafeNativeRecovery_Script is Script { vm.startBroadcast(vm.envUint("PRIVATE_KEY")); address verifier = vm.envOr("VERIFIER", address(0)); address dkimRegistry = vm.envOr("DKIM_REGISTRY", address(0)); - address dkimRegistrySigner = vm.envOr("SIGNER", address(0)); + address dkimRegistrySigner = vm.envOr("DKIM_SIGNER", address(0)); address emailAuthImpl = vm.envOr("EMAIL_AUTH_IMPL", address(0)); if (verifier == address(0)) { @@ -33,7 +33,7 @@ contract DeploySafeNativeRecovery_Script is Script { console.log("Deployed Email Auth at", emailAuthImpl); } - address module = address(new SafeEmailRecoveryModule(verifier, emailAuthImpl, dkimRegistry)); + address module = address(new SafeEmailRecoveryModule(verifier, dkimRegistry, emailAuthImpl)); console.log("Deployed Email Recovery Module at ", vm.toString(module));