Skip to content

Commit

Permalink
Merge pull request #38 from pooltogether/invalid-tier-claim
Browse files Browse the repository at this point in the history
Fix InvalidTier check
  • Loading branch information
dylandesrosier authored Jun 30, 2023
2 parents 9c9fd20 + b83a1f7 commit a515710
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PrizePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ contract PrizePool is TieredLiquidityDistributor {
if (_lastCompletedDrawId == 0) {
revert NoCompletedDraw();
}
if (_tier > _numberOfTiers) {
if (_tier >= _numberOfTiers) {
revert InvalidTier(_tier, _numberOfTiers);
}

Expand Down
9 changes: 9 additions & 0 deletions src/abstract/TieredLiquidityDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,20 @@ contract TieredLiquidityDistributor {
}

/// @notice Returns the estimated number of prizes for the given tier
/// @param _tier The tier to retrieve
/// @return The estimated number of prizes
function getTierPrizeCount(uint8 _tier) external view returns (uint32) {
return _getTierPrizeCount(_tier, numberOfTiers);
}

/// @notice Returns the estimated number of prizes for the given tier and number of tiers
/// @param _tier The tier to retrieve
/// @param _numberOfTiers The number of tiers, should match the current number of tiers
/// @return The estimated number of prizes
function getTierPrizeCount(uint8 _tier, uint8 _numberOfTiers) external view returns (uint32) {
return _getTierPrizeCount(_tier, _numberOfTiers);
}

/// @notice Returns the number of available prizes for the given tier
/// @param _tier The tier to retrieve
/// @param _numberOfTiers The number of tiers, should match the current number of tiers
Expand Down

0 comments on commit a515710

Please sign in to comment.