diff --git a/addresses/Addresses.json b/addresses/Addresses.json index 3de7f7f..a66f919 100644 --- a/addresses/Addresses.json +++ b/addresses/Addresses.json @@ -113,12 +113,6 @@ "name": "OPTIMISM_L1_NFT_BRIDGE_PROXY", "isContract": true }, - { - "addr": "0xAE2AF01232a6c4a4d3012C5eC5b1b35059caF10d", - "chainId": 1, - "name": "OPTIMISM_L1_NFT_BRIDGE_IMPLEMENTATION", - "isContract": true - }, { "addr": "0xE6841D92B0C345144506576eC13ECf5103aC7f49", "chainId": 1, diff --git a/docs/guides/customizing-proposal.md b/docs/guides/customizing-proposal.md index 05ba37d..4fbfaf5 100644 --- a/docs/guides/customizing-proposal.md +++ b/docs/guides/customizing-proposal.md @@ -624,7 +624,7 @@ Copy all address arbitrum address from [Addresses.json](https://github.com/solid ### Running the Proposal ```sh -forge script src/proposals/arbitrum/Arbitrum_Proposal_01.sol --slow --sender ${wallet_address} -vvvv --account ${wallet_name} -g 200 +forge script src/proposals/arbitrum/Arbitrum_Proposal_01.sol --sender -vvvv ``` The script will output the following: @@ -651,13 +651,34 @@ The script will output the following: This proposal upgrades the L2 weth gateway ------------------ Proposal Actions ------------------ - 1). calling 0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827 with 0 eth and 0x1cff79cd000000000000000000000000a98dec0c8e0326756c956033bbf091081986d0ed00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064e17f52e9000000000000000000000000d570ace65c43af47101fc6250fd6fc63d1c22a860000000000000000000000006c411ad3e74de3e7bd422b94a27770f5b86c623b0000000000000000000000006801e4888a91180238a8c36594ec65797ec2dddf00000000000000000000000000000000000000000000000000000000 data. - target: 0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827 + 1). calling ARBITRUM_L2_UPGRADE_EXECUTOR @0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827 with 0 eth and 0x1cff79cd000000000000000000000000a98dec0c8e0326756c956033bbf091081986d0ed00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064e17f52e9000000000000000000000000d570ace65c43af47101fc6250fd6fc63d1c22a860000000000000000000000006c411ad3e74de3e7bd422b94a27770f5b86c623b0000000000000000000000006801e4888a91180238a8c36594ec65797ec2dddf00000000000000000000000000000000000000000000000000000000 data. + target: ARBITRUM_L2_UPGRADE_EXECUTOR @0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827 payload 0x1cff79cd000000000000000000000000a98dec0c8e0326756c956033bbf091081986d0ed00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064e17f52e9000000000000000000000000d570ace65c43af47101fc6250fd6fc63d1c22a860000000000000000000000006c411ad3e74de3e7bd422b94a27770f5b86c623b0000000000000000000000006801e4888a91180238a8c36594ec65797ec2dddf00000000000000000000000000000000000000000000000000000000 +----------------- Proposal Changes --------------- + + + ARBITRUM_L2_UPGRADE_EXECUTOR @0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827: + + State Changes: + Slot: 0x0000000000000000000000000000000000000000000000000000000000000097 + - 0x0000000000000000000000000000000000000000000000000000000000000001 + + 0x0000000000000000000000000000000000000000000000000000000000000002 + Slot: 0x0000000000000000000000000000000000000000000000000000000000000097 + - 0x0000000000000000000000000000000000000000000000000000000000000002 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + + + ARBITRUM_L2_WETH_GATEWAY_PROXY @0x6c411aD3E74De3E7Bd422b94A27770f5B86C623B: + + State Changes: + Slot: 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc + - 0x000000000000000000000000806421d09cdb253aa9d128a658e60c0b95effa01 + + 0x0000000000000000000000006801e4888a91180238a8c36594ec65797ec2dddf + ------------------ Proposal Calldata ------------------ 0x7d5e81e2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000344928c169a000000000000000000000000e6841d92b0c345144506576ec13ecf5103ac7f49000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002c401d5062a000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000009c33e8e47a5438b554b45b782bed73248b78e26754b37292265f0b4a3ede7874000000000000000000000000000000000000000000000000000000000003f48000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e41cff79cd000000000000000000000000a98dec0c8e0326756c956033bbf091081986d0ed00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064e17f52e9000000000000000000000000d570ace65c43af47101fc6250fd6fc63d1c22a860000000000000000000000006c411ad3e74de3e7bd422b94a27770f5b86c623b0000000000000000000000006801e4888a91180238a8c36594ec65797ec2dddf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a546869732070726f706f73616c20757067726164657320746865204c322077657468206761746577617900000000000000000000000000000000000000000000 diff --git a/docs/guides/governor-bravo-proposal.md b/docs/guides/governor-bravo-proposal.md index 3668162..4ab6921 100644 --- a/docs/guides/governor-bravo-proposal.md +++ b/docs/guides/governor-bravo-proposal.md @@ -358,13 +358,13 @@ The script will output the following: --------- Addresses added --------- { - 'addr': '0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c', + 'addr': '0x69A5DfCD97eF074108b480e369CecfD9335565A2', 'chainId': 11155111, 'isContract': true , 'name': 'BRAVO_VAULT' }, { - 'addr': '0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465', + 'addr': '0x541234b61c081eaAE62c9EF52A633cD2aaf92A05', 'chainId': 11155111, 'isContract': true , 'name': 'BRAVO_VAULT_TOKEN' @@ -374,29 +374,67 @@ The script will output the following: Bravo proposal mock ------------------ Proposal Actions ------------------ - 1). calling 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c with 0 eth and 0x0ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001 data. - target: 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c + 1). calling BRAVO_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 data. + target: BRAVO_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload - 0x0ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001 + 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 - 2). calling 0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465 with 0 eth and 0x095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465 + 2). calling BRAVO_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 with 0 eth and 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 data. + target: BRAVO_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 payload - 0x095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a000000 + 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 - 3). calling 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c with 0 eth and 0x47e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c + 3). calling BRAVO_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 data. + target: BRAVO_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload - 0x47e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000 + 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 +----------------- Proposal Changes --------------- ------------------- Proposal Calldata ------------------ - 0xda95691a00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013427261766f2070726f706f73616c206d6f636b00000000000000000000000000 + BRAVO_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2: + + State Changes: + Slot: 0x0109a4c58357d68655b3b5dc2118952a94bd8ac20af5042c287646f3faf63d0e + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + Slot: 0x03f62bda81ef166f1cb51858c0b52c0203caebd9f546b6321f329143160571e6 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0x03f62bda81ef166f1cb51858c0b52c0203caebd9f546b6321f329143160571e7 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000066b3625c + + + BRAVO_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05: + + State Changes: + Slot: 0x9e8d6b450a8ff102c29486d666c519809e451e279af63f2f116c2c6d3c42003e + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0x9e8d6b450a8ff102c29486d666c519809e451e279af63f2f116c2c6d3c42003e + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0x367d8f8d08b068e2c4f2b565d1cf8f08fb278cf5b23a25b874071c824aa6f466 + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0xdbde422d34765d6fa450f050d95a7072ade5d1938cc2a6df4441c92d8c263663 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + + + PROTOCOL_TIMELOCK_BRAVO @0xF75C465c091bDcb9D28A767AaC44d4aAFa4b7Af1: + + Transfers: + Sent 10000000000000000000000000 BRAVO_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 to BRAVO_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 + + +------------------ Proposal Calldata ------------------ + 0xda95691a00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a0500000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013427261766f2070726f706f73616c206d6f636b00000000000000000000000000 ``` A DAO member can verify whether the calldata proposed on the governance matches the calldata from the script execution. It's crucial to note that two new addresses have been added to the `Addresses.sol` storage during proposal execution. However, these addresses are not included in the JSON file and must be added manually as new contracts have now been added to the system. diff --git a/docs/guides/multisig-proposal.md b/docs/guides/multisig-proposal.md index 12265c2..9c8f00b 100644 --- a/docs/guides/multisig-proposal.md +++ b/docs/guides/multisig-proposal.md @@ -216,19 +216,18 @@ forge script src/proposals/simple-vault-multisig/MultisigProposal_01.sol --accou The script will output the following: ```sh -Multisig output: == Logs == --------- Addresses added --------- { - 'addr': '0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c', + 'addr': '0x69A5DfCD97eF074108b480e369CecfD9335565A2', 'chainId': 11155111, 'isContract': true , 'name': 'MULTISIG_VAULT' }, { - 'addr': '0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465', + 'addr': '0x541234b61c081eaAE62c9EF52A633cD2aaf92A05', 'chainId': 11155111, 'isContract': true , 'name': 'MULTISIG_TOKEN' @@ -238,28 +237,67 @@ Multisig output: Multisig proposal mock ------------------ Proposal Actions ------------------ - 1). calling 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c with 0 eth and 0x0ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001 data. - target: 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c + 1). calling MULTISIG_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 data. + target: MULTISIG_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload - 0x0ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001 + 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 - 2). calling 0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465 with 0 eth and 0x095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465 + 2). calling MULTISIG_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 with 0 eth and 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 data. + target: MULTISIG_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 payload - 0x095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a000000 + 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 - 3). calling 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c with 0 eth and 0x47e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c + 3). calling MULTISIG_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 data. + target: MULTISIG_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload - 0x47e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000 + 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 +----------------- Proposal Changes --------------- + + + MULTISIG_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2: + + State Changes: + Slot: 0x0109a4c58357d68655b3b5dc2118952a94bd8ac20af5042c287646f3faf63d0e + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + Slot: 0x5c89714d3d4b91fc2765de3ae9d78fa63c87d45455b314a1983c2aa9091d790a + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0x5c89714d3d4b91fc2765de3ae9d78fa63c87d45455b314a1983c2aa9091d790b + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000066b363b8 + + + MULTISIG_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05: + + State Changes: + Slot: 0x718dfd4f53e9042ef07e2076db0bd95307c2640e8a375658915485d37fe05299 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0x718dfd4f53e9042ef07e2076db0bd95307c2640e8a375658915485d37fe05299 + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0x233078cbccee5fe4b8e098848f55eedd08e0fd43b7ddea16843770de9714b0bc + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0xdbde422d34765d6fa450f050d95a7072ade5d1938cc2a6df4441c92d8c263663 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + + + DEV_MULTISIG @0x1c1A8861139C0126176bD1B0d01Bbf5E4c99591b: + + Transfers: + Sent 10000000000000000000000000 MULTISIG_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 to MULTISIG_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 + ------------------ Proposal Calldata ------------------ - 0x174dea7100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000260000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000440ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004447e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000 + 0x174dea710000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000026000000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000440ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004447e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000 ``` A signer from the multisig address can check whether the calldata proposed on the multisig matches the calldata obtained from the call. It is crucial to note that two new addresses have been added to the Addresses.sol storage. These addresses are not included in the JSON file and must be added manually for accuracy. diff --git a/docs/guides/oz-governor-proposal.md b/docs/guides/oz-governor-proposal.md index 6c7144e..2478f47 100644 --- a/docs/guides/oz-governor-proposal.md +++ b/docs/guides/oz-governor-proposal.md @@ -366,29 +366,67 @@ The script will output the following: OZ Governor proposal mock 1 ------------------ Proposal Actions ------------------ - 1). calling 0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 data. - target: 0x69A5DfCD97eF074108b480e369CecfD9335565A2 + 1). calling OZ_GOVERNOR_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 data. + target: OZ_GOVERNOR_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 - 2). calling 0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 with 0 eth and 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 + 2). calling OZ_GOVERNOR_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 with 0 eth and 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 data. + target: OZ_GOVERNOR_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 payload 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 - 3). calling 0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0x69A5DfCD97eF074108b480e369CecfD9335565A2 + 3). calling OZ_GOVERNOR_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 data. + target: OZ_GOVERNOR_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 +----------------- Proposal Changes --------------- ------------------- Proposal Calldata ------------------ - 0x7d5e81e20000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a0500000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b476f7665726e6f72206f7a2070726f706f73616c206d6f636b20310000000000 + OZ_GOVERNOR_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2: + + State Changes: + Slot: 0x0109a4c58357d68655b3b5dc2118952a94bd8ac20af5042c287646f3faf63d0e + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + Slot: 0xd6aeaeb3300a8de8546c3164db6c6689eaa6df771a85348358817727e885046e + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0xd6aeaeb3300a8de8546c3164db6c6689eaa6df771a85348358817727e885046f + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000066b36484 + + + OZ_GOVERNOR_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05: + + State Changes: + Slot: 0xf51fdc8c89661be75f898df18c3da3a5aab2536504db7216e2b7d817bb1d0b7c + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0xf51fdc8c89661be75f898df18c3da3a5aab2536504db7216e2b7d817bb1d0b7c + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0xabf7c1bc82cf6c53ee2adf60845603e0c903e8d02c0d5cfbbd892c2611073b21 + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0xdbde422d34765d6fa450f050d95a7072ade5d1938cc2a6df4441c92d8c263663 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + + + OZ_GOVERNOR_TIMELOCK @0xD21a3b1b572F7C38b5e3ff841d1D2903e1B03695: + + Transfers: + Sent 10000000000000000000000000 OZ_GOVERNOR_VAULT_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 to OZ_GOVERNOR_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 + + +------------------ Proposal Calldata ------------------ + 0x7d5e81e20000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a0500000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b4f5a20476f7665726e6f722070726f706f73616c206d6f636b20310000000000 ``` A DAO member can check whether the calldata proposed on the governance matches the calldata from the script exeuction. It is crucial to note that two new addresses have been added to the `Addresses.sol` storage during proposal execution. However, these addresses are not included in the JSON file and must be added manually as new contracts have now been added to the system. diff --git a/docs/guides/timelock-proposal.md b/docs/guides/timelock-proposal.md index 98db901..6c52377 100644 --- a/docs/guides/timelock-proposal.md +++ b/docs/guides/timelock-proposal.md @@ -226,19 +226,18 @@ forge script src/proposals/simple-vault-timelock/TimelockProposal_01.sol --accou The script will output the following: ```sh -Timelock output: == Logs == --------- Addresses added --------- { - 'addr': '0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c', + 'addr': '0x69A5DfCD97eF074108b480e369CecfD9335565A2', 'chainId': 11155111, 'isContract': true , 'name': 'TIMELOCK_VAULT' }, { - 'addr': '0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465', + 'addr': '0x541234b61c081eaAE62c9EF52A633cD2aaf92A05', 'chainId': 11155111, 'isContract': true , 'name': 'TIMELOCK_TOKEN' @@ -248,32 +247,71 @@ Timelock output: Timelock proposal mock ------------------ Proposal Actions ------------------ - 1). calling 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c with 0 eth and 0x0ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001 data. - target: 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c + 1). calling TIMELOCK_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 data. + target: TIMELOCK_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload - 0x0ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001 + 0x0ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001 - 2). calling 0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465 with 0 eth and 0x095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0x2A2A18A71d0eA4B97ebb18D3820cd3625C3A1465 + 2). calling TIMELOCK_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 with 0 eth and 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 data. + target: TIMELOCK_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 payload - 0x095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a000000 + 0x095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a000000 - 3). calling 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c with 0 eth and 0x47e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000 data. - target: 0xF9C26968C2d4E1C2ADA13c6323be31c1067EBB7c + 3). calling TIMELOCK_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 with 0 eth and 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 data. + target: TIMELOCK_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 payload - 0x47e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a000000 + 0x47e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a000000 +----------------- Proposal Changes --------------- + + + TIMELOCK_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2: + + State Changes: + Slot: 0x0109a4c58357d68655b3b5dc2118952a94bd8ac20af5042c287646f3faf63d0e + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + Slot: 0x570d2578c4c2f96ed37305ce1685ed898fe432030f7fac7156d302ec6426a582 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0x570d2578c4c2f96ed37305ce1685ed898fe432030f7fac7156d302ec6426a583 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000066b36550 + + + TIMELOCK_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05: + + State Changes: + Slot: 0xe27288751d863b582c7b8b6e123cdcc6c4c2d47694a919c30174370281c9b73b + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + Slot: 0xe27288751d863b582c7b8b6e123cdcc6c4c2d47694a919c30174370281c9b73b + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0x5581b3a724040c4734d7106fa4393f167b0e7b9b13664999ef1d386d2af74db1 + - 0x000000000000000000000000000000000000000000084595161401484a000000 + + 0x0000000000000000000000000000000000000000000000000000000000000000 + Slot: 0xdbde422d34765d6fa450f050d95a7072ade5d1938cc2a6df4441c92d8c263663 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x000000000000000000000000000000000000000000084595161401484a000000 + + + PROTOCOL_TIMELOCK @0xFAb1fCA6DE9BEc87AD88cE70d1b5356aaf0f5E74: + + Transfers: + Sent 10000000000000000000000000 TIMELOCK_TOKEN @0x541234b61c081eaAE62c9EF52A633cD2aaf92A05 to TIMELOCK_VAULT @0x69A5DfCD97eF074108b480e369CecfD9335565A2 + ------------------ Schedule Calldata ------------------ - 0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000eff0dbf88af0664ed6d8db81251aaaeac77a977f015bb9bf3d34c91b1bf988a6000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000 + 0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000eff0dbf88af0664ed6d8db81251aaaeac77a977f015bb9bf3d34c91b1bf988a6000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000000300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a0500000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000 ------------------ Execute Calldata ------------------ - 0xe38335e500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000000eff0dbf88af0664ed6d8db81251aaaeac77a977f015bb9bf3d34c91b1bf988a60000000000000000000000000000000000000000000000000000000000000003000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b0000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a14650000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f9c26968c2d4e1c2ada13c6323be31c1067ebb7c000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef240000000000000000000000002a2a18a71d0ea4b97ebb18d3820cd3625c3a1465000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000 + 0xe38335e500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000000eff0dbf88af0664ed6d8db81251aaaeac77a977f015bb9bf3d34c91b1bf988a6000000000000000000000000000000000000000000000000000000000000000300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a0500000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000440ffb1d8b000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000069a5dfcd97ef074108b480e369cecfd9335565a2000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004447e7ef24000000000000000000000000541234b61c081eaae62c9ef52a633cd2aaf92a05000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000 ``` It's crucial to note that two new addresses have been added to the `Addresses.sol` storage. These addresses are not included in the JSON file and must be manually added to ensure accuracy. diff --git a/docs/mainnet-examples/ArbitrumTimelock.md b/docs/mainnet-examples/ArbitrumTimelock.md index 0ce4a49..1c345f1 100644 --- a/docs/mainnet-examples/ArbitrumTimelock.md +++ b/docs/mainnet-examples/ArbitrumTimelock.md @@ -185,13 +185,34 @@ The script will output the following: Mock proposal that upgrades the weth gateway ------------------ Proposal Actions ------------------ - 1). calling 0x3ffFbAdAF827559da092217e474760E2b2c3CeDd with 0 eth and 0x1cff79cd00000000000000000000000056a0dfa59fd02284d1b39327cfe92251051da6bb0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006409b461c10000000000000000000000009ad46fac0cf7f790e5be05a0f15223935a0c0ada000000000000000000000000d92023e9d9911199a6711321d1277285e6d4e2db000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c100000000000000000000000000000000000000000000000000000000 data. - target: 0x3ffFbAdAF827559da092217e474760E2b2c3CeDd + 1). calling ARBITRUM_L1_UPGRADE_EXECUTOR @0x3ffFbAdAF827559da092217e474760E2b2c3CeDd with 0 eth and 0x1cff79cd00000000000000000000000056a0dfa59fd02284d1b39327cfe92251051da6bb0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006409b461c10000000000000000000000009ad46fac0cf7f790e5be05a0f15223935a0c0ada000000000000000000000000d92023e9d9911199a6711321d1277285e6d4e2db000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c100000000000000000000000000000000000000000000000000000000 data. + target: ARBITRUM_L1_UPGRADE_EXECUTOR @0x3ffFbAdAF827559da092217e474760E2b2c3CeDd payload 0x1cff79cd00000000000000000000000056a0dfa59fd02284d1b39327cfe92251051da6bb0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006409b461c10000000000000000000000009ad46fac0cf7f790e5be05a0f15223935a0c0ada000000000000000000000000d92023e9d9911199a6711321d1277285e6d4e2db000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c100000000000000000000000000000000000000000000000000000000 +----------------- Proposal Changes --------------- + + + ARBITRUM_L1_UPGRADE_EXECUTOR @0x3ffFbAdAF827559da092217e474760E2b2c3CeDd: + + State Changes: + Slot: 0x0000000000000000000000000000000000000000000000000000000000000097 + - 0x0000000000000000000000000000000000000000000000000000000000000001 + + 0x0000000000000000000000000000000000000000000000000000000000000002 + Slot: 0x0000000000000000000000000000000000000000000000000000000000000097 + - 0x0000000000000000000000000000000000000000000000000000000000000002 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + + + ARBITRUM_L1_WETH_GATEWAY_PROXY @0xd92023E9d9911199a6711321D1277285e6d4e2db: + + State Changes: + Slot: 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc + - 0x0000000000000000000000004b8e9b3f253e68837bf719997b1eeb9e8f1960e2 + + 0x000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c1 + ------------------ Schedule Calldata ------------------ 0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000050deb3e0ef55ff1976003bef5ca1a251beebbeb0d17ef15e6340ea825bbfe8e8000000000000000000000000000000000000000000000000000000000003f48000000000000000000000000000000000000000000000000000000000000000010000000000000000000000003fffbadaf827559da092217e474760e2b2c3cedd000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e41cff79cd00000000000000000000000056a0dfa59fd02284d1b39327cfe92251051da6bb0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006409b461c10000000000000000000000009ad46fac0cf7f790e5be05a0f15223935a0c0ada000000000000000000000000d92023e9d9911199a6711321d1277285e6d4e2db000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/docs/mainnet-examples/CompoundGovernorBravo.md b/docs/mainnet-examples/CompoundGovernorBravo.md index c1b0650..50cf396 100644 --- a/docs/mainnet-examples/CompoundGovernorBravo.md +++ b/docs/mainnet-examples/CompoundGovernorBravo.md @@ -117,19 +117,32 @@ The script will output the following: Mock proposal that adjust IR Curve for Compound v3 WETH on Mainnet ------------------ Proposal Actions ------------------ - 1). calling 0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 with 0 eth and 0x5bfb8373000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000 data. - target: 0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 + 1). calling COMPOUND_CONFIGURATOR @0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 with 0 eth and 0x5bfb8373000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000 data. + target: COMPOUND_CONFIGURATOR @0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 payload 0x5bfb8373000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000 - 2). calling 0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 with 0 eth and 0x058e4155000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000 data. - target: 0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 + 2). calling COMPOUND_CONFIGURATOR @0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 with 0 eth and 0x058e4155000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000 data. + target: COMPOUND_CONFIGURATOR @0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3 payload 0x058e4155000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000 +----------------- Proposal Changes --------------- + + + COMPOUND_CONFIGURATOR @0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3: + + State Changes: + Slot: 0x81786960a4c38938c01fafa8d0783bc04e719c248eafc32d7335695ed80183a0 + - 0x0bcbce7f1b15000000000000000000000de0b6b3a76400000041b9a6e8584000 + + 0x0a688906bd8b000000000000000000000de0b6b3a76400000041b9a6e8584000 + Slot: 0x81786960a4c38938c01fafa8d0783bc04e719c248eafc32d7335695ed801839f + - 0x000000000bcbce7f1b150000e2c1f54aff6b38fd9df7a69f22cb5fd3ba09f030 + + 0x000000000a688906bd8b0000e2c1f54aff6b38fd9df7a69f22cb5fd3ba09f030 + ------------------ Proposal Calldata ------------------ 0xda95691a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000316f9708bb98af7da9c68c1c3b5e79039cd336e3000000000000000000000000316f9708bb98af7da9c68c1c3b5e79039cd336e3000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000445bfb8373000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044058e4155000000000000000000000000a17581a9e3356d9a858b789d68b4d866e593ae940000000000000000000000000000000000000000000000000a688906bd8b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000424d6f636b2070726f706f73616c20746861742061646a75737420495220437572766520666f7220436f6d706f756e642076332057455448206f6e204d61696e6e6574000000000000000000000000000000000000000000000000000000000000 diff --git a/docs/mainnet-examples/ENSOzGovernor.md b/docs/mainnet-examples/ENSOzGovernor.md index bffe314..b2197f0 100644 --- a/docs/mainnet-examples/ENSOzGovernor.md +++ b/docs/mainnet-examples/ENSOzGovernor.md @@ -129,13 +129,23 @@ The script will output the following: Call setController on the Root contract at root.ens.eth, passing in the address of the new DNS registrar ------------------ Proposal Actions ------------------ - 1). calling 0xaB528d626EC275E3faD363fF1393A41F581c5897 with 0 eth and 0xe0dba60f000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c10000000000000000000000000000000000000000000000000000000000000001 data. - target: 0xaB528d626EC275E3faD363fF1393A41F581c5897 + 1). calling ENS_ROOT @0xaB528d626EC275E3faD363fF1393A41F581c5897 with 0 eth and 0xe0dba60f000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c10000000000000000000000000000000000000000000000000000000000000001 data. + target: ENS_ROOT @0xaB528d626EC275E3faD363fF1393A41F581c5897 payload 0xe0dba60f000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c10000000000000000000000000000000000000000000000000000000000000001 +----------------- Proposal Changes --------------- + + + ENS_ROOT @0xaB528d626EC275E3faD363fF1393A41F581c5897: + + State Changes: + Slot: 0x683b779d654146db8352b5203c98de0bc792fdb59471541d9a885b4f9933a736 + - 0x0000000000000000000000000000000000000000000000000000000000000000 + + 0x0000000000000000000000000000000000000000000000000000000000000001 + ------------------ Proposal Calldata ------------------ 0x7d5e81e2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ab528d626ec275e3fad363ff1393a41f581c589700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044e0dba60f000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006843616c6c20736574436f6e74726f6c6c6572206f6e2074686520526f6f7420636f6e747261637420617420726f6f742e656e732e6574682c2070617373696e6720696e207468652061646472657373206f6620746865206e657720444e5320726567697374726172000000000000000000000000000000000000000000000000 diff --git a/docs/mainnet-examples/OptimismMultisig.md b/docs/mainnet-examples/OptimismMultisig.md index 6ce8042..189d680 100644 --- a/docs/mainnet-examples/OptimismMultisig.md +++ b/docs/mainnet-examples/OptimismMultisig.md @@ -128,18 +128,37 @@ The script will output the following: ```sh == Logs == + +--------- Addresses added --------- + { + 'addr': '0x714CB817EfD08fEe91558b07A924a87C3587F3C1', + 'chainId': 1, + 'isContract': true , + 'name': 'OPTIMISM_L1_NFT_BRIDGE_IMPLEMENTATION' +} + ---------------- Proposal Description ---------------- Mock proposal that upgrade the L1 NFT Bridge ------------------ Proposal Actions ------------------ - 1). calling 0x543bA4AADBAb8f9025686Bd03993043599c6fB04 with 0 eth and 0x99a88ec40000000000000000000000005a7749f83b81b301cab5f48eb8516b986daef23d000000000000000000000000ae2af01232a6c4a4d3012c5ec5b1b35059caf10d data. - target: 0x543bA4AADBAb8f9025686Bd03993043599c6fB04 + 1). calling OPTIMISM_PROXY_ADMIN @0x543bA4AADBAb8f9025686Bd03993043599c6fB04 with 0 eth and 0x99a88ec40000000000000000000000005a7749f83b81b301cab5f48eb8516b986daef23d000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c1 data. + target: OPTIMISM_PROXY_ADMIN @0x543bA4AADBAb8f9025686Bd03993043599c6fB04 payload - 0x99a88ec40000000000000000000000005a7749f83b81b301cab5f48eb8516b986daef23d000000000000000000000000ae2af01232a6c4a4d3012c5ec5b1b35059caf10d + 0x99a88ec40000000000000000000000005a7749f83b81b301cab5f48eb8516b986daef23d000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c1 + + + +----------------- Proposal Changes --------------- + + OPTIMISM_L1_NFT_BRIDGE_PROXY @0x5a7749f83b81B301cAb5f48EB8516B986DAef23D: + State Changes: + Slot: 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc + - 0x000000000000000000000000ae2af01232a6c4a4d3012c5ec5b1b35059caf10d + + 0x000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c1 ------------------ Proposal Calldata ------------------ - 0x174dea71000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000543ba4aadbab8f9025686bd03993043599c6fb04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004499a88ec40000000000000000000000005a7749f83b81b301cab5f48eb8516b986daef23d000000000000000000000000ae2af01232a6c4a4d3012c5ec5b1b35059caf10d00000000000000000000000000000000000000000000000000000000 + 0x174dea71000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000543ba4aadbab8f9025686bd03993043599c6fb04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004499a88ec40000000000000000000000005a7749f83b81b301cab5f48eb8516b986daef23d000000000000000000000000714cb817efd08fee91558b07a924a87c3587f3c100000000000000000000000000000000000000000000000000000000 ``` diff --git a/src/proposals/Proposal.sol b/src/proposals/Proposal.sol index 6a69b52..be0f0d4 100644 --- a/src/proposals/Proposal.sol +++ b/src/proposals/Proposal.sol @@ -16,6 +16,31 @@ abstract contract Proposal is Test, Script, IProposal { string description; } + struct TransferInfo { + address to; + uint256 value; + address tokenAddress; + } + + struct StateInfo { + bytes32 slot; + bytes32 oldValue; + bytes32 newValue; + } + + /// @notice transfers during proposal execution + mapping(address addr => TransferInfo[] transfers) + private _proposalTransfers; + + /// @notice state changes during proposal execution + mapping(address addr => StateInfo[] stateChanges) private _stateInfos; + + /// @notice addresses involved in state changes or token transfers + address[] private _proposalAffectedAddresses; + + /// @notice map if an address is affected in proposal execution + mapping(address addr => bool isAffected) private _isProposalAffectedAddress; + /// @notice starting snapshot of the contract state before the calls are made uint256 private _startSnapshot; @@ -181,15 +206,69 @@ abstract contract Proposal is Test, Script, IProposal { console.log("\n------------------ Proposal Actions ------------------"); for (uint256 i; i < actions.length; i++) { console.log("%d). %s", i + 1, actions[i].description); - console.log("target: %s\npayload", actions[i].target); + console.log( + "target: %s\npayload", + _getAddressLabel(actions[i].target) + ); console.logBytes(actions[i].arguments); console.log("\n"); } - console.log( - "\n\n------------------ Proposal Calldata ------------------" - ); - console.logBytes(getCalldata()); + console.log("\n----------------- Proposal Changes ---------------"); + for (uint256 i; i < _proposalAffectedAddresses.length; i++) { + address account = _proposalAffectedAddresses[i]; + + console.log( + "\n\n", + string(abi.encodePacked(_getAddressLabel(account), ":")) + ); + + // print token transfers + TransferInfo[] memory transfers = _proposalTransfers[account]; + if (transfers.length > 0) { + console.log("\n Transfers:"); + } + for (uint256 j; j < transfers.length; j++) { + if (transfers[j].tokenAddress == address(0)) { + console.log( + string( + abi.encodePacked( + "Sent ", + vm.toString(transfers[j].value), + " ETH to ", + _getAddressLabel(transfers[j].to) + ) + ) + ); + } else { + console.log( + string( + abi.encodePacked( + "Sent ", + vm.toString(transfers[j].value), + " ", + _getAddressLabel(transfers[j].tokenAddress), + " to ", + _getAddressLabel(transfers[j].to) + ) + ) + ); + } + } + + // print state changes + StateInfo[] memory stateChanges = _stateInfos[account]; + if (stateChanges.length > 0) { + console.log("\n State Changes:"); + } + for (uint256 j; j < stateChanges.length; j++) { + console.log("Slot:", vm.toString(stateChanges[j].slot)); + console.log("- ", vm.toString(stateChanges[j].oldValue)); + console.log("+ ", vm.toString(stateChanges[j].newValue)); + } + } + + _printProposalCalldata(); } /// -------------------------------------------------------------------- @@ -225,6 +304,14 @@ abstract contract Proposal is Test, Script, IProposal { /// @notice validate actions function _validateActions() internal virtual {} + /// @notice print proposal calldata + function _printProposalCalldata() internal virtual { + console.log( + "\n\n------------------ Proposal Calldata ------------------" + ); + console.logBytes(getCalldata()); + } + /// -------------------------------------------------------------------- /// -------------------------------------------------------------------- /// ------------------------- Private functions ------------------------ @@ -248,7 +335,8 @@ abstract contract Proposal is Test, Script, IProposal { /// @notice to be used at the end of the build function to snapshot /// the actions performed by the proposal and revert these changes - /// then, stop the prank and record the actions that were taken by the proposal. + /// then, stop the prank and record the state diffs and actions that + /// were taken by the proposal. /// @param caller the address that will be used as the caller for the /// actions, e.g. multisig address, timelock address, etc. function _endBuild(address caller) private { @@ -263,6 +351,8 @@ abstract contract Proposal is Test, Script, IProposal { "failed to revert back to snapshot, unsafe state to run proposal" ); + _processStateDiffChanges(accountAccesses); + for (uint256 i = 0; i < accountAccesses.length; i++) { /// only care about calls from the original caller, /// static calls are ignored, @@ -273,8 +363,9 @@ abstract contract Proposal is Test, Script, IProposal { /// ignore calls to vm in the build function accountAccesses[i].accessor != address(addresses) && accountAccesses[i].kind == VmSafe.AccountAccessKind.Call && - accountAccesses[i].accessor == caller /// caller is correct, not a subcall + accountAccesses[i].accessor == caller ) { + /// caller is correct, not a subcall _validateAction( accountAccesses[i].account, accountAccesses[i].value, @@ -289,7 +380,7 @@ abstract contract Proposal is Test, Script, IProposal { description: string( abi.encodePacked( "calling ", - vm.toString(accountAccesses[i].account), + _getAddressLabel(accountAccesses[i].account), " with ", vm.toString(accountAccesses[i].value), " eth and ", @@ -304,4 +395,158 @@ abstract contract Proposal is Test, Script, IProposal { _validateActions(); } + + /// @notice helper method to get transfers and state changes of proposal affected addresses + function _processStateDiffChanges( + VmSafe.AccountAccess[] memory accountAccesses + ) internal { + for (uint256 i = 0; i < accountAccesses.length; i++) { + // process ETH transfer changes + _processETHTransferChanges(accountAccesses[i]); + + // process ERC20 transfer changes + _processERC20TransferChanges(accountAccesses[i]); + + // process state changes + _processStateChanges(accountAccesses[i].storageAccesses); + } + } + + /// @notice helper method to get eth transfers of proposal affected addresses + function _processETHTransferChanges( + VmSafe.AccountAccess memory accountAccess + ) internal { + address account = accountAccess.account; + // get eth transfers + if (accountAccess.value != 0) { + // add address to proposal affected addresses array only if not already added + if (!_isProposalAffectedAddress[accountAccess.accessor]) { + _isProposalAffectedAddress[accountAccess.accessor] = true; + _proposalAffectedAddresses.push(accountAccess.accessor); + } + _proposalTransfers[accountAccess.accessor].push( + TransferInfo({ + to: account, + value: accountAccess.value, + tokenAddress: address(0) + }) + ); + } + } + + /// @notice helper method to get ERC20 token transfers of proposal affected addresses + function _processERC20TransferChanges( + VmSafe.AccountAccess memory accountAccess + ) internal { + bytes memory data = accountAccess.data; + if (data.length <= 4) { + return; + } + + // get function selector from calldata + bytes4 selector = bytes4(data); + + // get function params + bytes memory params = new bytes(data.length - 4); + for (uint256 j = 0; j < data.length - 4; j++) { + params[j] = data[j + 4]; + } + + address from; + address to; + uint256 value; + // 'transfer' selector in ERC20 token + if (selector == 0xa9059cbb) { + (to, value) = abi.decode(params, (address, uint256)); + from = accountAccess.accessor; + } + // 'transferFrom' selector in ERC20 token + else if (selector == 0x23b872dd) { + (from, to, value) = abi.decode(params, (address, address, uint256)); + } else { + return; + } + + // add address to proposal affected addresses array only if not already added + if (!_isProposalAffectedAddress[from]) { + _isProposalAffectedAddress[from] = true; + _proposalAffectedAddresses.push(from); + } + + _proposalTransfers[from].push( + TransferInfo({ + to: to, + value: value, + tokenAddress: accountAccess.account + }) + ); + } + + /// @notice helper method to get state changes of proposal affected addresses + function _processStateChanges( + VmSafe.StorageAccess[] memory storageAccess + ) internal { + for (uint256 i; i < storageAccess.length; i++) { + address account = storageAccess[i].account; + + // get only state changes for write storage access + if (storageAccess[i].isWrite) { + _stateInfos[account].push( + StateInfo({ + slot: storageAccess[i].slot, + oldValue: storageAccess[i].previousValue, + newValue: storageAccess[i].newValue + }) + ); + } + + // add address to proposal affected addresses array only if not already added + if ( + !_isProposalAffectedAddress[account] && + _stateInfos[account].length != 0 + ) { + _isProposalAffectedAddress[account] = true; + _proposalAffectedAddresses.push(account); + } + } + } + + /// @notice helper method to get labels for addresses + function _getAddressLabel( + address contractAddress + ) internal view returns (string memory) { + string memory label = vm.getLabel(contractAddress); + + bytes memory prefix = bytes("unlabeled:"); + bytes memory strBytes = bytes(label); + + if (strBytes.length >= prefix.length) { + // check if address is unlabeled + for (uint256 i = 0; i < prefix.length; i++) { + if (strBytes[i] != prefix[i]) { + // return "{LABEL} @{ADDRESS}" if address is labeled + return + string( + abi.encodePacked( + label, + " @", + vm.toString(contractAddress) + ) + ); + } + } + } else { + // return "{LABEL} @{ADDRESS}" if address is labeled + return + string( + abi.encodePacked(label, " @", vm.toString(contractAddress)) + ); + } + + // return "UNLABELED @{ADDRESS}" if address is unlabeled + return + string( + abi.encodePacked("UNLABELED @", vm.toString(contractAddress)) + ); + } } diff --git a/src/proposals/TimelockProposal.sol b/src/proposals/TimelockProposal.sol index ae0e89d..ce2198e 100644 --- a/src/proposals/TimelockProposal.sol +++ b/src/proposals/TimelockProposal.sol @@ -180,18 +180,7 @@ abstract contract TimelockProposal is Proposal { } /// @notice print schedule and execute calldata - function print() public view override { - console.log("\n---------------- Proposal Description ----------------"); - console.log(description()); - - console.log("\n------------------ Proposal Actions ------------------"); - for (uint256 i; i < actions.length; i++) { - console.log("%d). %s", i + 1, actions[i].description); - console.log("target: %s\npayload", actions[i].target); - console.logBytes(actions[i].arguments); - console.log("\n"); - } - + function _printProposalCalldata() internal view override { console.log( "\n\n------------------ Schedule Calldata ------------------" );