From fe43dfbf5a5b877a43244e8012a7a05d28e64ec6 Mon Sep 17 00:00:00 2001 From: Elliot Date: Thu, 24 Oct 2024 18:15:36 -0700 Subject: [PATCH 1/4] deployment: base and mainnet Signed-off-by: Elliot --- addresses/1.json | 27 ++++++++++++++++++++++++++- addresses/8453.json | 25 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/addresses/1.json b/addresses/1.json index 2d06c2b6..e6561607 100644 --- a/addresses/1.json +++ b/addresses/1.json @@ -5,7 +5,7 @@ "isContract": true }, { - "addr": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "addr": "0x29B28B0Ff5B6B26448F3Ac02Cd209539626D96Ab", "name": "DEPLOYER_EOA", "isContract": false }, @@ -68,5 +68,30 @@ "addr": "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5", "name": "C_ETHER", "isContract": true + }, + { + "addr": "0xe0C9843F87134e0036823ecb5e003DA2B2bC57d7", + "isContract": true, + "name": "TIMELOCK_FACTORY" + }, + { + "addr": "0x38D1856d010b19dF1043AEdd33baF25e1256eFc6", + "isContract": true, + "name": "RECOVERY_SPELL_FACTORY" + }, + { + "addr": "0x9BEccf76a2aF55793241F079bD4145ED7026F699", + "isContract": true, + "name": "GUARD" + }, + { + "addr": "0xa3D5d6739a657d081A859085eDBef0a54446c437", + "isContract": true, + "name": "INSTANCE_DEPLOYER" + }, + { + "addr": "0x8449F6ca1A6BA82ed62953145577D3d3fBF58A67", + "isContract": true, + "name": "ADDRESS_CALCULATION" } ] \ No newline at end of file diff --git a/addresses/8453.json b/addresses/8453.json index 80e075ae..7a3de1bd 100644 --- a/addresses/8453.json +++ b/addresses/8453.json @@ -23,5 +23,30 @@ "addr": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552", "name": "SAFE_LOGIC", "isContract": true + }, + { + "addr": "0xe0C9843F87134e0036823ecb5e003DA2B2bC57d7", + "isContract": true, + "name": "TIMELOCK_FACTORY" + }, + { + "addr": "0x38D1856d010b19dF1043AEdd33baF25e1256eFc6", + "isContract": true, + "name": "RECOVERY_SPELL_FACTORY" + }, + { + "addr": "0x9BEccf76a2aF55793241F079bD4145ED7026F699", + "isContract": true, + "name": "GUARD" + }, + { + "addr": "0xa3D5d6739a657d081A859085eDBef0a54446c437", + "isContract": true, + "name": "INSTANCE_DEPLOYER" + }, + { + "addr": "0x8449F6ca1A6BA82ed62953145577D3d3fBF58A67", + "isContract": true, + "name": "ADDRESS_CALCULATION" } ] \ No newline at end of file From 50d846cc81c94c40ab92c758ef5626e07290f394 Mon Sep 17 00:00:00 2001 From: Elliot Date: Thu, 24 Oct 2024 18:50:15 -0700 Subject: [PATCH 2/4] redeploy: verify all addresses on etherscan Signed-off-by: Elliot --- addresses/1.json | 10 +++++----- addresses/8453.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addresses/1.json b/addresses/1.json index e6561607..35e5e57f 100644 --- a/addresses/1.json +++ b/addresses/1.json @@ -70,27 +70,27 @@ "isContract": true }, { - "addr": "0xe0C9843F87134e0036823ecb5e003DA2B2bC57d7", + "addr": "0x11abBC55900602B8A3a6DC71e25a1Ea40CE114a7", "isContract": true, "name": "TIMELOCK_FACTORY" }, { - "addr": "0x38D1856d010b19dF1043AEdd33baF25e1256eFc6", + "addr": "0x3B957Bf3Fbc615792c3FFa97fce892EF4FA9ee72", "isContract": true, "name": "RECOVERY_SPELL_FACTORY" }, { - "addr": "0x9BEccf76a2aF55793241F079bD4145ED7026F699", + "addr": "0xfC2275aD9C251bF3792d52E03B3E10371d18D62d", "isContract": true, "name": "GUARD" }, { - "addr": "0xa3D5d6739a657d081A859085eDBef0a54446c437", + "addr": "0x48f351443c58aDFf7e1e5D2B1DF30817F9a1C497", "isContract": true, "name": "INSTANCE_DEPLOYER" }, { - "addr": "0x8449F6ca1A6BA82ed62953145577D3d3fBF58A67", + "addr": "0x9aaba81F20B125cE656dC37154CAAF05dfD3049d", "isContract": true, "name": "ADDRESS_CALCULATION" } diff --git a/addresses/8453.json b/addresses/8453.json index 7a3de1bd..ce9a4741 100644 --- a/addresses/8453.json +++ b/addresses/8453.json @@ -25,27 +25,27 @@ "isContract": true }, { - "addr": "0xe0C9843F87134e0036823ecb5e003DA2B2bC57d7", + "addr": "0x11abBC55900602B8A3a6DC71e25a1Ea40CE114a7", "isContract": true, "name": "TIMELOCK_FACTORY" }, { - "addr": "0x38D1856d010b19dF1043AEdd33baF25e1256eFc6", + "addr": "0x3B957Bf3Fbc615792c3FFa97fce892EF4FA9ee72", "isContract": true, "name": "RECOVERY_SPELL_FACTORY" }, { - "addr": "0x9BEccf76a2aF55793241F079bD4145ED7026F699", + "addr": "0xfC2275aD9C251bF3792d52E03B3E10371d18D62d", "isContract": true, "name": "GUARD" }, { - "addr": "0xa3D5d6739a657d081A859085eDBef0a54446c437", + "addr": "0x48f351443c58aDFf7e1e5D2B1DF30817F9a1C497", "isContract": true, "name": "INSTANCE_DEPLOYER" }, { - "addr": "0x8449F6ca1A6BA82ed62953145577D3d3fBF58A67", + "addr": "0x9aaba81F20B125cE656dC37154CAAF05dfD3049d", "isContract": true, "name": "ADDRESS_CALCULATION" } From a21743fa08064be0266dfea68c1bd663f3e13cd8 Mon Sep 17 00:00:00 2001 From: Elliot Date: Mon, 28 Oct 2024 17:45:37 -0700 Subject: [PATCH 3/4] fix: link test library to deployed address Signed-off-by: Elliot --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 52ae0fab..389c81e4 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,4 +20,4 @@ jobs: uses: ./.github/actions - name: Integration Test Contracts - run: time forge test --mc IntegrationTest -vvv --fork-url $ETH_RPC_URL + run: time forge test --mc IntegrationTest -vvv --fork-url $ETH_RPC_URL --libraries src/BytesHelper.sol:BytesHelper:0x98afd3357918eb5d4be1246ead2256a27de369e3 From 90ac20cfc8efb58af0d6ee843903f90b92a24c4a Mon Sep 17 00:00:00 2001 From: Elliot Date: Mon, 28 Oct 2024 17:46:05 -0700 Subject: [PATCH 4/4] fix: remove last 100 bytes of bytecode for comparison Signed-off-by: Elliot --- src/deploy/SystemDeploy.s.sol | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/deploy/SystemDeploy.s.sol b/src/deploy/SystemDeploy.s.sol index 1933c660..f1b770dd 100644 --- a/src/deploy/SystemDeploy.s.sol +++ b/src/deploy/SystemDeploy.s.sol @@ -6,6 +6,7 @@ import {Addresses} from "@forge-proposal-simulator/addresses/Addresses.sol"; import {Guard} from "src/Guard.sol"; import {Timelock} from "src/Timelock.sol"; +import {BytesHelper} from "src/BytesHelper.sol"; import {TimelockFactory} from "src/TimelockFactory.sol"; import {InstanceDeployer} from "src/InstanceDeployer.sol"; import {AddressCalculation} from "src/views/AddressCalculation.sol"; @@ -15,6 +16,8 @@ import {RecoverySpellFactory} from "src/RecoverySpellFactory.sol"; /// all contracts are permissionless /// DO_PRINT=false DO_BUILD=false DO_RUN=false DO_DEPLOY=true DO_VALIDATE=true forge script src/deploy/SystemDeploy.s.sol:SystemDeploy --fork-url base -vvvvv contract SystemDeploy is MultisigProposal { + using BytesHelper for bytes; + bytes32 public salt = 0x0000000000000000000000000000000000000000000000000000000000003afe; @@ -77,23 +80,29 @@ contract SystemDeploy is MultisigProposal { if (addresses.isAddressSet("TIMELOCK_FACTORY")) { address factory = addresses.getAddress("TIMELOCK_FACTORY"); assertEq( - keccak256(factory.code), - keccak256(type(TimelockFactory).runtimeCode), + keccak256(factory.code.sliceBytes(0, 24116)), + keccak256( + type(TimelockFactory).runtimeCode.sliceBytes(0, 24116) + ), "Incorrect TimelockFactory Bytecode" ); address guard = addresses.getAddress("GUARD"); + assertEq( - keccak256(guard.code), - keccak256(type(Guard).runtimeCode), + keccak256(guard.code.sliceBytes(0, 950)), + keccak256(type(Guard).runtimeCode.sliceBytes(0, 950)), "Incorrect Guard Bytecode" ); address recoverySpellFactory = addresses.getAddress("RECOVERY_SPELL_FACTORY"); + assertEq( - keccak256(recoverySpellFactory.code), - keccak256(type(RecoverySpellFactory).runtimeCode), + keccak256(recoverySpellFactory.code.sliceBytes(0, 9470)), + keccak256( + type(RecoverySpellFactory).runtimeCode.sliceBytes(0, 9470) + ), "Incorrect RecoverySpellFactory Bytecode" );