diff --git a/abis/VoterABI.json b/abis/VoterABI.json new file mode 100644 index 0000000..395b946 --- /dev/null +++ b/abis/VoterABI.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"},{"internalType":"address","name":"_ve","type":"address"},{"internalType":"address","name":"_factoryRegistry","type":"address"},{"internalType":"address","name":"_v1Factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyVotedOrDeposited","type":"error"},{"inputs":[],"name":"DistributeWindow","type":"error"},{"inputs":[],"name":"FactoryPathNotApproved","type":"error"},{"inputs":[],"name":"GaugeAlreadyKilled","type":"error"},{"inputs":[],"name":"GaugeAlreadyRevived","type":"error"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"GaugeDoesNotExist","type":"error"},{"inputs":[],"name":"GaugeExists","type":"error"},{"inputs":[{"internalType":"address","name":"_gauge","type":"address"}],"name":"GaugeNotAlive","type":"error"},{"inputs":[],"name":"InactiveManagedNFT","type":"error"},{"inputs":[],"name":"MaximumVotingNumberTooLow","type":"error"},{"inputs":[],"name":"NonZeroVotes","type":"error"},{"inputs":[],"name":"NotAPool","type":"error"},{"inputs":[],"name":"NotApprovedOrOwner","type":"error"},{"inputs":[],"name":"NotEmergencyCouncil","type":"error"},{"inputs":[],"name":"NotGovernor","type":"error"},{"inputs":[],"name":"NotMinter","type":"error"},{"inputs":[],"name":"NotWhitelistedNFT","type":"error"},{"inputs":[],"name":"NotWhitelistedToken","type":"error"},{"inputs":[],"name":"SameValue","type":"error"},{"inputs":[],"name":"SpecialVotingWindow","type":"error"},{"inputs":[],"name":"TooManyPools","type":"error"},{"inputs":[],"name":"UnequalLengths","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroBalance","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalWeight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Abstained","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"gauge","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DistributeReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"poolFactory","type":"address"},{"indexed":true,"internalType":"address","name":"votingRewardsFactory","type":"address"},{"indexed":true,"internalType":"address","name":"gaugeFactory","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"address","name":"bribeVotingReward","type":"address"},{"indexed":false,"internalType":"address","name":"feeVotingReward","type":"address"},{"indexed":false,"internalType":"address","name":"gauge","type":"address"},{"indexed":false,"internalType":"address","name":"creator","type":"address"}],"name":"GaugeCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gauge","type":"address"}],"name":"GaugeKilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gauge","type":"address"}],"name":"GaugeRevived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"reward","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NotifyReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalWeight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Voted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"whitelister","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"bool","name":"_bool","type":"bool"}],"name":"WhitelistNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"whitelister","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"bool","name":"_bool","type":"bool"}],"name":"WhitelistToken","type":"event"},{"inputs":[{"internalType":"address[]","name":"_bribes","type":"address[]"},{"internalType":"address[][]","name":"_tokens","type":"address[][]"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claimBribes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_fees","type":"address[]"},{"internalType":"address[][]","name":"_tokens","type":"address[][]"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claimFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolFactory","type":"address"},{"internalType":"address","name":"_pool","type":"address"}],"name":"createGauge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_mTokenId","type":"uint256"}],"name":"depositManaged","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_finish","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyCouncil","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochGovernor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"epochNext","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"epochStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"epochVoteEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"epochVoteStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"factoryRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"gaugeToBribe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"gaugeToFees","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"gauges","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_minter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAlive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isGauge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isWhitelistedNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelistedToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_gauge","type":"address"}],"name":"killGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastVoted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxVotingNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"poke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolForGauge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolVote","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"reset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gauge","type":"address"}],"name":"reviveGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_council","type":"address"}],"name":"setEmergencyCouncil","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_epochGovernor","type":"address"}],"name":"setEpochGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_governor","type":"address"}],"name":"setGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxVotingNum","type":"uint256"}],"name":"setMaxVotingNum","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_gauge","type":"address"}],"name":"updateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"updateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"}],"name":"updateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"usedWeights","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"v1Factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ve","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address[]","name":"_poolVote","type":"address[]"},{"internalType":"uint256[]","name":"_weights","type":"uint256[]"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"votes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"weights","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_bool","type":"bool"}],"name":"whitelistNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_bool","type":"bool"}],"name":"whitelistToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdrawManaged","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/schema.graphql b/schema.graphql index 3bda3d6..2d6b68b 100644 --- a/schema.graphql +++ b/schema.graphql @@ -25,6 +25,7 @@ type LiquidityPoolAggregator { totalEmissions: BigInt! @config(precision: 76) # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base) totalEmissionsUSD: BigInt! @config(precision: 76) # total emissions for the pool in USD totalBribesUSD: BigInt! @config(precision: 76) # total bribes for the pool in USD + gaugeIsAlive: Boolean! # whether the gauge is alive lastUpdatedTimestamp: Timestamp! # timestamp of last update lastSnapshotTimestamp: Timestamp! # timestamp of last snapshot } @@ -58,6 +59,7 @@ type LiquidityPoolAggregatorSnapshot { totalEmissions: BigInt! @config(precision: 76) # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base) totalEmissionsUSD: BigInt! @config(precision: 76) # total emissions for the pool in USD totalBribesUSD: BigInt! @config(precision: 76) # total bribes for the pool in USD + gaugeIsAlive: Boolean! # whether the gauge is alive timestamp: Timestamp! # timestamp of last update } diff --git a/src/EventHandlers/CLFactory.ts b/src/EventHandlers/CLFactory.ts index b6806b3..b99426e 100644 --- a/src/EventHandlers/CLFactory.ts +++ b/src/EventHandlers/CLFactory.ts @@ -85,6 +85,7 @@ CLFactory.PoolCreated.handlerWithLoader({ totalEmissions: 0n, totalEmissionsUSD: 0n, totalBribesUSD: 0n, + gaugeIsAlive: false, lastUpdatedTimestamp: new Date(event.block.timestamp * 1000), lastSnapshotTimestamp: new Date(event.block.timestamp * 1000), }; diff --git a/src/EventHandlers/PoolFactory.ts b/src/EventHandlers/PoolFactory.ts index 064ae90..5fd6655 100644 --- a/src/EventHandlers/PoolFactory.ts +++ b/src/EventHandlers/PoolFactory.ts @@ -77,6 +77,7 @@ PoolFactory.PoolCreated.handlerWithLoader({ totalBribesUSD: 0n, totalVotesDeposited: 0n, totalVotesDepositedUSD: 0n, + gaugeIsAlive: false, lastUpdatedTimestamp: new Date(event.block.timestamp * 1000), lastSnapshotTimestamp: new Date(event.block.timestamp * 1000), }; diff --git a/src/EventHandlers/Voter.ts b/src/EventHandlers/Voter.ts index f7202d9..8af4f44 100644 --- a/src/EventHandlers/Voter.ts +++ b/src/EventHandlers/Voter.ts @@ -15,19 +15,48 @@ import { updateLiquidityPoolAggregator } from "../Aggregators/LiquidityPoolAggre import { getErc20TokenDetails } from "../Erc20"; import Web3 from "web3"; import ERC20GaugeABI from "../../abis/ERC20.json"; +import VoterABI from "../../abis/VoterABI.json"; const { getPoolAddressByGaugeAddress, addRewardAddressDetails } = poolLookupStoreManager(); -// Fetch the number of tokens deposited in the gauge contract. -async function getTokensDeposited(rewardTokenAddress: string, gaugeAddress: string, eventChainId: number): Promise { +/** + * Fetches the historical balance of reward tokens deposited in a gauge contract at a specific block. + * + * @param rewardTokenAddress - The Ethereum address of the reward token contract (ERC20) + * @param gaugeAddress - The Ethereum address of the gauge contract where tokens are deposited + * @param blockNumber - The block number to query the balance at + * @param eventChainId - The chain ID of the network where the contracts exist + * @returns A promise that resolves to a BigInt representing the number of tokens deposited + * @throws Will throw an error if the RPC call fails or if the contract interaction fails + * @remarks Returns 0 if the balance call fails or returns undefined + */ +async function getTokensDeposited(rewardTokenAddress: string, gaugeAddress: string, blockNumber: number, eventChainId: number): Promise { const rpcURL = CHAIN_CONSTANTS[eventChainId].rpcURL; const web3 = new Web3(rpcURL); const contract = new web3.eth.Contract(ERC20GaugeABI, rewardTokenAddress); - const tokensDeposited = await contract.methods.balanceOf(gaugeAddress).call(); + const tokensDeposited = await contract.methods.balanceOf(gaugeAddress).call({}, blockNumber); return BigInt(tokensDeposited?.toString() || '0'); } +/** + * Checks if a gauge contract is still active by calling its isAlive() method at a specific block. + * + * @param voterAddress - The Ethereum address of the voter contract + * @param gaugeAddress - The Ethereum address of the gauge contract to check + * @param blockNumber - The block number to query the status at + * @param eventChainId - The chain ID of the network where the contracts exist + * @returns A promise that resolves to a boolean indicating if the gauge is active (true) or inactive (false) + * @throws Will throw an error if the RPC call fails or if the contract interaction fails + */ +async function getIsAlive(voterAddress: string, gaugeAddress: string, blockNumber: number, eventChainId: number): Promise { + const rpcURL = CHAIN_CONSTANTS[eventChainId].rpcURL; + const web3 = new Web3(rpcURL); + const contract = new web3.eth.Contract(VoterABI, voterAddress); + const isAlive: boolean = await contract.methods.isAlive(gaugeAddress).call({}, blockNumber); + return isAlive; +} + Voter.Voted.handler(async ({ event, context }) => { const entity: Voter_Voted = { id: `${event.chainId}_${event.block.number}_${event.logIndex}`, @@ -92,8 +121,16 @@ Voter.DistributeReward.handlerWithLoader({ const rewardTokenInfo = CHAIN_CONSTANTS[event.chainId].rewardToken(event.block.number); const rewardTokenAddress = rewardTokenInfo.address; + let isAlive: boolean = false; + + try { + isAlive = await getIsAlive(event.srcAddress, event.params.gauge, event.block.number, event.chainId); + } catch (error) { + context.log.warn(`Error getting isAlive for gauge ${event.params.gauge}: ${error}`); + } + try { - tokensDeposited = await getTokensDeposited(rewardTokenAddress, event.params.gauge, event.chainId); + tokensDeposited = await getTokensDeposited(rewardTokenAddress, event.params.gauge, event.block.number, event.chainId); } catch (error) { context.log.warn(`Error getting tokens deposited for gauge ${event.params.gauge}: ${error}`); } @@ -118,12 +155,12 @@ Voter.DistributeReward.handlerWithLoader({ ), ]); - return { currentLiquidityPool, rewardToken, tokensDeposited }; + return { currentLiquidityPool, rewardToken, tokensDeposited, isAlive }; }, handler: async ({ event, context, loaderReturn }) => { if (loaderReturn) { - const { currentLiquidityPool, rewardToken, tokensDeposited } = loaderReturn; + const { isAlive, currentLiquidityPool, rewardToken, tokensDeposited } = loaderReturn; // Dev note: Assumption here is that the GaugeCreated event has already been indexed and the Gauge entity has been created // Dev note: Assumption here is that the reward token (VELO for Optimism and AERO for Base) entity has already been created at this point @@ -165,6 +202,8 @@ Voter.DistributeReward.handlerWithLoader({ currentLiquidityPool.totalEmissionsUSD + normalizedEmissionsAmountUsd, lastUpdatedTimestamp: new Date(event.block.timestamp * 1000), + gaugeAddress: event.params.gauge, + gaugeIsAlive: isAlive, }; // Update the LiquidityPoolEntity in the DB diff --git a/test/EventHandlers/Pool/common.ts b/test/EventHandlers/Pool/common.ts index 1dfc5a6..b7947ab 100644 --- a/test/EventHandlers/Pool/common.ts +++ b/test/EventHandlers/Pool/common.ts @@ -48,6 +48,7 @@ export function setupCommon() { totalEmissions: 1n, totalEmissionsUSD: 1n * TEN_TO_THE_18_BI, totalBribesUSD: 1n * TEN_TO_THE_18_BI, + gaugeIsAlive: true, }; return { diff --git a/test/EventHandlers/Voter.test.ts b/test/EventHandlers/Voter.test.ts index 65eabec..2750198 100644 --- a/test/EventHandlers/Voter.test.ts +++ b/test/EventHandlers/Voter.test.ts @@ -112,9 +112,10 @@ describe("Voter Events", () => { * @see {@link ../../.cache/guagetopool-10.json} for a mapping between gauge and pool that exists. */ const chainId = 10; // Optimism + const voterAddress = "0x41C914ee0c7E1A5edCD0295623e6dC557B5aBf3C"; const poolAddress = "0x478946BcD4a5a22b316470F5486fAfb928C0bA25"; const gaugeAddress = "0xa75127121d28a9bf848f3b70e7eea26570aa7700"; - const blockNumber = 105896881; + const blockNumber = 128357873; const rewardTokenInfo = CHAIN_CONSTANTS[chainId].rewardToken(blockNumber); const rewardTokenAddress = rewardTokenInfo.address; @@ -134,6 +135,7 @@ describe("Voter Events", () => { }, chainId: chainId, logIndex: 0, + srcAddress: voterAddress }, }); @@ -226,6 +228,11 @@ describe("Voter Events", () => { expect(updatedPool?.totalVotesDepositedUSD).to.not.equal(0n , "Should have USD value for votes deposited"); expect(updatedPool?.lastUpdatedTimestamp).to.deep.equal(new Date(1000000 * 1000)); }); + it("should update the liquidity pool aggregator with gauge is alive data", () => { + const updatedPool = resultDB.entities.LiquidityPoolAggregator.get(poolAddress); + expect(updatedPool).to.not.be.undefined; + expect(updatedPool?.gaugeIsAlive).to.be.true; + }); }); }); });