Skip to content

Commit

Permalink
chore: add comment on votes being positive
Browse files Browse the repository at this point in the history
  • Loading branch information
danielattilasimon committed Jan 1, 2025
1 parent a5f9f03 commit 8db397c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/BribeInitiative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ contract BribeInitiative is IInitiative, IBribeInitiative {
require(totalLQTYAllocation.lqty > 0, "BribeInitiative: total-lqty-allocation-zero");
require(lqtyAllocation.lqty > 0, "BribeInitiative: lqty-allocation-zero");

// `Governance` guarantees that `votes` evaluates to 0 or greater for each initiative at the time of allocation.
// Since the last possible moment to allocate within this epoch is 1 second before `epochEnd`, we have that:
// - `lqtyAllocation.lqty > 0` implies `votes > 0`
// - `totalLQTYAllocation.lqty > 0` implies `totalVotes > 0`

uint256 epochEnd = EPOCH_START + _epoch * EPOCH_DURATION;
uint256 totalVotes = _lqtyToVotes(totalLQTYAllocation.lqty, epochEnd, totalLQTYAllocation.offset);
uint256 votes = _lqtyToVotes(lqtyAllocation.lqty, epochEnd, lqtyAllocation.offset);
Expand Down

0 comments on commit 8db397c

Please sign in to comment.