Closed medhakothari closed 3 years ago
It looks like #6792 was closed, @martinvol are you sure this epic covers contractkit support?
Looking at the labels I assumed it did, is that not the case @aslawson?
Per @nvtaveras the cEUR oracle work depends on this
Scratch that ^ there is apparently a workaround
Expected Behavior
Once cEUR is deployed, the cli and the contractkit will need to be updated. See the proposal here.
Detailed breakdown of changes:
[x] Add cEUR to the appropriate enums/functions/variables here: https://github.com/celo-org/celo-monorepo/blob/master/packages/sdk/base/src/currencies.ts
[x] Set up new wrappers for ExchangeEUR and StableTokenEUR:
BaseExchangeWrapper
(WIP name), which is intended to serve as a superclass of ExchangeWrapper and a new wrapper, ExchangeEURWrapper. There are some functions with dollar-specific names, likesellDollar
,buyDollar
,quoteUsdSell
,quoteUsdBuy
,getUsdExchangeRate
. The plan is to generalize those names inBaseExchangeWrapper
to work for all stables, likesellStable
, orquoteStableBuy
, etc (WIP names). Then, to preserve backward compatibility, ExchangeWrapper would keep the dollar-specific functions that serve as aliases of the generalized functions.BaseStableTokenWrapper
(WIP name) to serve as a superclass with all the meaty logic, and then haveStableTokenWrapper
(for cUSD) andStableTokenEURWrapper
(for cEUR) as subclasses.[x] (Optional) Add a function for reporting specifically for cEUR https://github.com/celo-org/celo-monorepo/blob/master/packages/sdk/contractkit/src/wrappers/SortedOracles.ts#L184
[x] Add ExchangeEUR & StableTokenEUR to the list of contracts (which are used for lookup in the Registry)
[x] Add StableTokenEUR to
CeloToken
:[x] Add ExchangeEUR & StableTokenEUR to
WrapperFactories
[x] Add ExchangeEUR & StableTokenEUR to
WrapperCacheMap
andWrapperCache
getStableTokenEUR
[x] Add ExchangeEUR & StableTokenEUR's config to
NetworkConfig
,getNetworkConfig
, andgetHumanReadableNetworkConfig
[x] Add
cEUR
toAccountBalance
andgetTotalBalance
[x] Add cEUR to comment on setting fee currency
[x] Add ExchangeEUR & StableTokenEUR to
ContractFactories
andWeb3ContractCache
Old: **Contractkit: registry, wrappers (exchange and stabletoken), add it in balances. Gas payment is handled via the whitelist as token that can afford gas. Here we have two implementation choices. A) duplicate cusd wrapper. B) something generic for multiple new tokens of the future (if we know that a new stable is in a near future, we should think abut spending a little more time on this)