From 409d0e7bb73eefcdaba27fe00c00d9c0fd1f9d25 Mon Sep 17 00:00:00 2001 From: Bayological <6872903+bayological@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:46:00 -0500 Subject: [PATCH 1/3] feat: add ccop oracle whitelist proposal --- CGPs/cgp-0150.md | 69 ++++++++++++++++++++++++++++++++++++++ CGPs/cgp-0150/mainnet.json | 46 +++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 CGPs/cgp-0150.md create mode 100644 CGPs/cgp-0150/mainnet.json diff --git a/CGPs/cgp-0150.md b/CGPs/cgp-0150.md new file mode 100644 index 00000000..13f15416 --- /dev/null +++ b/CGPs/cgp-0150.md @@ -0,0 +1,69 @@ +--- +cgp: 150 +title: Adding oracles to support cCOP +date-created: 2024-10-17 +author: "Bayo Sodimu " +status: Draft +discussions-to: +governance-proposal-id: +date-executed: +--- + +## Overview + +This governance proposal will whitelist the Chainlink relayer contracts required to support the cCOP. The ChainlinkRelayer will transmit rate feed data from a Chainlink price feed or an aggregation of multiple Chainlink price feeds to the SortedOracles contract. + +The rate feeds involved are COP/USD and CELO/COP, both of which already have relayer contracts deployed. Details of the rate feeds and corresponding relayer contracts are provided in the table below: + +| RateFeed | RateFeedId | Relayer Contract | +| --------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | +| relayed:COPUSD | 0x0196D1F4FdA21fA442e53EaF18Bf31282F6139F1 | [0x783F947126Adb7646c2A459B867f5B526D2E6603](https://celoscan.io/address/0x783F947126Adb7646c2A459B867f5B526D2E6603#readContract) | +| relayed:CELOCOP | 0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC | [0x5926F76D43Ce2D778880226b3C4e7156C8Ece99e](https://celoscan.io/address/0x5926F76D43Ce2D778880226b3C4e7156C8Ece99e#readContract) | + +## Proposed Changes + +1. **Add CELOCOP relayer as oracle** + + - Destination: SortedOracles.addOracle + - Data: `0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC`, `0x5926F76D43Ce2D778880226b3C4e7156C8Ece99e` + - Value: 0 + +2. **Set token report expiry for CELOCOP** + + - Destination: SortedOracles.tokenReportExpirySeconds + - Data: `0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC`, 360 + - Value: 0 + +3. **Add COPUSD relayer as oracle** + + - Destination: SortedOracles.addOracle + - Data: `0x0196D1F4FdA21fA442e53EaF18Bf31282F6139F1`, `0x783F947126Adb7646c2A459B867f5B526D2E6603` + - Value: 0 + +4. **Set token report expiry for COPUSD** + + - Destination: SortedOracles.tokenReportExpirySeconds + - Data: `0x0196D1F4FdA21fA442e53EaF18Bf31282F6139F1`, 360 + - Value: 0 + +5. **Set equivalent token for CELOPHP ratefeedId** + + - Destination: SortedOracles.setEquivalentToken + - Data: `0x8A567e2aE79CA692Bd748aB832081C45de4041eA`, `0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC` + - Value: 0 + +## Verification + +Check the [forum post](https://forum.celo.org/t/launch-of-ccop-colombia-s-first-decentralized-stablecoin/9211) for a detailed description of verification steps. + +## Risks + +The data relayed by the ChainlinkRelayer contract is only as secure as the Chainlink price feeds it relies on. If the Chainlink price feeds are compromised, the data relayed by the ChainlinkRelayer contract could be manipulated. This could lead to the SortedOracles contract reporting incorrect rate feeds to the rest of the protocol. + +This risk is present with all Oracle solution and is not specific to the Chainlink price feeds. In order to mitigate this risk, the Mento Protocol has implemented onchain circuit breakers that automatically pause the protocol if the reported data is outside of a predefined threshold. As well as our onchain trading limits, which limit the trading bandwidth. + +## Useful Links + +- [cCOP Proposal Forum Post](https://forum.celo.org/t/launch-of-ccop-colombia-s-first-decentralized-stablecoin/9211) +- [Mento Core Contracts](https://github.com/mento-protocol/mento-core) +- [Mento Docs](https://docs.mento.org) diff --git a/CGPs/cgp-0150/mainnet.json b/CGPs/cgp-0150/mainnet.json new file mode 100644 index 00000000..12f43f90 --- /dev/null +++ b/CGPs/cgp-0150/mainnet.json @@ -0,0 +1,46 @@ +[ + { + "contract": "SortedOracles", + "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33", + "function": "addOracle", + "args": [ + "0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC", + "0x5926F76D43Ce2D778880226b3C4e7156C8Ece99e" + ], + "value": "0" + }, + { + "contract": "SortedOracles", + "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33", + "function": "setTokenReportExpiry", + "args": ["0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC", "360"], + "value": "0" + }, + { + "contract": "SortedOracles", + "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33", + "function": "addOracle", + "args": [ + "0x0196D1F4FdA21fA442e53EaF18Bf31282F6139F1", + "0x783F947126Adb7646c2A459B867f5B526D2E6603" + ], + "value": "0" + }, + { + "contract": "SortedOracles", + "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33", + "function": "setTokenReportExpiry", + "args": ["0x0196D1F4FdA21fA442e53EaF18Bf31282F6139F1", "360"], + "value": "0" + }, + { + "contract": "SortedOracles", + "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33", + "function": "setEquivalentToken", + "args": [ + "0x8A567e2aE79CA692Bd748aB832081C45de4041eA", + "0x32ABF1cBdFdcD56790f427694be2658d4B1A83bC" + ], + "value": "0" + } +] From d554826dc4216b20a0675cf4a29d6de03b760c85 Mon Sep 17 00:00:00 2001 From: Bayological <6872903+bayological@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:38:13 -0500 Subject: [PATCH 2/3] chore: correct cgp status --- CGPs/cgp-0150.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CGPs/cgp-0150.md b/CGPs/cgp-0150.md index 13f15416..f148605a 100644 --- a/CGPs/cgp-0150.md +++ b/CGPs/cgp-0150.md @@ -3,7 +3,7 @@ cgp: 150 title: Adding oracles to support cCOP date-created: 2024-10-17 author: "Bayo Sodimu " -status: Draft +status: DRAFT discussions-to: governance-proposal-id: date-executed: From 71478af8bf45332e184eb30b306278b2b6bc3c9e Mon Sep 17 00:00:00 2001 From: Bayological <6872903+bayological@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:42:07 -0500 Subject: [PATCH 3/3] Update cgp-0150.md --- CGPs/cgp-0150.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CGPs/cgp-0150.md b/CGPs/cgp-0150.md index f148605a..2309a82f 100644 --- a/CGPs/cgp-0150.md +++ b/CGPs/cgp-0150.md @@ -2,9 +2,9 @@ cgp: 150 title: Adding oracles to support cCOP date-created: 2024-10-17 -author: "Bayo Sodimu " +author: "Bayo Sodimu (bayo.sodimu@mentolabs.xyz)" status: DRAFT -discussions-to: +discussions-to: https://forum.celo.org/t/launch-of-ccop-colombia-s-first-decentralized-stablecoin/9211 governance-proposal-id: date-executed: ---