The contract relies heavily on block.timestamp
for its core game mechanics (setting lastClaimTime
and checking grace periods). On Layer 2 networks like Arbitrum and Optimism, timestamp values are controlled by the sequencer and can be updated within protocol allowed bounds. This creates a severe vulnerability where players can claim the throne and potentially be declared winners in the very next block due to timestamp jumps, completely breaking the intended grace period mechanics.
The vulnerability stems from L2 sequencers' control over block timestamps and the contract's reliance on these unreliable values:
L2 Timestamp Behavior:
Arbitrum documentation explicitly states: "timing assumptions about block numbers and timestamps should be considered... unreliable in the shorter term (minutes)"
Optimism: "block.timestamp reflects the timestamp of the last L1 block ingested by the Sequencer"
Sequencers can make timestamps jump forward suddenly when catching up to L1
Likelihood: High - This is not a theoretical attack but documented behavior of L2 sequencers. Timestamp jumps happen regularly during normal L2 operation.
Impact: Critical - Players can win instantly after claiming the throne, bypassing the entire grace period mechanism that defines the game.
High severity because:
Core game mechanic (grace period) can be completely bypassed
Players can claim throne and win in consecutive blocks
Frontend/UI will show incorrect remaining time, confusing users
Breaks fundamental fairness - winner determined by L2 sequencer timing, not gameplay
Documented issue acknowledged by major L2 protocols (Arbitrum, Optimism)
No way for users to predict or defend against timestamp jumps
This scenario demonstrates how L2 timestamp behavior breaks the game:
Real-world L2 Attack Scenario:
Attacker monitors L1 for periods of high timestamp gaps
When L2 sequencer is behind, attacker claims throne
Sequencer catches up to L1 in next block, timestamp jumps forward
Attacker immediately calls declareWinner()
in same transaction
Attacker wins entire pot without waiting actual grace period
Enforce minimum grace periods per L2 documentation:
Alternative: Use block numbers instead of timestamps:
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.