Skip to content

Instantly share code, notes, and snippets.

@nategraf
Last active July 2, 2020 23:23
Show Gist options
  • Save nategraf/11f53a7280cb758ec3bf8d9b73e98e6e to your computer and use it in GitHub Desktop.
Save nategraf/11f53a7280cb758ec3bf8d9b73e98e6e to your computer and use it in GitHub Desktop.
Proposal to Add cUSD to the Reserve's list of stable tokens on Baklava

Baklava CGP [0001]: Add cUSD to the Reserve's list of stable tokens

  • Date: 2020-07-2
  • Author(s): @nategraf (Victor | cLabs)
  • Status: PROPOSED
  • Governance Proposal ID #: 1

Overview

Add cUSD to the list of stabilized assets in the Reserve contract.

During deployment of the Baklava network on June 24th, a change in configuration resulted in cUSD not being added to the list of assets stabilized by the Reserve. As a result, the isReserveLow call, used in the rewards distribution code of the Celo blockchain client, reverts with a divide-by-zero error and rewards do not get distributed to voters or validators. Adding the cUSD contract to the Reserve's list of stabilized assets will correct this issue and allow for rewards to be distributed.

Proposed Changes

  1. Add StableToken (cUSD) smart contract address to the Reserve
  • Destination: Reserve (0x68Dd816611d3DE196FDeb87438B74A9c29fd649f),
  • Function: addToken
  • Arguments: StableToken Address (0x62492A644A588FD904270BeD06ad52B9abfEA1aE)

Verification

  1. Confirm proposal steps: run celocli governance:view --proposalID 1
  2. Confirm StableToken address: run celocli network:contracts

Post-Execution Verification

  1. Check that EpochRewards.isReserveLow() does not revert by calling web3.eth.call({to: '0xfdc7D3da53Ca155dDCE793B0de46f4c29230EecD', data: '0x9ad0cce7'}) and ensuring the result does not start with 0x08c379a.
  2. On the next Epoch boundary, ensure that rewards are distributed correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment