MGP-9: Adding a CELO/ETH feed to support WETH as gas currency

Authors: @nmlabs, @martinvol

Overview

This proposal will whitelist the Chainlink relayer contract required to support WETH as a gas currency, after Celo’s successfully transitioned to an Ethereum L2 on March 26, 2025 (official announcement). The ChainlinkRelayer will transmit price data from an aggregation of multiple Chainlink price feeds (CELO/USD and ETH/USD) to the SortedOracles contract.

The rate feed involved is CELO/ETH, which has a relayer contract already deployed. Details of the rate feed and corresponding relayer contract are provided in the table below:

RateFeed RateFeedId Relayer Contract
relayed:CELOETH 0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416 0xd5bAF8D2072B2dB54Bed9c4763D591a44C408A98

This proposal is a requirement, and must pass before executing, CGP-203 Adding WETH as gas currency. Historically the SortedOracles contract was owned by Celo Governance, but since CGP-156 passed, they are owned by Mento Governance.

Proposed Changes

  1. Add CELO/ETH relayer as oracle

    • Destination: SortedOracles.addOracle

    • Data: address token = 0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416, address oracleAddress = 0xd5bAF8D2072B2dB54Bed9c4763D591a44C408A98

    • Value: 0

  2. Set token report expiry for CELO/ETH

    • Destination: SortedOracles.tokenReportExpirySeconds

    • Data: address token 0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416, uint256 _reportExpirySeconds 360

    • Value: 0

  3. Set equivalent token token

    • Destination: SortedOracle.setEquivalentToken

    • Data: address token = 0xD221812de1BD094f35587EE8E174B07B6167D9Af (WETH), address equivalentToken = 0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416

    • Value: 0

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. With that said, this particular feed is considered low risk as it’s data will only be used as a reference price for gas price calculations.

Proposal json

[
  {
    "contract": "SortedOracles",
    "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
    "function": "addOracle",
    "args": [
      "0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416",
      "0xd5bAF8D2072B2dB54Bed9c4763D591a44C408A98"
    ],
    "value": "0"
  },
  {
    "contract": "SortedOracles",
    "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
    "function": "setTokenReportExpiry",
    "args": ["0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416", "360"],
    "value": "0"
  },
  {
    "contract": "SortedOracles",
    "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
    "function": "setEquivalentToken",
    "args": ["0xD221812de1BD094f35587EE8E174B07B6167D9Af", "0xF3CAaE71EAc2DA8D78372A62DDb3acdDaf3Df416"],
    "value": "0"
  }
  
]

Useful Links

2 Likes

gm! just quick note that MGP-8 is already taken, next one would be MGP-9 :slight_smile:

Ups, my bad, just updated it to MGP-9

1 Like

I think I can’t edit the post, so I attach here the encoded calldata:

[
  {
    "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
    "value": 0,
    "data": "0xf0ca4adb000000000000000000000000f3caae71eac2da8d78372a62ddb3acddaf3df416000000000000000000000000d5baf8d2072b2db54bed9c4763d591a44c408a98"
  },
  {
    "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
    "value": 0,
    "data": "0xfc20935d000000000000000000000000f3caae71eac2da8d78372a62ddb3acddaf3df4160000000000000000000000000000000000000000000000000000000000000168"
  },
  {
    "address": "0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33",
    "value": 0,
    "data": "0x145d8d18000000000000000000000000d221812de1bd094f35587ee8e174b07b6167d9af000000000000000000000000f3caae71eac2da8d78372a62ddb3acddaf3df416"
  }
]

The proposal has been posted on-chain: MGP-9: Adding a CELO/ETH feed to support WETH as gas currency