From 7ff88f272b9474fd177d797ac8c5ab3c9d0292a4 Mon Sep 17 00:00:00 2001 From: Patrick Gallagher Date: Wed, 24 Jul 2024 18:54:44 -0700 Subject: [PATCH] Add new combined Pendle PT proposal --- .gitignore | 2 + .../AddCollateral-PT-rETH-PT-wstETH.json | 67 ++++++++++ ...n => AddCollateral-PT-rETH.temporary.json} | 2 +- ...=> AddCollateral-PT-wstETH.temporary.json} | 2 +- .../add-collateral-7_24_2024-109195524.json | 73 ----------- .../add-collateral-7_24_2024-78039867.json | 73 ----------- ...targetsAndCalldata-7_25_2024-96943375.json | 117 ++++++++++++++++++ tasks/parseMarkdown.js | 8 ++ tasks/parseProposalPath.js | 46 +++---- 9 files changed, 212 insertions(+), 178 deletions(-) create mode 100644 gov-input/mainnet/AddCollateral-PT-rETH-PT-wstETH.json rename gov-input/mainnet/{AddCollateral-PT-rETH.json => AddCollateral-PT-rETH.temporary.json} (99%) rename gov-input/mainnet/{AddCollateral-PT-wstETH.json => AddCollateral-PT-wstETH.temporary.json} (96%) delete mode 100644 gov-output/mainnet/add-collateral-7_24_2024-109195524.json delete mode 100644 gov-output/mainnet/add-collateral-7_24_2024-78039867.json create mode 100644 gov-output/mainnet/targetsAndCalldata-7_25_2024-96943375.json create mode 100644 tasks/parseMarkdown.js diff --git a/.gitignore b/.gitignore index eded953..6bad54c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ docs/ # Dotenv file .env + +notes.md \ No newline at end of file diff --git a/gov-input/mainnet/AddCollateral-PT-rETH-PT-wstETH.json b/gov-input/mainnet/AddCollateral-PT-rETH-PT-wstETH.json new file mode 100644 index 0000000..1b8dfbb --- /dev/null +++ b/gov-input/mainnet/AddCollateral-PT-rETH-PT-wstETH.json @@ -0,0 +1,67 @@ +{ + "chainid": 42161, + "description": "New vault types PT-rETH-26JUN2025 PT-wstETH-26JUN2025", + "details": "# Overview\n\nThe DAO has decided to add PT-wstETH and PT-rETH the next new collateral. There has been discussion both in the discord and in the forum on this topic.\n\n# Discussion\n\nSee forum discussion https://commonwealth.im/open-dollar-governance/discussion/24074-collateral-expansion-to-add-pendle-ptreth-ptwsteth\n\n# Oracles\n\nWe have already deployed an oracle for Pendle PT collateral. The code for these new oracles can be found in [od-relayer-defi-integrations](https://github.com/open-dollar/od-relayer-defi-integrations/blob/v1.0.0/src/contracts/oracles/pendle/PendlePtToSyRelayer.sol). These oracles have not yet been audited. \n\n```\nMAINNET_DELAYED_PT_RETH_26JUN2025_USD_ORACLE = 0xC398dD38831a8f0f6C436137d07E0580d974269e;\nMAINNET_DELAYED_PT_WSTETH_26JUN2025_USD_ORACLE = 0x0a77069A8d1E7fd7B49222BF2B1d1d4687C1177B;\n```\n\n# Details\n\nAdding a new collateral to the system requires deploying multiple contracts and calling functions on existing ones to initialize the new collateral.\n\nEach collateral has it's own set of parameters that define how it interacts with the rest of the Open Dollar system.\n\nAn explanation of parameters can be found in the following document.\n\n[Open Dollar Protocol Parameters](https://build.opendollar.com/Open-Dollar-Protocol-Parameters-bdd5be16b5774ce1b8f8a167be1ad3e9?pvs=4)\n\n\n---\n\nTo create your own proposal use the CLI tool [`od-governance-manager`](https://github.com/open-dollar/od-governance-manager) and submit a PR.\n\n", + "network": "mainnet", + "proposalType": "TargetsAndCalldata", + "ODGovernor_Address": "", + "objectArray": [ + { + "target": "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", + "calldata": "0x26e1666550542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000685155d3bd593508fe32be39729810a591ed9c87" + }, + { + "target": "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000" + }, + { + "target": "0xEff45E8e2353893BD0558bD5892A42786E9142F1", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0" + }, + { + "target": "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002cc2d6b1027e4d56d6c73dfb8624142f6ac478d5000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000" + }, + { + "target": "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", + "calldata": "0x34463c6050542d724554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c398dd38831a8f0f6c436137d07e0580d974269e0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x12f3352650542d724554482d32364a554e323032350000000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" + }, + { + "target": "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", + "calldata": "0x26e1666550542d7773744554482d32364a554e32303235000000000000000000000000000000000000000000000000001255638efeca62e12e344e0b6b22ea853ec6e2c7" + }, + { + "target": "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000" + }, + { + "target": "0xEff45E8e2353893BD0558bD5892A42786E9142F1", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0" + }, + { + "target": "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", + "calldata": "0x34463c6050542d7773744554482d32364a554e323032350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000d5bf49be72d6c2dbab744086cd879c18b8071e65000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000" + }, + { + "target": "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000a77069a8d1e7fd7b49222bf2b1d1d4687c1177b0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x12f3352650542d7773744554482d32364a554e32303235000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" + } + ], + "arrayLength": "14" +} \ No newline at end of file diff --git a/gov-input/mainnet/AddCollateral-PT-rETH.json b/gov-input/mainnet/AddCollateral-PT-rETH.temporary.json similarity index 99% rename from gov-input/mainnet/AddCollateral-PT-rETH.json rename to gov-input/mainnet/AddCollateral-PT-rETH.temporary.json index 60c67f5..9d494f6 100644 --- a/gov-input/mainnet/AddCollateral-PT-rETH.json +++ b/gov-input/mainnet/AddCollateral-PT-rETH.temporary.json @@ -41,4 +41,4 @@ "canTakeBackTax": true, "taxPercentage": "500000000000000000" } -} \ No newline at end of file +} diff --git a/gov-input/mainnet/AddCollateral-PT-wstETH.json b/gov-input/mainnet/AddCollateral-PT-wstETH.temporary.json similarity index 96% rename from gov-input/mainnet/AddCollateral-PT-wstETH.json rename to gov-input/mainnet/AddCollateral-PT-wstETH.temporary.json index be6ce0f..dee6934 100644 --- a/gov-input/mainnet/AddCollateral-PT-wstETH.json +++ b/gov-input/mainnet/AddCollateral-PT-wstETH.temporary.json @@ -27,7 +27,7 @@ "stabilityFee": "1000000000937184599093070064" }, "LiquidationEngineCollateralParams": { - "newCAHChild": "0x2cC2D6b1027E4d56D6C73dFb8624142F6ac478D5", + "newCAHChild": "0xd5Bf49BE72D6c2dbaB744086cD879C18b8071E65", "liquidationPenalty": "15000000000000000000", "liquidationQuantity": "50000000000000000000000000000000000000000000000000" }, diff --git a/gov-output/mainnet/add-collateral-7_24_2024-109195524.json b/gov-output/mainnet/add-collateral-7_24_2024-109195524.json deleted file mode 100644 index 9cc7f17..0000000 --- a/gov-output/mainnet/add-collateral-7_24_2024-109195524.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "CollateralAuctionHouseParams": { - "minimumBid": "100000000000000000000", - "minDiscount": "1000000000000000000", - "maxDiscount": "850000000000000000", - "perSecondDiscountUpdateRate": "999985752120000000000000000" - }, - "Delegatee": "0x0000000000000000000000000000000000000000", - "GlobalSettlement_Address": "0x1c6B7ab018be82ed6b5c63aE82D9f07bb7B231A2", - "LiquidationEngineCollateralParams": { - "newCAHChild": "0x2cC2D6b1027E4d56D6C73dFb8624142F6ac478D5", - "liquidationPenalty": "15000000000000000000", - "liquidationQuantity": "50000000000000000000000000000000000000000000000000" - }, - "LiquidationEngine_Address": "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", - "ODGovernor_Address": "0xf704735CE81165261156b41D33AB18a08803B86F", - "OracleRelayerCollateralParams": { - "delayedOracle": "0xC398dD38831a8f0f6C436137d07E0580d974269e", - "safetyCRatio": "1350000000000000000000000000", - "liquidationCRatio": "1300000000000000000000000000" - }, - "OracleRelayer_Address": "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", - "ProtocolToken_Address": "0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c", - "SAFEEngineCollateralParams": { - "collateralDebtCeiling": "500000000000000000000000000000000000000000000000000", - "collateralDebtFloor": "200000000000000000000000000000000000000000000000" - }, - "SAFEEngine_Address": "0xEff45E8e2353893BD0558bD5892A42786E9142F1", - "TaxCollectorCollateralParams": { - "stabilityFee": "1000000000937184599093070064" - }, - "TaxCollector_Address": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", - "TaxReceiver": { - "receiver": "0x9C86C719Aa29D426C50Ee3BAEd40008D292b02CF", - "canTakeBackTax": true, - "taxPercentage": "500000000000000000" - }, - "calldatas": [ - "0x26e1666550542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000685155d3bd593508fe32be39729810a591ed9c87", - "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000", - "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000", - "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0", - "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002cc2d6b1027e4d56d6c73dfb8624142f6ac478d5000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000", - "0x34463c6050542d724554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c398dd38831a8f0f6c436137d07e0580d974269e0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000", - "0x12f3352650542d724554482d32364a554e323032350000000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" - ], - "chainid": "42161", - "description": "New vault type - Pendle PT-rETH 26JUN2025", - "descriptionHash": "0x83f4ac4abecf8b40d66e2815230cfe71d262e627b8d653fbd3304e106f51fa0c", - "network": "mainnet", - "newCollateralAddress": "0x685155D3BD593508Fe32Be39729810A591ED9c87", - "newCollateralType": "PT-rETH-26JUN2025", - "proposalId": "109195524880092111920195778036346226440863524601062620933264264592966563513007", - "proposalType": "AddCollateral", - "targets": [ - "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", - "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", - "0xEff45E8e2353893BD0558bD5892A42786E9142F1", - "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", - "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", - "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", - "0xc93F938A95488a03b976A15B20fAcFD52D087fB2" - ], - "values": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/gov-output/mainnet/add-collateral-7_24_2024-78039867.json b/gov-output/mainnet/add-collateral-7_24_2024-78039867.json deleted file mode 100644 index 44b934b..0000000 --- a/gov-output/mainnet/add-collateral-7_24_2024-78039867.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "CollateralAuctionHouseParams": { - "minimumBid": "100000000000000000000", - "minDiscount": "1000000000000000000", - "maxDiscount": "850000000000000000", - "perSecondDiscountUpdateRate": "999985752120000000000000000" - }, - "Delegatee": "0x0000000000000000000000000000000000000000", - "GlobalSettlement_Address": "0x1c6B7ab018be82ed6b5c63aE82D9f07bb7B231A2", - "LiquidationEngineCollateralParams": { - "newCAHChild": "0x2cC2D6b1027E4d56D6C73dFb8624142F6ac478D5", - "liquidationPenalty": "15000000000000000000", - "liquidationQuantity": "50000000000000000000000000000000000000000000000000" - }, - "LiquidationEngine_Address": "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", - "ODGovernor_Address": "0xf704735CE81165261156b41D33AB18a08803B86F", - "OracleRelayerCollateralParams": { - "delayedOracle": "0x0a77069A8d1E7fd7B49222BF2B1d1d4687C1177B", - "safetyCRatio": "1350000000000000000000000000", - "liquidationCRatio": "1300000000000000000000000000" - }, - "OracleRelayer_Address": "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", - "ProtocolToken_Address": "0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c", - "SAFEEngineCollateralParams": { - "collateralDebtCeiling": "500000000000000000000000000000000000000000000000000", - "collateralDebtFloor": "200000000000000000000000000000000000000000000000" - }, - "SAFEEngine_Address": "0xEff45E8e2353893BD0558bD5892A42786E9142F1", - "TaxCollectorCollateralParams": { - "stabilityFee": "1000000000937184599093070064" - }, - "TaxCollector_Address": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", - "TaxReceiver": { - "receiver": "0x9C86C719Aa29D426C50Ee3BAEd40008D292b02CF", - "canTakeBackTax": true, - "taxPercentage": "500000000000000000" - }, - "calldatas": [ - "0x26e1666550542d7773744554482d32364a554e32303235000000000000000000000000000000000000000000000000001255638efeca62e12e344e0b6b22ea853ec6e2c7", - "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000", - "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000", - "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0", - "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002cc2d6b1027e4d56d6c73dfb8624142f6ac478d5000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000", - "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000a77069a8d1e7fd7b49222bf2b1d1d4687c1177b0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000", - "0x12f3352650542d7773744554482d32364a554e32303235000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" - ], - "chainid": "42161", - "description": "New vault type - Pendle PT-wstETH 26JUN2025", - "descriptionHash": "0xd4afb6288fd14a928d9598fbf86cc1a1e621bbb7a8a0ab6ee1aaf32871e3d9cb", - "network": "mainnet", - "newCollateralAddress": "0x1255638EFeca62e12E344E0b6B22ea853eC6e2c7", - "newCollateralType": "PT-wstETH-26JUN2025", - "proposalId": "78039867946578978981843767441498673319086461428286443954798158655032287176274", - "proposalType": "AddCollateral", - "targets": [ - "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", - "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", - "0xEff45E8e2353893BD0558bD5892A42786E9142F1", - "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", - "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", - "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", - "0xc93F938A95488a03b976A15B20fAcFD52D087fB2" - ], - "values": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] -} \ No newline at end of file diff --git a/gov-output/mainnet/targetsAndCalldata-7_25_2024-96943375.json b/gov-output/mainnet/targetsAndCalldata-7_25_2024-96943375.json new file mode 100644 index 0000000..d3b1bb2 --- /dev/null +++ b/gov-output/mainnet/targetsAndCalldata-7_25_2024-96943375.json @@ -0,0 +1,117 @@ +{ + "ODGovernor_Address": "0xf704735CE81165261156b41D33AB18a08803B86F", + "arrayLength": "14", + "calldatas": [ + "0x26e1666550542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000685155d3bd593508fe32be39729810a591ed9c87", + "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000", + "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000", + "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0", + "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002cc2d6b1027e4d56d6c73dfb8624142f6ac478d5000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000", + "0x34463c6050542d724554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c398dd38831a8f0f6c436137d07e0580d974269e0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000", + "0x12f3352650542d724554482d32364a554e323032350000000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000", + "0x26e1666550542d7773744554482d32364a554e32303235000000000000000000000000000000000000000000000000001255638efeca62e12e344e0b6b22ea853ec6e2c7", + "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000", + "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000", + "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0", + "0x34463c6050542d7773744554482d32364a554e323032350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000d5bf49be72d6c2dbab744086cd879c18b8071e65000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000", + "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000a77069a8d1e7fd7b49222bf2b1d1d4687c1177b0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000", + "0x12f3352650542d7773744554482d32364a554e32303235000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" + ], + "chainid": 42161, + "description": "New vault types PT-rETH-26JUN2025 PT-wstETH-26JUN2025", + "descriptionHash": "0x3d57fdd0c754a10885ba1688a4733245518b8dbc996847f4798dfe2dc845f430", + "details": "# Overview\n\nThe DAO has decided to add PT-wstETH and PT-rETH the next new collateral. There has been discussion both in the discord and in the forum on this topic.\n\n# Discussion\n\nSee forum discussion https://commonwealth.im/open-dollar-governance/discussion/24074-collateral-expansion-to-add-pendle-ptreth-ptwsteth\n\n# Oracles\n\nWe have already deployed an oracle for Pendle PT collateral. The code for these new oracles can be found in [od-relayer-defi-integrations](https://github.com/open-dollar/od-relayer-defi-integrations/blob/v1.0.0/src/contracts/oracles/pendle/PendlePtToSyRelayer.sol). These oracles have not yet been audited. \n\n```\nMAINNET_DELAYED_PT_RETH_26JUN2025_USD_ORACLE = 0xC398dD38831a8f0f6C436137d07E0580d974269e;\nMAINNET_DELAYED_PT_WSTETH_26JUN2025_USD_ORACLE = 0x0a77069A8d1E7fd7B49222BF2B1d1d4687C1177B;\n```\n\n# Details\n\nAdding a new collateral to the system requires deploying multiple contracts and calling functions on existing ones to initialize the new collateral.\n\nEach collateral has it's own set of parameters that define how it interacts with the rest of the Open Dollar system.\n\nAn explanation of parameters can be found in the following document.\n\n[Open Dollar Protocol Parameters](https://build.opendollar.com/Open-Dollar-Protocol-Parameters-bdd5be16b5774ce1b8f8a167be1ad3e9?pvs=4)\n\n\n---\n\nTo create your own proposal use the CLI tool [`od-governance-manager`](https://github.com/open-dollar/od-governance-manager) and submit a PR.\n\n", + "network": "mainnet", + "objectArray": [ + { + "target": "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", + "calldata": "0x26e1666550542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000685155d3bd593508fe32be39729810a591ed9c87" + }, + { + "target": "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000" + }, + { + "target": "0xEff45E8e2353893BD0558bD5892A42786E9142F1", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0" + }, + { + "target": "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", + "calldata": "0x34463c6050542d724554482d32364a554e32303235000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002cc2d6b1027e4d56d6c73dfb8624142f6ac478d5000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000" + }, + { + "target": "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", + "calldata": "0x34463c6050542d724554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c398dd38831a8f0f6c436137d07e0580d974269e0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x12f3352650542d724554482d32364a554e323032350000000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" + }, + { + "target": "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", + "calldata": "0x26e1666550542d7773744554482d32364a554e32303235000000000000000000000000000000000000000000000000001255638efeca62e12e344e0b6b22ea853ec6e2c7" + }, + { + "target": "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000bcbce7f1b1500000000000000000000000000000000000000000000033b2b383ec254bdcf6c0000" + }, + { + "target": "0xEff45E8e2353893BD0558bD5892A42786E9142F1", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000001561d276ddfdc00a71dd41a08f48af400000000000000000000000000000000000023084f676940b7915149bd08b30d000000000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000033b2e3cacd20caa55e8c8f0" + }, + { + "target": "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", + "calldata": "0x34463c6050542d7773744554482d32364a554e323032350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000d5bf49be72d6c2dbab744086cd879c18b8071e65000000000000000000000000000000000000000000000000d02ab486cedc0000000000000000000000000022361d8afcc93343e962029a7edab2000000000000" + }, + { + "target": "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", + "calldata": "0x34463c6050542d7773744554482d32364a554e3230323500000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000a77069a8d1e7fd7b49222bf2b1d1d4687c1177b0000000000000000000000000000000000000000045cb19ea48cad1f060000000000000000000000000000000000000000000000043355b53628a6b594000000" + }, + { + "target": "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "calldata": "0x12f3352650542d7773744554482d32364a554e32303235000000000000000000000000007365636f6e646172795461785265636569766572000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000009c86c719aa29d426c50ee3baed40008d292b02cf000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000" + } + ], + "proposalId": "96943375770323715995893405045715392110098266111863860767821633502916835180447", + "proposalType": "TargetsAndCalldata", + "targets": [ + "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", + "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", + "0xEff45E8e2353893BD0558bD5892A42786E9142F1", + "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", + "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", + "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "0xa83c0f1e9eD8E383919Dde0fC90744ae370EB7B3", + "0x5dc1E86361faC018f24Ae0D1E5eB01D70AB32A82", + "0xEff45E8e2353893BD0558bD5892A42786E9142F1", + "0xc93F938A95488a03b976A15B20fAcFD52D087fB2", + "0x17e546dDCE2EA8A74Bd667269457A2e80b309965", + "0x7404fc1F3796748FAE17011b57Fad9713185c1d6", + "0xc93F938A95488a03b976A15B20fAcFD52D087fB2" + ], + "values": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/tasks/parseMarkdown.js b/tasks/parseMarkdown.js new file mode 100644 index 0000000..62996b1 --- /dev/null +++ b/tasks/parseMarkdown.js @@ -0,0 +1,8 @@ +const fs = require("fs"); +const path = require("path"); + +const basePath = path.join(__dirname, "../notes.md"); +const contents = fs.readFileSync(basePath, 'utf8') +const obj = { details: contents }; + +console.log(JSON.stringify(obj)) \ No newline at end of file diff --git a/tasks/parseProposalPath.js b/tasks/parseProposalPath.js index fced08f..dea193b 100644 --- a/tasks/parseProposalPath.js +++ b/tasks/parseProposalPath.js @@ -22,11 +22,15 @@ if (currentJson.objectArray != undefined) { }); } +const PROPOSAL_TYPES_NEEDING_PREDICTION = [ + "DeployChainlinkRelayers", + "DeployDelayedOracle", + "DeployDenominatedOracle", + "AddCollateral" +] + if ( - currentJson.proposalType == "DeployChainlinkRelayers" || - currentJson.proposalType == "DeployDelayedOracle" || - currentJson.proposalType == "DeployDenominatedOracle" || - currentJson.proposalType == "AddCollateral" + PROPOSAL_TYPES_NEEDING_PREDICTION.includes(currentJson.proposalType) ) { const [signer, provider] = getNetwork(network); if (signer && provider) { @@ -57,10 +61,11 @@ function getNetwork(network) { } async function predictAddress(currentJson, provider) { + const { proposalType, arrayLength } = currentJson let factoryAddress; - let nonce; - let numberOfAddressesToPredict; - if (currentJson.proposalType == "AddCollateral") { + let numberOfAddressesToPredict = arrayLength; + + if (proposalType == "AddCollateral") { const contractJSON = JSON.parse( fs.readFileSync( path.join( @@ -69,50 +74,31 @@ async function predictAddress(currentJson, provider) { ) ) ); - const globalSettlement = new ethers.Contract( currentJson.GlobalSettlement_Address, contractJSON.abi, provider ); - factoryAddress = await globalSettlement.collateralAuctionHouseFactory(); - - nonce = await provider.getTransactionCount(factoryAddress); - numberOfAddressesToPredict = 1; - } else if (currentJson.proposalType == "DeployChainlinkRelayers") { + } else if (proposalType == "DeployChainlinkRelayers") { factoryAddress = currentJson.ChainlinkRelayerFactory_Address; - - nonce = await provider.getTransactionCount(factoryAddress); - - numberOfAddressesToPredict = currentJson.arrayLength; - } else if (currentJson.proposalType == "DeployDelayedOracle") { + } else if (proposalType == "DeployDelayedOracle") { factoryAddress = currentJson.DelayedOracleFactory_Address; - - nonce = await provider.getTransactionCount(factoryAddress); - - numberOfAddressesToPredict = currentJson.arrayLength; - } else if (currentJson.proposalType == "DeployDenominatedOracle") { + } else if (proposalType == "DeployDenominatedOracle") { factoryAddress = currentJson.DenominatedOracleFactory_Address; - - nonce = await provider.getTransactionCount(factoryAddress); - - numberOfAddressesToPredict = currentJson.arrayLength; } else { throw new Error("Parse Prop path: unrecognized proposal type."); } + const nonce = await provider.getTransactionCount(factoryAddress); let predictedAddresses = []; - for (let i = 0; i < numberOfAddressesToPredict; i++) { const predictedAddress = ethers.getCreateAddress({ from: factoryAddress, nonce: nonce + i, }); - predictedAddresses.push(predictedAddress); } - return predictedAddresses; }