In the original contract, the receive() function was defined but left empty:
This allows ETH to be sent directly to the contract without triggering any logic like claiming the throne. Players could accidentally send ETH and lose funds without actually participating in the game.
This breaks the core expectation: sending ETH should attempt to claim the throne, as that is the central mechanic of the game.
By default, most wallets (e.g., MetaMask) allow sending ETH directly, and users might assume doing so interacts with the game. Since no logic was executed, the ETH would simply go into the pot without updating the king or starting a new round.
The receive() function was modified to automatically call claimThrone() when ETH is received:
Medium: Many users interact with smart contracts through wallet UIs or simple sends.
High on mobile or less technical users who don’t know they must call claimThrone() directly.
Medium: Users may lose ETH unintentionally without gaining king status.
Leads to poor UX and breaks trust in the protocol.
Automatically call claimThrone() inside the receive() function. This ensures all ETH transfers behave as expected and preserve the integrity of the game's mechanics.
There is no reason for a user to directly send ETH or anything to this contract. Basic user mistake, info, invalid according to CH Docs.
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.