fundContest should transfer totalRewards to a Pot once.
Nothing records that a Pot is already funded, so every call transfers totalRewards again. The Pot accounts only for totalRewards (remainingRewards), so closePot never distributes the surplus, and neither contract can withdraw it.
Likelihood:
When the admin retries a funding transaction that looked like it failed, or passes the wrong index (indices are positional, and the admin can easily confuse contests).
Impact:
The whole second transfer (totalRewards) is permanently lost to the admin.
The Pot is funded twice. Both players claim, and the Pot is closed. 100 tokens remain in the Pot with no way to recover them.
The test uses the setup of the existing test/TestMyCut.t.sol.
Add mapping to keep funded contests for check. Add error type "ContestManager__AlreadyFunded"
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.