Hey folks, the first proposal to enable the needed oracles for the launch of the following new Mento stablecoins ($cGBP, $cAUD, $cCAD, $cCHF, and $cZAR) will be submitted on-chain soon.
Chainlink oracles for JPY and NGN are not yet ready, so those will be whitelisted in a future proposal. Proposals for the official launch of the different tokens will also follow soon.
This post provides an overview of the transactions to whitelist the Chainlink relayer contracts that will report the rates needed for these new stablecoins. As with previous proposals, the Celo community will have the opportunity to verify these transactions. In preparation for the upcoming CGP, we have completed the following steps:
- Tested the proposal on Alfajores
- Simulated the proposal on a fork of Celo Mainnet and conducted tests against this fork
Before we dive into the details of each section and transaction, we recommend setting up celocli to follow along. For those technically inclined, you can find everything described here in our deployment tooling repository. For verifying the addresses included in the proposal, please refer to the Appendix at the bottom for helpful tips.
1. Whitelisting and configuring of Chainlink Relayers in SortedOracles
The ChainlinkRelayer transmits rate feed data from a single Chainlink price feed or an aggregation of multiple Chainlink price feeds to the SortedOracles contract.
This contract can aggregate multiple price feeds to provide derived rate feeds to the protocol. This is necessary because it is more efficient for Oracle providers to report FX rates against the dollar and crypto-asset rates against the dollar, rather than providing all possible combinations.
For example, Chainlink reports the GBP/USD rate, but it does not directly provide the CELO/GBP rate, which is needed for gas payments in a GBP stable token. However, by using both the GBP/USD and CELO/USD rates, the following path can be derived:
CELO/USD * inverse(GBP/USD) = CELO/GBP.
A separate ChainlinkRelayer instance will be deployed for each required rate feed.
Each token requires a total of 5 transactions, and they all follow the same pattern:
- Whitelist the CELO/XXX relayer (for gas payments purposes)
- Set the report expiry time for the CELO/XXX pair
- Whistelist the XXX/USD relayer
- Set the report expiry time for the XXX/USD pair
- Set the equivalent token for XXX to be CELO/XXX (for gas payments purposes)
AUD Relayers
TX#0 - whitelist CELO/AUD Relayer in SortedOracles - addOracle()
- Verify the SortedOracleProxy address
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CELOAUD")))));- Should match:
0x1aA86eAd81936a1E9707c6B4A7AEfb2B4A538B58
- Verify the ChainlinkRelayer address:
0x50DA4b658076B86970EC6e6650823B4A24E7026f
TX#1 - configure CELO/AUD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x1aA86eAd81936a1E9707c6B4A7AEfb2B4A538B58 - Verify Report Expiry Seconds:
360(6 minutes)
TX#2 - whitelist AUD/USD Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:AUDUSD")))));- Should match:
0x646bD504C3864Ea5b8A6B6D25743721f61864A07
- Verify the ChainlinkRelayer address:
0xA8869Bb55d1082D12c8F993A56cE8D050551a3d9
TX#3 - Configure AUD/USD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x646bD504C3864Ea5b8A6B6D25743721f61864A07 - Verify Report Expiry Seconds:
360
TX#4 - Configure equivalent token for AUD rate in SortedOracles - setEquivalentToken()
- Verify the token address:
0x7175504C455076F15c04A2F90a8e352281F492F9(StableTokenAUDProxy) - Verify the Rate Feed Identifier:
0x1aA86eAd81936a1E9707c6B4A7AEfb2B4A538B58
CAD Relayers
TX#5 - whitelist CELO/CAD Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CELOCAD")))));- Should match:
0x15339E57E761F006834893CD5134138339e7bfCb
- Verify the ChainlinkRelayer address:
0x98aB92521fd13026292Cb6B31229ADf3B60fAE56
TX#6 - Configure CELO/CAD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x15339E57E761F006834893CD5134138339e7bfCb - Verify Report Expiry Seconds:
360
TX#7 - whitelist CAD/USD Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CADUSD")))));- Should match:
0x20869cF54Ead821C45DFb2aB0C23d2e10Fbb65A4
- Verify the ChainlinkRelayer address:
0x3a7af4E6f53ac13BC9e67Cb6ed5866d855692390
TX#8 - Configure CAD/USD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x20869cF54Ead821C45DFb2aB0C23d2e10Fbb65A4 - Verify Report Expiry Seconds:
360
TX#9 - Configure equivalent token for CAD rate in SortedOracles - setEquivalentToken()
- Verify the token address:
0xff4Ab19391af240c311c54200a492233052B6325(StableTokenCADProxy) - Verify the Rate Feed Identifier:
0x15339E57E761F006834893CD5134138339e7bfCb
CHF Relayers
TX#10 - whitelist CELO/CHF Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CELOCHF")))));- Should match:
0xD808031cC050CFC81e7609156002361af6a579A6
- Verify the ChainlinkRelayer address:
0x09B310c2D4b0CDCE563762C0e3992e352Cacdda6
TX#11 - configure CELO/CHF token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0xD808031cC050CFC81e7609156002361af6a579A6 - Verify Report Expiry Seconds:
360
TX#12 - whitelist CHF/USD Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CHFUSD")))));- Should match:
0x0f61BA9c30ef7CaEE7E5CC1F96BFFCb0f52ccD64
- Verify the ChainlinkRelayer address:
0x1b904277b22cA598ef17b38f64De5F9C29cd31BD
TX#13 - Configure CHF/USD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x0f61BA9c30ef7CaEE7E5CC1F96BFFCb0f52ccD64 - Verify Report Expiry Seconds:
360
TX#14 - configure equivalent token for CHF rate in SortedOracles - setEquivalentToken()
- Verify the token address:
0xb55a79F398E759E43C95b979163f30eC87Ee131D(StableTokenCHFProxy) - Verify the Rate Feed Identifier:
0xD808031cC050CFC81e7609156002361af6a579A6
GBP Relayers
TX#15 - whitelist CELO/GBP Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CELOGBP")))));- Should match:
0x6732fEF1b6EE8003A06a3D7eECFF1a36550CFDF5
- Verify the ChainlinkRelayer address:
0x3E3e3E04a4d4654042CB7f0efe10DeF73Fda6223
TX#16 - configure CELO/GBP token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x6732fEF1b6EE8003A06a3D7eECFF1a36550CFDF5 - Verify Report Expiry Seconds:
360
TX#17 - whitelist GBP/USD Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:GBPUSD")))));- Should match:
0xf590b62f9cfcc6409075b1ecAc8176fe25744B88
- Verify the ChainlinkRelayer address:
0x215d3ba962597DeFb38Da439ED4dB8E8a63e409a
TX#18 - configure GBP/USD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0xf590b62f9cfcc6409075b1ecAc8176fe25744B88 - Verify Report Expiry Seconds:
360
TX#19 - configure equivalent token for GBP rate in SortedOracles - setEquivalentToken()
- Verify the token address:
0xCCF663b1fF11028f0b19058d0f7B674004a40746(StableTokenGBPProxy) - Verify the Rate Feed Identifier:
0x6732fEF1b6EE8003A06a3D7eECFF1a36550CFDF5
ZAR Relayers
TX#20 - whitelist CELO/ZAR Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:CELOZAR")))));- Should match:
0xD064b6CcFF2AE8968bA6725e9A92f3F0431bf5D0
- Verify the ChainlinkRelayer address:
0x28EFfAbD76589Dd822F41e79C965c74Ab9d27160
TX#21 - configure CELO/ZAR token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0xD064b6CcFF2AE8968bA6725e9A92f3F0431bf5D0 - Verify Report Expiry Seconds:
360
TX#22 - whitelist ZAR/USD Relayer in SortedOracles - addOracle()
- Verify the Rate Feed Identifier
address(uint160(uint256(keccak256(abi.encodePacked("relayed:ZARUSD")))));- Should match:
0x17ef04Af0c52465694a841552fc2415169b1114c
- Verify the ChainlinkRelayer address:
0x4FF9042aF59AF2B507b9423bE385f664FF87F7af
TX#23 - Configure ZAR/USD token report expiry time in SortedOracles - setTokenReportExpiry()
- Verify the Rate Feed Identifier:
0x17ef04Af0c52465694a841552fc2415169b1114c - Verify Report Expiry Seconds:
360
TX#24 - Configure equivalent token for ZAR rate in SortedOracles - setEquivalentToken()
- Verify the token address:
0x4c35853A3B4e647fD266f4de678dCc8fEC410BF6(StableTokenZARProxy) - Verify the Rate Feed Identifier:
0xD064b6CcFF2AE8968bA6725e9A92f3F0431bf5D0
Appendix: Verifying an address
Verifying that an address in the CGP is correct requires a few different strategies depending on what the address is (see the mento docs for some additional information). Here are common situations:
- Is it a rate feed identifier like:
address(uint160(keccack256("relayed:CELOGBP")))- Use Keccak-256 Online 2 to compute the keccak
- Take the last 40 characters (20 bytes) of the keccak and compare them with the value
- Is it a Mento contract?
- It’s probably either SortedOracles or the proxy address of one of the 5 stables included in this launch.
- Is it a Core Celo contract?
- Yes:
- It can be verified in the Celo Registry
- Yes: