Skip to content

Commit

Permalink
Add GraFun (#11798)
Browse files Browse the repository at this point in the history
  • Loading branch information
saymon-develop authored Oct 1, 2024
1 parent f6c131c commit 457c8c9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/grafun/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const ethers = require("ethers");

const BSC_RPC_URL = 'https://bsc-dataseed1.binance.org/';
const TOKEN_SALE_FACTORY = "0x8341b19a2A602eAE0f22633b6da12E1B016E6451";

async function getBscTVL() {
const provider = new ethers.JsonRpcProvider(BSC_RPC_URL);

const balanceWei = await provider.getBalance(TOKEN_SALE_FACTORY);
const balanceBNB = ethers.formatEther(balanceWei);

return { binancecoin: balanceBNB };
}

module.exports = {
methodology: "TVL is calculated by aggregating the market value of BNB tokens held within the Token Sale Factory smart contract.",
start: 42593135,
bsc: {
tvl: getBscTVL
}
};

0 comments on commit 457c8c9

Please sign in to comment.