Attacker can make fee amount stuck in protocol by send 1 wei to protocol.
Function withdrawFees()
use condition require(address(this).balance == uint256(totalFees)
to make sure only withdraw fee after players receive reward. But this condition will not correct if attacker try to send although only 1 wei to protocol by selfdestruct
method, then condition will always false and fee will stuck in protocol.
Attacker will deploy a selfdestruct as below:
After deploy contract, attacker deposit 1 wei and call attack()
function to trigger selfdestruct
, then contract attack will be destroy and send 1 wei to protocol without make revert.
Step attack as test below:
Fee will stuck in protocol forever
Manual review / Foundry
Use a variable such as gameEnd
= true updated before send reward to players in condition check to make sure game end to withdraw fund.
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.