Skip to content

Commit

Permalink
use wmul for fundsAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Jul 27, 2023
1 parent 0c54e44 commit ddf7abb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/grant-fund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { getCurrentDistributionId, getCurrentStage, loadOrCreateDistributionPeri
import { getFundingStageVotingPower, getFundingVoteId, getFundingVotingPowerUsed, getScreeningStageVotingPower, getScreeningVoteId, loadOrCreateDistributionPeriodVote } from './utils/grants/voter'
import { getTreasury, loadOrCreateGrantFund } from './utils/grants/fund'
import { loadOrCreateAccount } from './utils/account'
import { wmul } from './utils/math'

export function handleDelegateRewardClaimed(
event: DelegateRewardClaimedEvent
Expand Down Expand Up @@ -267,7 +268,7 @@ export function handleDistributionPeriodStarted(
grantFund.distributionPeriods = grantFund.distributionPeriods.concat([distributionPeriod.id])
grantFund.treasury = wadToDecimal(treasury)

distributionPeriod.fundsAvailable = wadToDecimal(treasury.times(THREE_PERCENT_BI))
distributionPeriod.fundsAvailable = wadToDecimal(wmul(treasury, THREE_PERCENT_BI))

// save entities to store
distributionPeriod.save()
Expand Down

0 comments on commit ddf7abb

Please sign in to comment.