diff --git a/functions/src/constants.ts b/functions/src/constants.ts index 3fbef97..2515b2b 100644 --- a/functions/src/constants.ts +++ b/functions/src/constants.ts @@ -18,6 +18,7 @@ export const Vesting = "0xebd707214ea4bae19e826f14ec2a82d1b44a75f3"; export const ZapSwap = "0x461aB832D11A7B18CC444B7C92a1E2B8877A327A"; export const VelodromePool = "0x6eA20Dbc05f58ED607c374e545BFb402d5796770"; export const AmmDistributor = "0x9d27E96B3564e51422C1f0592f42b3934f2bd056"; +export const VelodromeVoterAutomation = "0x3B413D27d373bC04e196b59E117E07842258007d"; // Endpoints export const OPTIMISM_RPC = "https://mainnet.optimism.io/"; diff --git a/functions/src/supply.ts b/functions/src/supply.ts index 54243b4..b5e0c71 100644 --- a/functions/src/supply.ts +++ b/functions/src/supply.ts @@ -1,5 +1,15 @@ import { Contract, Interface, JsonRpcProvider } from "ethers"; -import { Airdrop, AmmDistributor, Bonding, GenesisLocker, MAX_SUPPLY, OPTIMISM_RPC, TLX, Vesting } from "./constants"; +import { + Airdrop, + AmmDistributor, + Bonding, + GenesisLocker, + MAX_SUPPLY, + OPTIMISM_RPC, + TLX, + VelodromeVoterAutomation, + Vesting, +} from "./constants"; import bigintToNumber from "./helpers/bigint-to-number"; @@ -10,14 +20,14 @@ const lockerAbi = new Interface(["function totalStaked() view returns (uint256)" const locker = new Contract(GenesisLocker, lockerAbi, provider); export const getCirculatingSupply = async () => { - const EXCLUDED_ADDRESSES = [Airdrop, Bonding, GenesisLocker, Vesting, AmmDistributor]; + const EXCLUDED_ADDRESSES = [Airdrop, Bonding, GenesisLocker, Vesting, AmmDistributor, VelodromeVoterAutomation]; - const [airdropBalance, bondingBalance, genesisLockerBalance, vestingBalance, ammBalance, totalStaked] = + const [airdropBalance, bondingBalance, genesisLockerBalance, vestingBalance, ammBalance, voterBalance, totalStaked] = await Promise.all([...EXCLUDED_ADDRESSES.map((address) => tlx.balanceOf(address)), locker.totalStaked()]); const lockedAmount = genesisLockerBalance - totalStaked; - const totalExcluded = airdropBalance + bondingBalance + lockedAmount + vestingBalance + ammBalance; + const totalExcluded = airdropBalance + bondingBalance + lockedAmount + vestingBalance + ammBalance + voterBalance; return MAX_SUPPLY - bigintToNumber(totalExcluded); };