After the refund, game is broken since funds cannot be sent to the winner.
After the refund, selectWinnter()
is broken.
refund
doesn't change the array length, but replaces the valid player with zero address.
selectWinner
method uses the players.length
to calculate the totalAmountCollected
, and if the refund has happened, contract will have less funds available than it's calculated in totalAmountCollected
, and then winner.call{value: prizePool}("");
will always fail until the contract has extra gas for the deleted players.
Smart contract is broken and unplayable, once at least one user has been refunded.
Either remove the element from the array, or calculate fees from all non-zero addresses at totalAmountCollected
. Later one seems more gas-efficient, since no array modifications are required.
Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High
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.