user can call pot::claimCut
after the owner called pot::closeContest
and calim his cut and be eligible for distrbuting remmaining rewards
If a user found this flow he will have advantage over other users how forgot to claim their cut .since he can claim his cut anytime even if the owner called pot::closeContest
.therefore the player will be pushed into the claimants array and if the owner called pot::closeContest
again he will receive another cut and the user who found the flow will recieve extra reward from the remmaining tokens even he considered inelligible according to protocl docs
ExploitSceanario
The following scenario demonstrate that player2 and player3 discovered the flaw after they forget to claim their cut and player1 and player4 forgot to claim their cut and don't know the flaw
Players = [player1, player2, player3, player4]
rewards = [400, 200, 200, 200]
totalRewards = 1000
the owner
call pot::closeContest
and recieve his cut
since there is no claimants yet the rest remain in the pot contract
player2 and player3 call pot::claimCut
and they recieve their cut and become claimants
the owner
call pot::closeContest
again to recieve anotherCut
player2 and player3 recieve more tokens since they become claimants
use the Following Poc in TestMyCut.t.sol
Don't forget to change player array to 4 players
Unfair Advanatage for users.the users who discovered this flow will claimCut any time
Manual Review + Foundry
you can add the following implementation in these functions pot::closeContes
and pot::claimCut
add a bool represent the contest status (closed or opened)
set the value of the flag to true at the end of pot::closeContest
add the following condition to pot::claimCut
to prevent claiming after closing Contest
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.