Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save notesbytom/32aa45f377e47ce366e2f6e051a0721b to your computer and use it in GitHub Desktop.
Save notesbytom/32aa45f377e47ce366e2f6e051a0721b to your computer and use it in GitHub Desktop.
Compound CAP Governor Bravo Constructor Parameter example
// Get ABI-Encoded Constructor Parameters for Compound CAP Proposal Governor Bravo
// Remove 0x from beginning of output to paste into Etherscan contract code verifier
// Tricky things with validating a CAP, the contract is
// created by another contract method with mismatching parameters
// the event-log parameters are also mismatching
// We can find the event log for transaction when the CAP was created
// ... but the parameters for the constructor are slightly different
// You can run this in the web console at http://remix.ethereum.org/
web3.eth.abi.encodeParameters(
[
{"type": "address","name": "author_"},
{
"internalType": "address[]",
"name": "targets",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "values",
"type": "uint256[]"
},
{
"internalType": "string[]",
"name": "signatures",
"type": "string[]"
},
{
"internalType": "bytes[]",
"name": "calldatas",
"type": "bytes[]"
},
{
"internalType": "string",
"name": "description",
"type": "string"
},
{"type": "address","name": "comp_"},
{"type":"address","name": "governor_"}
],
[
'0x50d5587403f096dc1ad81164670046182a635221',
[ "0x39AA39c021dfbaE8faC545936693aC917d5E7563", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B", "0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B", "0x6d903f6003cca6255D85CcA4D3B5E5146dC33925", "0xc0Da02939E1441F497fd74F78cE7Decb17B66529" ],
[ "0", "0", "0", "0", "0", "0" ],
[ "_reduceReserves(uint256)", "transfer(address,uint256)", "_grantComp(address,uint256)", "_grantComp(address,uint256)", "setPendingAdmin(address)", "_initiate(address)" ],
[ "0x0000000000000000000000000000000000000000000000000000000649534e00", "0x000000000000000000000000b8a4a21fa50c469c610509efe803ddab17f9e8960000000000000000000000000000000000000000000000000000000649534e00", "0x0000000000000000000000002b384212edc04ae8bb41738d05ba20e33277bf33000000000000000000000000000000000000000000000008ac7230489e800000", "0x00000000000000000000000027c79a01878962ce0b6126af6e184c06d36c8f37000000000000000000000000000000000000000000000004563918244f400000", "0x000000000000000000000000c0da02939e1441f497fd74f78ce7decb17b66529", "0x000000000000000000000000c0da01a04c3f3e0be433606045bb7017a7323e38" ],
"# Migration to Governor Bravo\n### Introduction\nGovernor Bravo has been a community effort for the past few months to bring governance to the next stage. This proposal transfers Compound governance to the new Governor Bravo contract. If this proposal is successful, all future Compound governance calls should be sent to [Governor Bravo](https://etherscan.io/address/0xc0da02939e1441f497fd74f78ce7decb17b66529).\n\n### Proposal Calls\nThe first two calls reimburse Compound Labs $27k that was paid to Open Zeppelin for the audit from the cUSDC reserves. The following two calls award COMP bounties to Arr00 and Blurr for organizing and executing the Governor Bravo project. The following call sets Governor Bravo as the pending admin, and the last call initiates Governor Bravo, accepting the Timelock admin.\n\n### Governor Bravo Details:\nGovernor Bravo has been developed by members of the community in the open for the past few months. The new contracts have been fully audited by Open Zeppelin, are fully covered by extensive test suites, have been simulated by forking simulations, and have been running on the kovan testnet. \n\nThe new features are as follows:\n- Upgradable implementation \n- Settable parameters (proposal threshold, voting period, voting delay)\n- Abstain vote option\n- Optional string voting reason\n- Proposer can always cancel their proposal (until execution)\n- Removal of the guardian\n- Continuous proposal id logic\n\n#### PS:\nTo celebrate the alphas who voted on Governor Alpha, we will be releasing a limited edition Compound NFT claimable by anyone who voted meaningfully on Governor Alpha prior to this proposal once Governor Bravo is initiated.\n\n#### References:\nDevelopment forum [post](https://www.comp.xyz/t/governor-bravo-development/942)\nProposal forum [post](https://www.comp.xyz/t/governor-bravo-proposal/1384)\n[Github PR](https://github.com/compound-finance/compound-protocol/pull/91)\n[Open Zeppelin Audit](https://blog.openzeppelin.com/compound-governor-bravo-audit/)",
'0xc00e94cb662c3520282e6f5717214004a7f26888',
'0xc0da01a04c3f3e0be433606045bb7017a7323e38'
]
)
// to get some of the input I decoded some parameters from the Event Log message from etherscan
web3.eth.abi.decodeParameters([
{
"indexed": false,
"internalType": "address[]",
"name": "targets",
"type": "address[]"
},
{
"indexed": false,
"internalType": "uint256[]",
"name": "values",
"type": "uint256[]"
},
{
"indexed": false,
"internalType": "string[]",
"name": "signatures",
"type": "string[]"
},
{
"indexed": false,
"internalType": "bytes[]",
"name": "calldatas",
"type": "bytes[]"
},
{
"indexed": false,
"internalType": "string",
"name": "description",
"type": "string"
}
],
'0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000000000780000000000000000000000000000000000000000000000000000000000000000600000000000000000000000039aa39c021dfbae8fac545936693ac917d5e7563000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000003d9819210a31b4961b30ef54be2aed79b9c9cd3b0000000000000000000000003d9819210a31b4961b30ef54be2aed79b9c9cd3b0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925000000000000000000000000c0da02939e1441f497fd74f78ce7decb17b665290000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000185f72656475636552657365727665732875696e7432353629000000000000000000000000000000000000000000000000000000000000000000000000000000197472616e7366657228616464726573732c75696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000001b5f6772616e74436f6d7028616464726573732c75696e74323536290000000000000000000000000000000000000000000000000000000000000000000000001b5f6772616e74436f6d7028616464726573732c75696e74323536290000000000000000000000000000000000000000000000000000000000000000000000001873657450656e64696e6741646d696e286164647265737329000000000000000000000000000000000000000000000000000000000000000000000000000000125f696e6974696174652861646472657373290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000649534e000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000b8a4a21fa50c469c610509efe803ddab17f9e8960000000000000000000000000000000000000000000000000000000649534e0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000002b384212edc04ae8bb41738d05ba20e33277bf33000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000027c79a01878962ce0b6126af6e184c06d36c8f37000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c0da02939e1441f497fd74f78ce7decb17b665290000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c0da01a04c3f3e0be433606045bb7017a7323e3800000000000000000000000000000000000000000000000000000000000007ce23204d6967726174696f6e20746f20476f7665726e6f7220427261766f0a23232320496e74726f64756374696f6e0a476f7665726e6f7220427261766f20686173206265656e206120636f6d6d756e697479206566666f727420666f7220746865207061737420666577206d6f6e74687320746f206272696e6720676f7665726e616e636520746f20746865206e6578742073746167652e20546869732070726f706f73616c207472616e736665727320436f6d706f756e6420676f7665726e616e636520746f20746865206e657720476f7665726e6f7220427261766f20636f6e74726163742e20496620746869732070726f706f73616c206973207375636365737366756c2c20616c6c2066757475726520436f6d706f756e6420676f7665726e616e63652063616c6c732073686f756c642062652073656e7420746f205b476f7665726e6f7220427261766f5d2868747470733a2f2f65746865727363616e2e696f2f616464726573732f307863306461303239333965313434316634393766643734663738636537646563623137623636353239292e0a0a2323232050726f706f73616c2043616c6c730a5468652066697273742074776f2063616c6c73207265696d627572736520436f6d706f756e64204c616273202432376b207468617420776173207061696420746f204f70656e205a657070656c696e20666f72207468652061756469742066726f6d207468652063555344432072657365727665732e2054686520666f6c6c6f77696e672074776f2063616c6c7320617761726420434f4d5020626f756e7469657320746f20417272303020616e6420426c75727220666f72206f7267616e697a696e6720616e6420657865637574696e672074686520476f7665726e6f7220427261766f2070726f6a6563742e2054686520666f6c6c6f77696e672063616c6c207365747320476f7665726e6f7220427261766f206173207468652070656e64696e672061646d696e2c20616e6420746865206c6173742063616c6c20696e6974696174657320476f7665726e6f7220427261766f2c20616363657074696e67207468652054696d656c6f636b2061646d696e2e0a0a23232320476f7665726e6f7220427261766f2044657461696c733a0a476f7665726e6f7220427261766f20686173206265656e20646576656c6f706564206279206d656d62657273206f662074686520636f6d6d756e69747920696e20746865206f70656e20666f7220746865207061737420666577206d6f6e7468732e20546865206e657720636f6e7472616374732068617665206265656e2066756c6c792061756469746564206279204f70656e205a657070656c696e2c206172652066756c6c7920636f766572656420627920657874656e736976652074657374207375697465732c2068617665206265656e2073696d756c6174656420627920666f726b696e672073696d756c6174696f6e732c20616e642068617665206265656e2072756e6e696e67206f6e20746865206b6f76616e20746573746e65742e200a0a546865206e65772066656174757265732061726520617320666f6c6c6f77733a0a2d2055706772616461626c6520696d706c656d656e746174696f6e200a2d205365747461626c6520706172616d6574657273202870726f706f73616c207468726573686f6c642c20766f74696e6720706572696f642c20766f74696e672064656c6179290a2d204162737461696e20766f7465206f7074696f6e0a2d204f7074696f6e616c20737472696e6720766f74696e6720726561736f6e0a2d2050726f706f7365722063616e20616c776179732063616e63656c2074686569722070726f706f73616c2028756e74696c20657865637574696f6e290a2d2052656d6f76616c206f662074686520677561726469616e0a2d20436f6e74696e756f75732070726f706f73616c206964206c6f6769630a0a232323232050533a0a546f2063656c6562726174652074686520616c706861732077686f20766f746564206f6e20476f7665726e6f7220416c7068612c2077652077696c6c2062652072656c656173696e672061206c696d697465642065646974696f6e20436f6d706f756e64204e465420636c61696d61626c6520627920616e796f6e652077686f20766f746564206d65616e696e6766756c6c79206f6e20476f7665726e6f7220416c706861207072696f7220746f20746869732070726f706f73616c206f6e636520476f7665726e6f7220427261766f20697320696e697469617465642e0a0a23232323205265666572656e6365733a0a446576656c6f706d656e7420666f72756d205b706f73745d2868747470733a2f2f7777772e636f6d702e78797a2f742f676f7665726e6f722d627261766f2d646576656c6f706d656e742f393432290a50726f706f73616c20666f72756d205b706f73745d2868747470733a2f2f7777772e636f6d702e78797a2f742f676f7665726e6f722d627261766f2d70726f706f73616c2f31333834290a5b4769746875622050525d2868747470733a2f2f6769746875622e636f6d2f636f6d706f756e642d66696e616e63652f636f6d706f756e642d70726f746f636f6c2f70756c6c2f3931290a5b4f70656e205a657070656c696e2041756469745d2868747470733a2f2f626c6f672e6f70656e7a657070656c696e2e636f6d2f636f6d706f756e642d676f7665726e6f722d627261766f2d61756469742f29000000000000000000000000000000000000'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment