Skip to content

Commit

Permalink
fix: Exclude expired and not started airdrops from total voting power
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Nov 29, 2024
1 parent 41ce005 commit 45536ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useSafeTokenAllocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ const computeVotingPower = (
lockingContractBalance: string,
): BigNumber => {
const tokensInVesting = validVestingData.reduce(
(acc, data) => acc.add(data.amount).sub(data.amountClaimed),
(acc, data) =>
data.isExpired || data.startDate > Math.floor(Date.now() / 1000)
? acc
: acc.add(data.amount).sub(data.amountClaimed),
BigNumber.from(0),
)

Expand Down

0 comments on commit 45536ab

Please sign in to comment.