From ec55fc3cfc8f8df0a502487ed2ed3fe9baaa5239 Mon Sep 17 00:00:00 2001 From: Nghia Hoang Date: Sun, 16 Jun 2024 12:21:31 +0700 Subject: [PATCH] Add IHF project adapter --- projects/infinity-hedge-fund/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 projects/infinity-hedge-fund/index.js diff --git a/projects/infinity-hedge-fund/index.js b/projects/infinity-hedge-fund/index.js new file mode 100644 index 00000000000..8661fb51d83 --- /dev/null +++ b/projects/infinity-hedge-fund/index.js @@ -0,0 +1,19 @@ +const TOKEN_CONTRACT = '0x3B9728bD65Ca2c11a817ce39A6e91808CceeF6FD'; +const STAKING_CONTRACT = '0x042Fef60aD51f48C65E6106F9b950178910A3300'; + +async function tvl(api) { + const contractBalance = await api.call({ + abi: 'erc20:balanceOf', + target: TOKEN_CONTRACT, + params: [STAKING_CONTRACT], + }); + + api.add(TOKEN_CONTRACT, contractBalance); +} + +module.exports = { + methodology: 'Get the balance of tokens in staking contract', + base: { + tvl, + } +};