Root Cause: No prohibition against setting platform fee to 100% → Impact: All incoming deposits go to platform, pot never grows, participants cannot profit and may even lose ETH.
WHY WOULD ANYONE TRUST THE OWNER: It's a Game something similar to a gamble. So we can't expect the owner to be fair. The owner can change the rules at any time, so we can't expect the game to be fair.
The claimThrone()
and updatePlatformFeePercentage()
functions lack safeguards against a 100% platform fee. When the owner sets platformFeePercentage = 100
, the calculation:
Likelihood: Medium
causes all of each claimant’s ETH to be siphoned into platformFeesBalance
, leaving the pot
untouched. Subsequent winners receive nothing beyond their original stake (if even that), breaking the game’s economic incentive. Participants pay ETH to play but see zero return, effectively losing 100% of their stake.
isValidPercentage
only checks ≤ 100
, not < 100
.
At 100%, amountToPot
is always zero.
Pot stagnates, making the game unprofitable or even a loss for participants.
Impact: Medium
Zero Incentive: No growth of the pot, participants cannot win anything beyond their stake (and in fact lose net ETH when fee increases).
Loss of Funds: Players pay full claim fee into platformFeesBalance
and receive nothing on withdrawal.
Game Breakdown: The core economic model collapses—no one will join if the pot never grows.
Griefing Risk: Malicious or mistaken owner can cripple the game at any time by setting fee to 100%.
Tools Used:
Foundry Test Suite
Chat-GPT AI Assistance (Report Grammar Check & Improvements)
Manual Review
step 1: go to test/Game.t.sol
file
step 2: paste the above code ⬆️
step 3: run the test suite
step 4: See the Output
Scenario:
Initial Round: Player2 claims throne with 1 ETH. Platform collects 100% fee -> platformFeesBalance += 1 ETH
, pot += 0
.
Subsequent Round: Player1 attempts to claim with the then-increased fee (originally 1 ETH -> say 1.1 ETH); again 100% goes to platform, pot remains empty.
Declare Winner: After grace period, Player1 calls declareWinner()
. Even though they are last king, pendingWinnings[currentKing] += pot
yields zero. Player1 withdraws nothing - 100% loss of their 1.1 ETH stake.
Prevent 0-Payout Scenarios
Add a runtime check in claimThrone()
:
Adjust Percentage Validator
Change isValidPercentage
to enforce < 100
instead of ≤ 100
.
Don't allow to update platform fee in the middle of the game
- Add a modifier to prevent changing the platform fee while the game is active:
```solidity
// or use existing one
```
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.