Fix winkyverse adapter

This commit is contained in:
g1nt0ki
2022-04-29 13:51:53 +05:30
parent 4436237cf2
commit a0fb80a2d3

View File

@@ -1,7 +1,7 @@
const { stakings } = require("../helper/staking");
const { sumTokens } = require("../helper/unwrapLPs");
const { default: BigNumber } = require('bignumber.js');
const WNK = "0xb160A5F19ebccd8E0549549327e43DDd1D023526";
const WNK = "0xb160A5F19ebccd8E0549549327e43DDd1D023526".toLowerCase();
const stakingContracts = [
"0xc45047c5b26146d10a25295912c81098f94d8d1a",
"0x5ff3450546c7c29cc47617f08f30b7e79371b3ed",
@@ -9,16 +9,19 @@ const stakingContracts = [
];
async function staking(timestamp, ethBlock, chainBlocks) {
const balances = await stakings(stakingContracts, WNK, 'bsc')(timestamp, ethBlock, chainBlocks)
const balances = { }
const block = chainBlocks.bsc
const chain = 'bsc'
await sumTokens(balances, stakingContracts.map(o => [WNK, o]), block, chain)
balances['the-winkyverse'] = BigNumber(balances[`bsc:${WNK}`]).div(1e18).toFixed(0);
balances[`bsc:${WNK}`] = 0
delete balances[`bsc:${WNK}`]
return balances
}
module.exports = {
methodology: `TVL for Winkyverse consists of the staking of WNK into 3 staking (time-locked) contracts.`,
bsc:{
tvl: () => ({}),
tvl: async () => ({}),
staking,
}
}