From 62fc12d7c94575c8c71d9cf984ad1aa5c422ad02 Mon Sep 17 00:00:00 2001 From: spengrah Date: Mon, 8 May 2023 15:28:25 -0500 Subject: [PATCH] deploy v1.-beta to optimism --- .gitignore | 3 +-- foundry.toml | 1 + script/DeployParams.json | 33 ++++++++++++++++++++++++------ script/HatsSignerGateFactory.s.sol | 27 ++++++++++-------------- 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 6ebd4a7..bd61c39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ cache/ out/ .vscode/ -broadcast/*/31337 -broadcast/*/*/dry-run +broadcast/ .env .DS_Store \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index e77d902..df20bbb 100644 --- a/foundry.toml +++ b/foundry.toml @@ -31,6 +31,7 @@ tab_width = 4 wrap_comments = false [rpc_endpoints] +arbitrum = "${ARBITRUM_RPC}" ethereum = "${ETHEREUM_RPC}" optimism = "${OPTIMISM_RPC}" goerli = "${GOERLI_RPC}" diff --git a/script/DeployParams.json b/script/DeployParams.json index 5c9bb1a..b4d4ff9 100644 --- a/script/DeployParams.json +++ b/script/DeployParams.json @@ -3,28 +3,49 @@ "gnosisFallbackLibrary": "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4", "gnosisMultisendLibrary": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761", "gnosisSafeProxyFactory": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", - "hatsProtocol": "0x72c89eb08444bc16396dd9432b3e82d956c412ec", + "hatsProtocol": "0x9D2dfd6066d5935267291718E8AA16C8Ab729E9d", + "moduleProxyFactory": "0x00000000000DC7F163742Eb4aBEf650037b1f588", + "safeSingleton": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552" + }, + "1": { + "gnosisFallbackLibrary": "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4", + "gnosisMultisendLibrary": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761", + "gnosisSafeProxyFactory": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", + "hatsProtocol": "0x9D2dfd6066d5935267291718E8AA16C8Ab729E9d", "moduleProxyFactory": "0x00000000000DC7F163742Eb4aBEf650037b1f588", "safeSingleton": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552" }, - "1": {}, "5": { "gnosisFallbackLibrary": "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4", "gnosisMultisendLibrary": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761", "gnosisSafeProxyFactory": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", - "hatsProtocol": "0x2923469a33bd2fa2ab33c877db81d35a9d8d60c6", + "hatsProtocol": "0x9D2dfd6066d5935267291718E8AA16C8Ab729E9d", "moduleProxyFactory": "0x00000000000DC7F163742Eb4aBEf650037b1f588", "safeSingleton": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552" }, - "10": {}, + "10": { + "gnosisFallbackLibrary": "0x017062a1dE2FE6b99BE3d9d37841FeD19F573804", + "gnosisMultisendLibrary": "0x998739BFdAAdde7C933B942a68053933098f9EDa", + "gnosisSafeProxyFactory": "0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC", + "hatsProtocol": "0x9D2dfd6066d5935267291718E8AA16C8Ab729E9d", + "moduleProxyFactory": "0x00000000000DC7F163742Eb4aBEf650037b1f588", + "safeSingleton": "0xfb1bffC9d739B8D520DaF37dF666da4C687191EA" + }, "137": { "gnosisFallbackLibrary": "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4", "gnosisMultisendLibrary": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761", "gnosisSafeProxyFactory": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", - "hatsProtocol": "0xe81597289a249ae725c2d80e7848dbfa9708c22d", + "hatsProtocol": "0x9D2dfd6066d5935267291718E8AA16C8Ab729E9d", "moduleProxyFactory": "0x00000000000DC7F163742Eb4aBEf650037b1f588", "safeSingleton": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552" }, - "42161": {}, + "42161": { + "gnosisFallbackLibrary": "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4", + "gnosisMultisendLibrary": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761", + "gnosisSafeProxyFactory": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", + "hatsProtocol": "0x9D2dfd6066d5935267291718E8AA16C8Ab729E9d", + "moduleProxyFactory": "0x00000000000DC7F163742Eb4aBEf650037b1f588", + "safeSingleton": "0x3E5c63644E683549055b9Be8653de26E0B4CD36E" + }, "11155111": {} } \ No newline at end of file diff --git a/script/HatsSignerGateFactory.s.sol b/script/HatsSignerGateFactory.s.sol index 9f9d7f7..ca5357b 100644 --- a/script/HatsSignerGateFactory.s.sol +++ b/script/HatsSignerGateFactory.s.sol @@ -19,7 +19,8 @@ contract DeployHatsSignerGateFactory is Script { address public safeSingleton; // deployment params to be set manually - string public version = "HSG Beta 5"; + string public version = "1.0-beta"; + bytes32 public SALT = bytes32(abi.encode(0x4a75)); // ~ H(4) A(a) T(7) S(5) function getChainKey() public view returns (string memory) { return string.concat(".", vm.toString(block.chainid)); @@ -42,14 +43,15 @@ contract DeployHatsSignerGateFactory is Script { setDeployParams(); uint256 privKey = vm.envUint("PRIVATE_KEY"); address deployer = vm.rememberKey(privKey); + // console2.log("deployer", deployer); + console2.log("deployer balance (wei):", deployer.balance); vm.startBroadcast(deployer); - // deploy singleton - HatsSignerGate hsgSingleton = new HatsSignerGate(); - MultiHatsSignerGate mhsgSingleton = new MultiHatsSignerGate(); - - /* HatsSignerGateFactory factory = */ - new HatsSignerGateFactory( + // deploy singletons + HatsSignerGate hsgSingleton = new HatsSignerGate{ salt: SALT }(); + MultiHatsSignerGate mhsgSingleton = new MultiHatsSignerGate{ salt: SALT }(); + // deploy factory + HatsSignerGateFactory factory = new HatsSignerGateFactory{ salt: SALT }( address(hsgSingleton), address(mhsgSingleton), hats, @@ -61,15 +63,8 @@ contract DeployHatsSignerGateFactory is Script { version ); - // // uncomment to check if its working correctly when simulating - // (address hsg, address safe) = factory.deployHatsSignerGateAndSafe( - // 1, - // 2, - // 3, - // 4, - // 5, - // 6 - // ); + factory; + // GnosisSafe _safe = GnosisSafe(payable(safe)); // console2.log("safe threshold", _safe.getThreshold()); // console2.log("hsg is module", _safe.isModuleEnabled(hsg));