The _handleTie() function
contains an integer division rounding error that causes permanent loss of ETH during tie resolution. This occurs when refunding players after deducting protocol fees from the total pot.
Location: _handleTie()
function in RockPaperScissors.sol
Vulnerable Code:
PoC Scenario
1) Game Setup:
Patrick bets: 52.5 ETH
Dacian bets: 52.5 ETH
Total pot: 105 ETH
2) Tie Resolution
3) Result:
Patrick receives: 47 ETH
Dacian receives: 47 ETH
Contract retains: 0.5 ETH (94 ETH distributed from 94.5 ETH remaining)
Progressive ETH accumulation in contract (0.5 ETH lost per tie at these stakes)
Direct financial loss to players (violates exact refund principle)
Manual Calculation Review
or use Fixed-Point Arithmetic such as mulDiv
The tie-handling logic loses one wei due to integer division
The tie-handling logic loses one wei due to integer division
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.