diff --git a/projects/celery/index.js b/projects/celery/index.js index dceb66913..2ac7c560f 100644 --- a/projects/celery/index.js +++ b/projects/celery/index.js @@ -1,41 +1,15 @@ -const sdk = require('@defillama/sdk'); -const { getBlock } = require('../helper/getBlock'); -const { default: BigNumber } = require('bignumber.js'); +const { staking } = require('../helper/staking') const CHAIN = "smartbch" // token contract const CLY = "0x7642df81b5beaeeb331cc5a104bd13ba68c34b91" -const getTotalStakingSupply = async (timestamp, ethBlock, chainBlocks) => { - const block = await getBlock(timestamp, CHAIN, chainBlocks, false) - const total = (await sdk.api.abi.call({ - target: CLY, - abi: { - "inputs": [], - "name": "getTotalStakingSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - chain: CHAIN, - block - })).output - - return {'celery': BigNumber(total).dividedBy(10 ** 18)} -} - module.exports = { misrepresentedTokens: false, - methodology: "Contract function is called to get the total staked CLY tokens in the smart contract", + methodology: "Staked CLY tokens are counted towards staking metric", smartbch: { tvl: () => ({}), - staking: getTotalStakingSupply, + staking: staking(CLY, CLY, CHAIN, "celery", 18), }, }