zeriontech / defi-sdk

DeFi SDK Makes Money Lego Work
https://docs.zerion.io/defi-sdk/
GNU Lesser General Public License v3.0
790 stars 249 forks source link

Add Time Stacking adapter #159

Closed alanhanaev closed 3 years ago

alanhanaev commented 3 years ago

Hello ! Please add support for TIME Staking for https://timewarp.finance/pools

Chronotech represents several projects, timex.io exchange, laborx.com freelance platform. The base currency of the projects is TIME (https://coinmarketcap.com/currencies/chrono-tech/) and for this currency there is staking on smart contracts rewarded in TIME (https://timewarp.finance/pools) for holders, which we obtain through buybacks in open markets, at the expense of the company's income.

sobolev-igor commented 3 years ago

Hey @alanhanaev ! Sorry for the late reply :) getBalance() should not always return TIME balance, it better to implement the following logic:

if (token == TIME) {
    return timeStakedAmount;
} else if (token == UNISWAP_TIME_ETH_LP) {
    return lpStakedAmount;
} else {
    return uint256(0);
}
alanhanaev commented 3 years ago

@sobolev-igor thanks for the answer :) Since a user can have two pools at the same time, I made two separate adapters