Skip to content

Commit

Permalink
test: reward handler
Browse files Browse the repository at this point in the history
  • Loading branch information
notJoon committed Dec 27, 2024
1 parent 0cc49f7 commit 0c95310
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 2 deletions.
8 changes: 6 additions & 2 deletions launchpad/reward.gno
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import (
"gno.land/r/gnoswap/common"
)

var rewardStore = NewRewardStore() // TODO: init?
var rewardStore *RewardStore

func init() {
rewardStore = NewRewardStore()
}

// Calculator is an interface responsible for calculating project rewards.
type Calculator interface {
Expand Down Expand Up @@ -112,7 +116,7 @@ func calculateProjectReward(proj *Project, startHeight, endHeight uint64) *u256.

blocks := calcEnd - calcStart // +1?
tierReward := new(u256.Uint).Mul(blockReward, u256.NewUint(blocks))
totalReward = new(u256.Uint).Add(totalReward, tierReward)
totalReward = new(u256.Uint).Add(totalReward, tierReward) // TODO: need to check overflow?
}

return totalReward
Expand Down
Loading

0 comments on commit 0c95310

Please sign in to comment.