-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6c131c
commit 457c8c9
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
}; |