The Game::claimThrone()
function lacks logic to validate or refund excess ETH sent by the caller. It only checks if the sent amount is >= claimFee() but does not enforce exact match or return the excess.
The Game::claimThrone()
function does not check if the user has overpaid. Any ETH sent above the Game::claimFee
is silently accepted and added to the pot
, which may not be the intended user experience.
This could confuse users and lead to accidental overpayments. If this behavior is not intentional, it should be mitigated.
User Overpayment: Users might mistakenly send more ETH than required, expecting a refund.
Poor UX: Lack of feedback or refund can lead to user dissatisfaction.
Implied Griefing: A malicious dApp frontend or social engineering could trick users into overpaying.
Accounting Confusion: Pot balance may include ETH not intentionally contributed, complicating audits or payouts.
Option 1: Enforce Exact ETH Match
Require the sender to send exactly the required fee:
Pros:
Clean accounting pot only grows from actual fees.
Prevents accidental overpayments.
More predictable for off-chain UIs or integrations.
Cons:
Might cause unnecessary revert if the user accidentally overpays.
Can break composability with contracts that can't control exact ETH amounts.
Breaks with sendValue() patterns or fallback-based UX.
Option 2: Accept overpayments but refund the difference:
Pros:
Flexible UX users can overpay without losing funds.
Safer for integrations, wallets, or bundlers.
Maintains predictable pot growth.
Cons:
Adds external call risk (reentrancy-safe in this case since state updated before call, but still needs attention).
Refunds might fail if msg.sender is a contract with fallback issues (can be mitigated with pull-based refunds if needed).
Silent loss of funds for users who accidentally overpay.
No event logs for excess ETH tracking or debugging is difficult.
Potential griefing vector: An attacker can inflate the pot size by repeatedly overpaying, making reclaiming economically infeasible for others (soft DoS).
Trust issues for wallet integrations or relayers expecting precise fee mechanics.
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.