Skip to content

Commit

Permalink
Merge pull request #16 from TLX-Protocol/fix-circulating-supply
Browse files Browse the repository at this point in the history
πŸ› Fix Circulating Supply API
  • Loading branch information
chase-manning authored May 16, 2024
2 parents da587ab + 1f652fe commit 8910cec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions functions/src/supply.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Contract, Interface, JsonRpcProvider } from "ethers";
import { Airdrop, AmmDistributor, Bonding, MAX_SUPPLY, OPTIMISM_RPC, TLX, Vesting } from "./constants";
import { Airdrop, AmmDistributor, Bonding, GenesisLocker, MAX_SUPPLY, OPTIMISM_RPC, TLX, Vesting } from "./constants";

import bigintToNumber from "./helpers/bigint-to-number";

Expand All @@ -8,13 +8,13 @@ const erc20abi = new Interface(["function balanceOf(address) view returns (uint2
const tlx = new Contract(TLX, erc20abi, provider);

export const getCirculatingSupply = async () => {
const EXCLUDED_ADDRESSES = [Airdrop, Bonding, Vesting, AmmDistributor];
const EXCLUDED_ADDRESSES = [Airdrop, Bonding, GenesisLocker, Vesting, AmmDistributor];

const [airdropBalance, bondingBalance, genesisLockerBalance, vestingBalance, stakerBalance, ammBalance] =
await Promise.all(EXCLUDED_ADDRESSES.map((address) => tlx.balanceOf(address)));
const [airdropBalance, bondingBalance, genesisLockerBalance, vestingBalance, ammBalance] = await Promise.all(
EXCLUDED_ADDRESSES.map((address) => tlx.balanceOf(address))
);

const totalExcluded =
airdropBalance + bondingBalance + genesisLockerBalance + vestingBalance + stakerBalance + ammBalance;
const totalExcluded = airdropBalance + bondingBalance + genesisLockerBalance + vestingBalance + ammBalance;

return MAX_SUPPLY - bigintToNumber(totalExcluded);
};
Expand Down

0 comments on commit 8910cec

Please sign in to comment.