The RockPaperScissors::withdrawFees functions does not account for funds sent directly to the contract. As the contract has receive() function the contract can directly receive funds, however, these funds are not added to accumlatedFees and therefore become stuck in the contract and cannot be withdrawn by the owner or sender resulting in a loss of funds.
Funds are lost whenever funds are sent directly RockPaperScissors contract, as there is no function to withdraw these funds. The withdrawFees function will only withdraw a maximum amount of accumulatedFees, however, this variable is not updated when funds are directly transferred to the contract.
The PoC above demonstrates that a supposed maximal withdrawal does not affect the tokens directly transferred to the contract and 5 ether remains.
Funds are lost whenever tokens are directly transferred to the RockPaperScissors contract.
Manual review
Add a withdrawMax function with onlyOwner permission that withdraws the entire holdings of the contract address(this).balance.
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.