From f82a9b462f87faa1c35ca759aa63e9d49e5b0d4f Mon Sep 17 00:00:00 2001 From: Mr-Lucky Date: Fri, 9 Aug 2024 11:21:23 +0800 Subject: [PATCH] add new project --- projects/SecWareX/index.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 projects/SecWareX/index.js diff --git a/projects/SecWareX/index.js b/projects/SecWareX/index.js new file mode 100644 index 000000000000..bf79b8588650 --- /dev/null +++ b/projects/SecWareX/index.js @@ -0,0 +1,31 @@ + +const BigNumber = require('bignumber.js'); + +const USDT_MINT = "0x55d398326f99059ff775485246999027b3197955"; +const SECWAREX_FOUNDATION = "0x34ebddd30ccbd3f1e385b41bdadb30412323e34f"; +const SECWAREX_REVENUE_POOL = "0x648d7f4ad39186949e37e9223a152435ab97706c"; + +const BALANCE_ABI = 'erc20:balanceOf'; + +async function tvl(api) { + const foundationBalance = await api.call({ + abi: BALANCE_ABI, + target: USDT_MINT, + params: [SECWAREX_FOUNDATION], + }); + const revenueBalance = await api.call({ + abi: BALANCE_ABI, + target: USDT_MINT, + params: [SECWAREX_REVENUE_POOL], + }); + const total = BigNumber(foundationBalance).plus(BigNumber(revenueBalance)).toFixed(0); + api.add(USDT_MINT, total); +} + +module.exports = { + bsc: { + tvl + }, + methodology: "Count the profits of SecWareX", + start: 36724659 +};