Owner might mistakenly fund a contest that has already ended , causing them to lose out on their funds
In the ContestManager
contract , owner has functionality to close an existing pot. But after a pot closes , owner can still fund that contract (using ContestManager::fundContest
). The owner would obviously not do this on purpose , but if they do , they have no way to get all those funds back. Only thing they can do is call the Pot::closePot
function. But this function only gives the owner 10% of the total rewards , so the owner will lose out on 90% of their funds.
One more problem is that Pot::claimCut
has no controls to prevent users from claiming if the pot has ended. If the user didn't claim before owner called closePot
, then this user shouldn't be able to claim afterwards. In normal circumstances when the pot is funded only once , this functionality is preserved as even if this user tries to claim , claimCut
would revert as the contract wouldn't have funds(actually it would due to another bug in closePot
, but let's ignore that for now). Now if the owner funds the pot again , this user can claim. Now the contract balance is less than Pot::i_totalRewards
, and now if the owner calls closePot
, they will get less than 10% if the total rewards , which is even worse
This description got a little messy since 3 bugs are into play , but to summarise:
The owner may accidently fund a pot that has already closed , leading to them loosing 90% or more of the funded amount.
Owner will loose money if they fund a closed pot.
Proof of Concepts
Owner creates and funds a pot
Player 1 claims his reward
Owner closes the pot
Owner funds it again
Player 2 claims
Owner closes the pot again but doesnt get all of their funds back
Place this into TestMyCut.t.sol
Manual Review , Foundry Tests
Keep track of which contests have ended , so the owner cannot fund a closed pot.
Make a mapping of address to boolean for the same.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.