ExchangeHelper
Helper contract to buy/sell G$ at GoodReserve with any token supported by Uniswap V2. Since reserve only supports cDAI.
Events
TokenPurchased
Emitted when G$ tokens are purchased.
TokenSold
Emitted when G$ tokens are sold.
buy
The function converts any "buyWith" tokens to DAI. Then call to reserve's buy function is occured. It is to convert the tokens to G$ tokens.
Returns: how much G$ tokens were transferred.
sell
The function converts G$ tokens to cDAI through reserve then it makes further transactions according to desired _sellTo
token. The user could either send cDAI or DAI directly or desired token through Uniswap V2.
Returns: how much "sellTo" tokens were transferred.
Last updated