Vulnerability Details
The smart contract deducts a 10% protocol fee from the total ETH pot even when a game ends in a tie. This design results in players receiving less ETH than they contributed, even though there is no winner. It violates fairness expectations and undermines user trust.
Instead, the current implementation imposes a 10% fee even though no player won, effectively punishing both participants for playing to a draw.
The issue lies in the _handleTie
function:
This logic deducts the fee regardless of the game outcome, including draws.
On a tie, since no winner emerges, the entire pot should be returned equally to both players without any fee. Charging a fee in this case disincentivizes honest gameplay.
Impact
** Financial Loss**: Both players lose ETH despite the absence of a winner.
** Fairness Violation**: It creates a perception of unfairness and could be interpreted as exploitative behavior by the protocol.
** User Distrust**: Players may avoid playing or recommend against using the game, especially if their balance decreases after a draw.
** Misaligned Incentives**: Protocol fees should reward engagement or outcomes, not penalize players arbitrarily.
Tools Used
Manual Review
Recommended Mitigation Steps
Conditionally Apply the Fee
The protocol fee should be charged only when a winner exists.
On a tie, refund both players in full.
Update the _handleTie
Function
Modify the logic to:
Document Edge Cases Clearly
Document that ties incur no fees.
This improves transparency for users and developers.
Proof of Concept
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.