From 29892d8294dab521898d90010350034b66d86541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Mendes?= Date: Mon, 7 Aug 2023 14:03:55 -0300 Subject: [PATCH] hotfix zero division error --- networks.yaml | 3 +++ src/voting.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/networks.yaml b/networks.yaml index 6aeace4..8d5b7d1 100644 --- a/networks.yaml +++ b/networks.yaml @@ -168,6 +168,9 @@ optimism: startBlock: 41872979 gnosis: network: gnosis + graft: + block: 29344803 + base: QmbF9ybzefDh29hdERkY9VxwMrvA15U5sgVcnPJxDpEwbC EventEmitter: address: "0xd8bf95b44772213905a8a74881862347acbabc48" startBlock: 26892431 diff --git a/src/voting.ts b/src/voting.ts index 79bd813..637d8d6 100644 --- a/src/voting.ts +++ b/src/voting.ts @@ -7,7 +7,7 @@ import { import { UserBalToChain } from './types/OmniVotingEscrow/omniVotingEscrow'; import { UserBalFromChain } from './types/OmniVotingEscrowChild/omniVotingEscrowChild'; import { Deposit, Supply, Withdraw } from './types/VotingEscrow/votingEscrow'; -import { LOCK_MAXTIME, ZERO_BD } from './utils/constants'; +import { LOCK_MAXTIME, ZERO, ZERO_BD } from './utils/constants'; import { getLockSnapshotId, getOmniVotingEscrowId, @@ -90,6 +90,8 @@ export function handleSupply(event: Supply): void { } export function handleUserBalFromChain(event: UserBalFromChain): void { + if (event.params.userPoint.slope.equals(ZERO)) return; + let userAddress = event.params.user; createUserEntity(userAddress);