MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Summary

in certain conditions transaction will run out of gas and revert, causing DoS

Vulnerability Details

in Pot.sol, lines 58-60

if there are too many claimants, transaction will run out of gas and revert, causing DoS

function closePot() external onlyOwner {
if (block.timestamp - i_deployedAt < 90 days) {
revert Pot__StillOpenForClaim();
}
if (remainingRewards > 0) {
uint256 managerCut = remainingRewards / managerCutPercent;
i_token.transfer(msg.sender, managerCut);
uint256 claimantCut = (remainingRewards - managerCut) / i_players.length;
// @audit bad practice! if there are too many claimants, the transaction will run out of gas and revert
for (uint256 i = 0; i < claimants.length; i++) {
_transferReward(claimants[i], claimantCut);
}
}

Impact

Pot can never be closed

Tools Used

brain

Recommendations

make another claim mechanism for remaining tokens, this time for claimants only

Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Unbound loop in closePot

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.