Hi folks! Due to technical constraints, we had to split the on-chain proposal into two parts since the full migration exceeded Celo’s block gas limit. Both proposals are now available:
CGP184: Mento Oracles Migration pt. 1
CGP186: Mento Oracles Migration pt. 2
This post guides you through verifying the transactions included in these proposals. You can follow along using the raw transactions found in the mainnet.json files (CGP184, CGP186) in the Celo governance repo.
We have prepared for this migration by:
- Testing the proposal on Alfajores
- Simulating the proposal on a fork of Celo Mainnet
- Running comprehensive tests against the fork
While the proposals contain many transactions, they follow a straightforward structure. The first proposal (CGP184) focuses solely on removing old whitelisted oracle addresses, which comprises most of the migration transactions. The second proposal (CGP186) completes the migration by whitelisting the new Chainlink relayers, configuring report expiry times, and recreating the pools with updated parameters.
To follow along with each section and transaction, you’ll find these tools helpful:
For the tech-savvy, you can find all the details we’re describing here in our deployment tooling repository as code, in the file OracleRemoval.sol for CGP184 and OracleMigration.sol for CGP186. To verify the addresses included in the proposal, please refer to the Appendix below.
CGP184 - Mento Oracles Migration pt. 1
Remove Current Whitelisted Addresses (129 Transactions)
This proposal contains 129 transactions, all of the same type: calls to the the sortedOracles.removeOracle()
function. It removes all current whitelisted addresses from each migrating feed, except for the Redstone adapter contract (0x6490a3FFAD86CA14FF84Be380D5639Fb8fBD311B).
Here’s a breakdown of the first transaction. These verification steps apply to all transactions:
TX#0 - Remove a whitelisted oracle from the CELO/USD feed
- Verify the SortedOracles address
- Verify the arguments:
- token: The rate feed identifier (in this case, the cUSD token address)
0x765DE816845861e75A25fCA122bb6898B8B1282a
- oracle: The address of the whitelisted oracle to remove
0xBBd6e54Af7A5722f42461C6313F37Bd50729F195
To view the list of whitelisted addresses for any rate feed identifier in the SortedOracles contract, use celocli:
celocli oracle:list <rateFeed> --node <https://forno.celo.org
or foundry
cast call 0xefb84935239dacdecf7c5ba76d8de40b077b7b33 "getOracles(address)(address[])" "<rateFeed>" --rpc-url <https://forno.celo.org
For a complete list of the identifiers used in this proposal, please refer to the appendix at the end of this post.
CGP186 - Mento Oracles Migration pt. 2
Whitelist New Relayers (9 txs)
The second proposal begins by whitelisting 9 new Chainlink relayer addresses for pools that Mento Labs previously operated. These relayers have been deployed and will be whitelisted in the following order:
- CELO/XOF - 0x242631D81A6eb2516a2A51C31240929d514Ea202
- EUROC/XOF - 0x9B5B7e9CE62b465C627EDd088E8907C1CBFCAa80
- EUR/XOF - 0x22e78caFCD7eaDD7907328Be22E0C6D66Ce363B3
- CELO/KES - 0x698Ac749cF4Eb5E9E8D903e2F222275E53416B54
- KES/USD - 0x4920101408D129a1A7B33fB0ECA4FB0233FD00D4
- USDT/USD - 0x564dD5fec58E7103C2A6041B7dD1BB3074a4616b
- EUR/USD - 0xC4918A76A7fdB113f2dFa9B162e875f271A2f7b8
- BRL/USD - 0x6322A90B468C14d1091CC91bC42FAd5584312220
- XOF/USD - 0xF2772e9EF0C1bc2794f7c21cf35843391bC32A5A
Note that the last three (EUR/USD, BRL/USD, and XOF/USD) are not currently in use, but we are whitelisting them now for an upcoming Mento Upgrade proposal.
Here’s a breakdown of the first two transactions in this section. These verification steps apply to all subsequent transactions:
TX#0 - Whitelist Chainlink relayer for eXOF/CELO
- Verify the SortedOracles address
- Verify the arguments:
- token: The rate feed identifier (in this case, the eXOF token address)
0x73F93dcc49cB8A239e2032663e9475dd5ef29A08
- oracle: The address of the Chainlink relayer to add
0x242631D81A6eb2516a2A51C31240929d514Ea202
TX#1 - Whitelist Chainlink relayer for EUROC/XOF
- Verify the SortedOracles address
- Verify the arguments:
- token: The rate feed identifier
address(uint160(uint256(keccak256("EUROCXOF"))))
0xeD35e46b095197dA30DdFFA5B91d386886d5ce0d
- oracle: The address of the Chainlink relayer to add
0x9B5B7e9CE62b465C627EDd088E8907C1CBFCAa80
Set Token Report Expiry (17 txs)
The next 17 transactions of the proposal set the tokenReportExpiry parameter on sortedOracles to 6 minutes for all rate feeds.
Here is a breakdown of the first two transactions in this section. The same verification steps apply to all transactions:
TX#9 - Set report expiry for CELO/USD
- Verify the SortedOracles address
- Verify the arguments:
- token: The rate feed identifier (in this case, the cUSD token address)
0x765DE816845861e75A25fCA122bb6898B8B1282a
- reportExpirySeconds: The new report expiry time in seconds
TX#10 - Set report expiry for CELO/EUR
- Verify the SortedOracles address
- Verify the arguments:
- token: The rate feed identifier (in this case, the cEUR token address)
0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73
- reportExpirySeconds: The new report expiry time in seconds
Note: The final transaction of this section, TX#25, sets the report expiry time for the PHP/USD rate feed. While this feed is already operated by Chainlink with a 5 minute report expiry time (set during CGP146/MU07), we are updating it to 6 minutes for consistency across all feeds.
Recreate Exchanges with New Config (30 txs)
The last 30 transactions of the proposal destroy and recreate the exchange pools with updated configuration parameters. The new configuration includes:
- Setting minimumReports to 1
- Setting referenceRateResetFrequency to 6 Minutes
- Optionally, setting new parameters for spread and stablePoolResetSize
The following pools will have a new updated spread as part of this proposal:
Pool |
current spread (fee) |
proposed spread (fee) |
cUSD/USDC |
0% |
0.05% |
cUSD/axlUSDC |
0% |
0.25% |
cEUR/axlUSDC |
0.25% |
0.5% |
cREAL/axlUSDC |
0.25% |
0.5% |
cEUR/axlEUROC |
0.02% |
0.5% |
cUSD/USDT |
0% |
0.05% |
eXOF/CELO |
0.5% |
2% |
eXOF/axlEUROC |
0.25% |
2% |
The following pools will have a new updated stablePoolResetSize as part of this proposal:
Pool |
current stablePoolResetSize |
proposed stablePoolResetSize |
cUSD/CELO |
7_200_000 |
3_000_000 |
Below is a breakdown of the first 4 transactions in this section. The same verification steps apply to all remaining transactions.
Verification tip: As in previous proposals, we recommend ignoring the args field from celocli
and focusing on params, as well as ignoring the numbered fields and instead focusing only on the named fields. This is due to how nested structs are serialized by celocli
, which might make the payload look confusing.
TX#26 - Destroy the cUSD/PUSO exchange
- Verify the BiPoolManager address
0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901
- Verify the arguments:
- exchangeId: The deterministic id of the cUSD/PUSO exchange
0x7952984d7278ca3417febf52815c321984ac3147ced2c02bb6a02b0bcab08413
TX#27 - Recreate cUSD/PUSO exchange with new config
- Verify the BiPoolManager address
- Verify the exchange configuration
TX#28 - Destroy the cUSD/USDT exchange
- Verify the BiPoolManager address
0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901
- Verify the arguments:
- exchangeId: The deterministic id of the cUSD/USDT exchange
0x773bcec109cee923b5e04706044fd9d6a5121b1a6a4c059c36fdbe5b845d4e9b?
TX#29 - Recreate cUSD/USDT exchange with new config
- Verify the BiPoolManager address
- Verify the exchange configuration
Appendix: Verifying an address
Contracts
Please refer to this section of the Mento docs for a complete list of contract addresses for both Stable tokens (like cUSD, cEUR) and core Mento Protocol contracts (like BiPoolManager).
You’ll also find the following external addresses in the transactions that recreate the cUSD/CELO, cUSD/USDC, cUSD/USDT, cUSD/axlUSDC, and cEUR/axlEUROC exchanges:
Rate feed identifiers
The following rate feed identifiers were used in this proposal. Please refer to the mento docs for an additional explanation on rate feed identifiers:
Rate Feed |
Identifier |
Explanation |
CELO/USD |
0x765DE816845861e75A25fCA122bb6898B8B1282a |
The cUSD contract address |
CELO/EUR |
0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73 |
The cEUR contract address |
CELO/BRL |
0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787 |
The cREAL contract address |
CELO/XOF |
0x73F93dcc49cB8A239e2032663e9475dd5ef29A08 |
The eXOF contract address |
CELO/KES |
0x456a3D042C0DbD3db53D5489e98dFb038553B0d0 |
The cKES contract address |
USDC/USD |
0xA1A8003936862E7a15092A91898D69fa8bCE290c |
address(uint160(uint256(keccak256("USDCUSD")))) |
USDC/EUR |
0x206B25Ea01E188Ee243131aFdE526bA6E131a016 |
address(uint160(uint256(keccak256("USDCEUR")))) |
USDC/BRL |
0x25F21A1f97607Edf6852339fad709728cffb9a9d |
address(uint160(uint256(keccak256("USDCBRL")))) |
EUROC/EUR |
0x26076B9702885d475ac8c3dB3Bd9F250Dc5A318B |
address(uint160(uint256(keccak256("EUROCEUR")))) |
EUROC/XOF |
0xed35e46b095197da30ddffa5b91d386886d5ce0d |
address(uint160(uint256(keccak256("EUROCXOF")))) |
EUR/XOF |
0x40dc8528167557353fdcd98548ab2139a670dd0b |
address(uint160(uint256(keccak256("EURXOF")))) |
USDT/USD |
0xE06C10C63377cD098b589c0b90314bFb55751558 |
address(uint160(uint256(keccak256("USDTUSD")))) |
KES/USD |
0xbAcEE37d31b9f022Ef5d232B9fD53F05a531c169 |
address(uint160(uint256(keccak256("KESUSD")))) |
PHP/USD |
0xab921d6ab1057601A9ae19879b111fC381a2a8E9 |
address(uint160(uint256(keccak256("relayed:PHPUSD")))) |
EUR/USD |
0xF4f9bBdA9CD6841fCB9b1510f9269E2dB42a6e3a |
address(uint160(uint256(keccak256("relayed:EURUSD")))) |
BRL/USD |
0x9dB83bE97C82912cB342407dd7b880983052B9c1 |
address(uint160(uint256(keccak256("relayed:BRLUSD")))) |
XOF/USD |
0x43620310c2FEADbFEcFd71b5A93E6e28946d64a5 |
address(uint160(uint256(keccak256("relayed:XOFUSD")))) |
Exchange IDs
Please refer to this section of the Mento docs for an explanation on exchange identifiers as well as the complete list of identifiers per exchange.