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/cgp-0146 #472

Merged
merged 5 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 39 additions & 0 deletions CGPs/cgp-0146.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
cgp: 146
title: MU07 - ChainlinkRelayer Oracle Upgrade
date-created: 2024-08-26
author: "Philip Rätsch <[email protected]>"
status: DRAFT
discussions-to: https://forum.celo.org/t/mu07-chainlink-price-feed-integration/8850
governance-proposal-id:
date-executed:
---

## Overview

CGP Number: 146 enables the integration of chainlink rate feeds into the SortedOracles contract.

With this Mento Upgrade a Chainlink Relayer contract is introduced.
The ChainlinkRelayer relays rate feed data from a Chainlink price feed or an aggregation of multiple Chainlink price feeds to the SortedOracles contract.
This contract can aggregate multiple Chainlink price feeds to provide derived rate feeds to the rest of the protocol. This is needed because it is more efficient for Oracle providers to report FX rates against the dollar and crypto-asset rates against the dollar, instead of all possible combinations.


## Proposed Changes

Check the [forum post](https://forum.celo.org/t/mu07-chainlink-price-feed-integration/8850) for a detailed description of the proposed changes.

## Verification

Check the [forum post](https://forum.celo.org/t/mu07-chainlink-price-feed-integration/8850) 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

- [MU07 CGP Forum Post](https://forum.celo.org/t/mu07-chainlink-price-feed-integration/8850)
- [Mento Core Contracts](https://github.com/mento-protocol/mento-core)
- [Mento Docs](https://docs.mento.org)
52 changes: 52 additions & 0 deletions CGPs/cgp-0146/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[
{
"contract": "SortedOracles",
"address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
"function": "addOracle",
"args": [
"0xaFc02368A174Cd08e01c373de6D0B537CECF43C8",
"0x8Ec42cd1F5F41EAA8701a0a246cD76Fc7543EA8E"
],
"value": "0"
},
{
"contract": "SortedOracles",
"address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
"function": "setTokenReportExpiry",
"args": [
"0xaFc02368A174Cd08e01c373de6D0B537CECF43C8",
"300"
],
"value": "0"
},
{
"contract": "SortedOracles",
"address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
"function": "addOracle",
"args": [
"0xab921d6ab1057601A9ae19879b111fC381a2a8E9",
"0x3bC1f31B8150dc65B9fB9E8B69604C40EaA97C2F"
],
"value": "0"
},
{
"contract": "SortedOracles",
"address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
"function": "setTokenReportExpiry",
"args": [
"0xab921d6ab1057601A9ae19879b111fC381a2a8E9",
"300"
],
"value": "0"
},
{
"contract": "SortedOracles",
"address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
"function": "setEquivalentToken",
"args": [
"0x105d4A9306D2E55a71d2Eb95B81553AE1dC20d7B",
"0xaFc02368A174Cd08e01c373de6D0B537CECF43C8"
],
"value": "0"
}
]
Loading