Description: The withdrawFees() function allows the admin to withdraw protocol fees up to the value of accumulatedFees
. However, it does not account for any extra ETH that may have been sent to the contract accidentally or otherwise (e.g. through direct transfers or self-destructs).
Impact: Any ETH not reflected in accumulatedFees
becomes inaccessible and permanently locked.
Proof of Concept: Run the following test in RockPaperScissorsTest.t.sol
...
Send ETH directly to the contract (simulating accidental transfer)
Assert that ETH was received by contract
Admin tries to withdraw ETH, expecting failure
Recommended Mitigation:
Consider adding a parameter where admin can withdraw all fees through address(this).balance
instead of relying on accumulatedFees
.
ETH sent directly to the contract via the receive function or after a canceled game becomes permanently locked
ETH sent directly to the contract via the receive function or after a canceled game becomes permanently locked
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.