Skip to content

Commit

Permalink
pretty print transfers and state diff (#83)
Browse files Browse the repository at this point in the history
* print ERC20 token transfers and ETH transfers in proposals

* print state changes

* use msg value for eth transfers

* fix lint

* print address labels in proposal actions

* pr feedback

* add inline comments

* update docs
  • Loading branch information
prateek105 authored Aug 13, 2024
1 parent a7044bf commit 553e3b8
Show file tree
Hide file tree
Showing 12 changed files with 553 additions and 89 deletions.
6 changes: 0 additions & 6 deletions addresses/Addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
27 changes: 24 additions & 3 deletions docs/guides/customizing-proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
64 changes: 51 additions & 13 deletions docs/guides/governor-bravo-proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 553e3b8

Please sign in to comment.