Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create eXOF governance script #115

Merged
merged 66 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
b0f4929
feat: MU04 Governance Script
philbow61 Aug 9, 2023
e3e2b86
test: started with MU04 deployment checks
philbow61 Aug 14, 2023
5ce3b55
test: more MU04 deployment checks
philbow61 Aug 16, 2023
1071d75
chore: deploy XOF to mainnet
philbow61 Aug 17, 2023
ac52f84
feat: turn MU04 into eXOF
bowd Aug 23, 2023
6a28e30
chore: deploy non upgradeables to baklava
bayological Aug 23, 2023
19cfb10
chore: add new eur rate feed identifiers
bayological Aug 23, 2023
259ced1
chore: update rate feed references
bayological Aug 23, 2023
f7f0681
chore: reafactor for better readability
bayological Aug 24, 2023
5fc616e
chore: rename rate feed ref
bayological Aug 24, 2023
94e5b2c
chore: add xof to celo registry
bayological Aug 24, 2023
3712057
feat: update daily spend for collateral assets
bayological Aug 24, 2023
42fad5b
refactor: update get x change id function
bayological Aug 25, 2023
b7f79d3
merge from main
bayological Aug 25, 2023
4438350
refactor: check transactions before simulation
bayological Aug 25, 2023
a0cf881
refactor: get reserve proxy address from registry
bayological Aug 25, 2023
93f2fa0
chore: re add bytes4 array helper
bayological Aug 25, 2023
a8e5287
refactor: remove collateral asset spent set
bayological Aug 25, 2023
419dc23
refactor: add reserve, registry & fee tokn checks
bayological Aug 25, 2023
b18ca73
feat: load contracts without logs
bayological Aug 29, 2023
23355cc
refactor: use current median + split checks file
bayological Aug 29, 2023
4a21bd4
refactor: mint correct token for test 🙃
bayological Aug 29, 2023
5fc83da
Squashed commit of the following:
bayological Aug 29, 2023
5755971
Merge branch 'main' into feat/MU4-governance-script
bayological Aug 29, 2023
d14455d
docs: add eXOF proposal md file
bayological Aug 29, 2023
9547466
chore: remove mento core reference
bayological Aug 29, 2023
70d2448
docs: add proposal description
bayological Aug 29, 2023
887ae60
refactor: remove unused struct
bayological Aug 29, 2023
0b8b7db
chore: add mainnet euroc address
bayological Aug 30, 2023
ee6cd12
refactor: remove old deployment references
bayological Aug 30, 2023
232193e
refactor: removed unneeded imports
bayological Aug 30, 2023
8c6d0c8
refactor: rename rate feed ref for consistency
bayological Aug 30, 2023
326d41c
refactor: rename param
bayological Aug 30, 2023
1b0b5e1
refactor: add descriptions to stable token props
bayological Aug 30, 2023
65c610b
refactor: remove unused imports
bayological Aug 30, 2023
53b594d
feat: add verification of asset1 trading limit
bayological Aug 31, 2023
cd51f5e
chore: correct mainnet euroc address
bayological Aug 31, 2023
9fc66fb
refactor: rename getter to EURXOF for consistency
bayological Aug 31, 2023
e0968b0
refactor: remove duplicate adress references
bayological Aug 31, 2023
94b42fd
refactor: remove checks for trading limit config
bayological Aug 31, 2023
81c50be
refactor: end the cycle of duplication 🙅‍♂️
bayological Aug 31, 2023
7e8e361
refactor: rename bridged stable param for clarity
bayological Aug 31, 2023
58d717c
refactor: remove unnecessary code
bayological Aug 31, 2023
a0f0ac6
refactor: update log message
bayological Aug 31, 2023
af47400
chore: verify xof proxy ownership transfer
bayological Aug 31, 2023
547bd64
chore: fix typo
bayological Aug 31, 2023
ab77312
chore: add deprecation comment
bayological Aug 31, 2023
c71d139
refactor: add variable for pre existing pool count
bayological Aug 31, 2023
1fbd213
chore: add bridgedEuroC to error message
bayological Aug 31, 2023
97f125c
chore: fix typo
bayological Aug 31, 2023
8ae3c58
refactor: rename pool variables for clarity
bayological Aug 31, 2023
598d2b0
refactor: remove usdc from error message
bayological Aug 31, 2023
3765e3b
chore: fix typo
bayological Aug 31, 2023
ff39cbc
feat: verify constitution params
bayological Sep 1, 2023
047485f
Merge branch 'main' into feat/MU4-governance-script
bayological Sep 1, 2023
724f67a
refactor: do not add exof to reserve
bayological Sep 4, 2023
66f7614
chore: switch to just compliation build mode
bayological Sep 4, 2023
1a272a0
chore: revert size mode change
bayological Sep 4, 2023
5132593
refactor: exclude exof checks from size check
bayological Sep 4, 2023
2b10766
chore: remove set smoothing factor tx
Sep 5, 2023
e98db34
chore: line breaks between the different checks groups
Sep 5, 2023
39ec10c
fix: update reference rate for valuedeltabreaker0
nvtaveras Sep 5, 2023
024d300
fix: update reference rate for valuedeltabreaker1
nvtaveras Sep 5, 2023
b5266f5
chore: prettier
Sep 5, 2023
43d6531
feat: add EUROC/EUR dependency to CELOXOF feed
Sep 5, 2023
da68e08
fix: CELOXOF dependency should be EURXOF and not EUROCEUR
Sep 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parse_upgrade "$UPGRADE"
if ! [ -z "$SCRIPT" ]; then # Pick the script by name
SCRIPT_FILE="script/upgrades/$UPGRADE/deploy/$SCRIPT"
if test -f "$SCRIPT_FILE"; then
echo "🔎 $SCRIPT_FILE found"
echo "🔎 $SCRIPT_FILE found"
forge_script "$SCRIPT" "$SCRIPT_FILE" "$(forge_skip $UPGRADE)"
exit 0
else
Expand Down
5 changes: 3 additions & 2 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ parse_upgrade () { # $1: upgrade
forge_skip () { # $1: target
if [ "dev" = $1 ]; then
# If target is dev script, skip all upgrades
echo "--skip MU"
upgrades=$(ls script/upgrades | tr '\n' ' ')
echo "--skip $upgrades"
else
# if target is a un upgrade, skip dev and other upgrades
other_upgrades=$(ls script/upgrades | grep MU | grep -v $1 | tr '\n' ' ')
other_upgrades=$(ls script/upgrades | grep -v $1 | tr '\n' ' ')
echo "--skip dev- $other_upgrades"
fi
}
Expand Down
117 changes: 117 additions & 0 deletions broadcast/eXOF-00-Create-Proxies.sol/42220/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"transactions": [
{
"hash": "0xda37556aef0efb712cece2a2c9d00cf2d6b95ed831722f994280d2786e69218d",
"transactionType": "CREATE",
"contractName": "StableTokenXOFProxy",
"contractAddress": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
"function": null,
"arguments": null,
"transaction": {
"type": "0x00",
"from": "0x56fd3f2bee130e9867942d0f463a16fbe49b8d81",
"gas": "0xbd5cc",
"value": "0x0",
"data": "0x6080604052610016336001600160e01b0361001b16565b6100d9565b6001600160a01b03811661006a576040805162461bcd60e51b815260206004820152601160248201527006f776e65722063616e6e6f74206265203607c1b604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e61646d696e000000000000000000000000008152905190819003601301812060001901828155906001600160a01b038316907f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe290600090a25050565b61096b806100e86000396000f3fe60806040526004361061005a5760003560e01c8063bb913f4111610043578063bb913f41146102a7578063d29d44ee146102e7578063f7e6af80146103275761005a565b806303386ba3146101da57806342404e0714610269575b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01805473ffffffffffffffffffffffffffffffffffffffff811661013257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f20496d706c656d656e746174696f6e207365740000000000000000000000604482015290519081900360640190fd5b61013b8161033c565b6101a657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b60405136810160405236600082376000803683855af43d604051818101604052816000823e8280156101d6578282f35b8282fd5b610267600480360360408110156101f057600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b509092509050610378565b005b34801561027557600080fd5b5061027e61050c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102b357600080fd5b50610267600480360360208110156102ca57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610564565b3480156102f357600080fd5b506102676004803603602081101561030a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610715565b34801561033357600080fd5b5061027e6107c2565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061037057508115155b949350505050565b6103806107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461041957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b61042283610564565b600060608473ffffffffffffffffffffffffffffffffffffffff1684846040518083838082843760405192019450600093509091505080830381855af49150503d806000811461048e576040519150601f19603f3d011682016040523d82523d6000602084013e610493565b606091505b5090925090508161050557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f696e697469616c697a6174696f6e2063616c6c6261636b206661696c65640000604482015290519081900360640190fd5b5050505050565b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015490565b61056c6107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461060557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016106628261033c565b6106cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b81815560405173ffffffffffffffffffffffffffffffffffffffff8316907fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1390600090a25050565b61071d6107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b6107bf8161081a565b50565b604080517f656970313936372e70726f78792e61646d696e00000000000000000000000000815290519081900360130190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015490565b73ffffffffffffffffffffffffffffffffffffffff811661089c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6f776e65722063616e6e6f742062652030000000000000000000000000000000604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e61646d696e00000000000000000000000000815290519081900360130181207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018281559073ffffffffffffffffffffffffffffffffffffffff8316907f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe290600090a2505056fea265627a7a72315820fb186e42146669f7df853077eb65750c7576b3fca10559c92f45a0ae6a83f99d64736f6c63430005110032",
"nonce": "0x7b"
},
"additionalContracts": [],
"isFixedGasLimit": false
},
{
"hash": "0xe1af2ae5c50cd3f4fbd4253adf0a361d56acb1355a1f6741d6be0f4ac95262f6",
"transactionType": "CALL",
"contractName": "StableTokenXOFProxy",
"contractAddress": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
"function": "_transferOwnership(address)",
"arguments": [
"0xD533Ca259b330c7A88f74E000a3FaEa2d63B7972"
],
"transaction": {
"type": "0x00",
"from": "0x56fd3f2bee130e9867942d0f463a16fbe49b8d81",
"to": "0x73f93dcc49cb8a239e2032663e9475dd5ef29a08",
"gas": "0x9789",
"value": "0x0",
"data": "0xd29d44ee000000000000000000000000d533ca259b330c7a88f74e000a3faea2d63b7972",
"nonce": "0x7c"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0xda37556aef0efb712cece2a2c9d00cf2d6b95ed831722f994280d2786e69218d",
"transactionIndex": "0x5",
"blockHash": "0xc6cb77460436f1de22482966eff238c5bd89f5193a5aac94dc72be5eac08a479",
"blockNumber": "0x13f3adb",
"from": "0x56fD3F2bEE130e9867942D0F463a16fBE49B8d81",
"to": null,
"cumulativeGasUsed": "0xf9600",
"gasUsed": "0x91589",
"contractAddress": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
"logs": [
{
"address": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
"topics": [
"0x50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe2",
"0x00000000000000000000000056fd3f2bee130e9867942d0f463a16fbe49b8d81"
],
"data": "0x",
"blockHash": "0xc6cb77460436f1de22482966eff238c5bd89f5193a5aac94dc72be5eac08a479",
"blockNumber": "0x13f3adb",
"transactionHash": "0xda37556aef0efb712cece2a2c9d00cf2d6b95ed831722f994280d2786e69218d",
"transactionIndex": "0x5",
"logIndex": "0x9",
"removed": false
}
],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000020000000000000000000000000000080000000000000410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000100000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000",
"type": "0x0",
"effectiveGasPrice": "0x5d21dba00"
},
{
"transactionHash": "0xe1af2ae5c50cd3f4fbd4253adf0a361d56acb1355a1f6741d6be0f4ac95262f6",
"transactionIndex": "0x6",
"blockHash": "0xc6cb77460436f1de22482966eff238c5bd89f5193a5aac94dc72be5eac08a479",
"blockNumber": "0x13f3adb",
"from": "0x56fD3F2bEE130e9867942D0F463a16fBE49B8d81",
"to": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
"cumulativeGasUsed": "0x1003b6",
"gasUsed": "0x6db6",
"contractAddress": null,
"logs": [
{
"address": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
"topics": [
"0x50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe2",
"0x000000000000000000000000d533ca259b330c7a88f74e000a3faea2d63b7972"
],
"data": "0x",
"blockHash": "0xc6cb77460436f1de22482966eff238c5bd89f5193a5aac94dc72be5eac08a479",
"blockNumber": "0x13f3adb",
"transactionHash": "0xe1af2ae5c50cd3f4fbd4253adf0a361d56acb1355a1f6741d6be0f4ac95262f6",
"transactionIndex": "0x6",
"logIndex": "0xa",
"removed": false
}
],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000400000000000000000000000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000080000000100000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000",
"type": "0x0",
"effectiveGasPrice": "0x5d21dba00"
}
],
"libraries": [
"lib/mento-core-2.0.0/contracts/common/linkedlists/AddressLinkedList.sol:AddressLinkedList:0x6200F54D73491d56b8d7A975C9ee18EFb4D518Df",
"lib/mento-core-2.0.0/contracts/common/linkedlists/AddressSortedLinkedListWithMedian.sol:AddressSortedLinkedListWithMedian:0xED477A99035d0c1e11369F1D7A4e587893cc002B"
],
"pending": [],
"returns": {},
"timestamp": 1692273757,
"chain": 42220,
"multi": false,
"commit": "5ce3b55"
}
121 changes: 121 additions & 0 deletions broadcast/eXOF-01-Create-Implementations.sol/42220/run-latest.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions contracts/NonrecoverableValueDeltaBreaker.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.5.13;
import { ISortedOracles } from "mento-core-2.2.0/interfaces/ISortedOracles.sol";
import { ValueDeltaBreaker } from "mento-core-2.2.0/oracles/breakers/ValueDeltaBreaker.sol";

contract NonrecoverableValueDeltaBreaker is ValueDeltaBreaker {
constructor(
uint256 _defaultCooldownTime,
uint256 _defaultRateChangeThreshold,
ISortedOracles _sortedOracles,
address[] memory rateFeedIDs,
uint256[] memory rateChangeThresholds,
uint256[] memory cooldownTimes
)
public
ValueDeltaBreaker(
_defaultCooldownTime,
_defaultRateChangeThreshold,
_sortedOracles,
rateFeedIDs,
rateChangeThresholds,
cooldownTimes
)
{}
}
11 changes: 11 additions & 0 deletions script/interfaces/ICeloGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ interface ICeloGovernance {
uint256[] calldata dataLengths,
string calldata descriptionUrl
) external payable returns (uint256);

function setConstitution(address destination, bytes4 functionId, uint256 threshold) external;

/**
* @notice Returns the constitution for a particular destination and function ID.
* @param destination The destination address to get the constitution for.
* @param functionId The function ID to get the constitution for, zero for the destination
* default.
* @return The ratio of yes:no votes needed to exceed in order to pass the proposal.
*/
function getConstitution(address destination, bytes4 functionId) external view returns (uint256);
}
9 changes: 9 additions & 0 deletions script/interfaces/IERC20Lite.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.5.13;

interface IERC20Lite {
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
}
7 changes: 7 additions & 0 deletions script/interfaces/IFeeCurrencyWhitelist.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pragma solidity ^0.5.13;

interface IFeeCurrencyWhitelist {
function addToken(address) external;

function getWhitelist() external view returns (address[] memory);
}
3 changes: 3 additions & 0 deletions script/upgrades/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"USDCUSDRateFeedAddr": "0xA1A8003936862E7a15092A91898D69fa8bCE290c",
"USDCEURRateFeedAddr": "0x206B25Ea01E188Ee243131aFdE526bA6E131a016",
"USDCBRLRateFeedAddr": "0x25F21A1f97607Edf6852339fad709728cffb9a9d",
"EURXOFRateFeedAddr": "0x40dc8528167557353fdcd98548ab2139a670dd0b",
"EUROCEURRateFeedAddr": "0x26076B9702885d475ac8c3dB3Bd9F250Dc5A318B",
"PartialReserveMultisig": "0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1"
},
Expand All @@ -14,6 +15,7 @@
"USDCUSDRateFeedAddr": "0xA1A8003936862E7a15092A91898D69fa8bCE290c",
"USDCEURRateFeedAddr": "0x206B25Ea01E188Ee243131aFdE526bA6E131a016",
"USDCBRLRateFeedAddr": "0x25F21A1f97607Edf6852339fad709728cffb9a9d",
"EURXOFRateFeedAddr": "0x40dc8528167557353fdcd98548ab2139a670dd0b",
"EUROCEURRateFeedAddr": "0x26076B9702885d475ac8c3dB3Bd9F250Dc5A318B",
"PartialReserveMultisig": "0x56fD3F2bEE130e9867942D0F463a16fBE49B8d81"
},
Expand All @@ -23,6 +25,7 @@
"USDCUSDRateFeedAddr": "0xA1A8003936862E7a15092A91898D69fa8bCE290c",
"USDCEURRateFeedAddr": "0x206B25Ea01E188Ee243131aFdE526bA6E131a016",
"USDCBRLRateFeedAddr": "0x25F21A1f97607Edf6852339fad709728cffb9a9d",
"EURXOFRateFeedAddr": "0x40dc8528167557353fdcd98548ab2139a670dd0b",
"EUROCEURRateFeedAddr": "0x26076B9702885d475ac8c3dB3Bd9F250Dc5A318B",
"PartialReserveMultisig": "0x56fD3F2bEE130e9867942D0F463a16fBE49B8d81"
}
Expand Down
Loading
Loading