Blockchain applications should account for the fact that miners can manipulate timestamps within certain bounds.
The contract relies on block.timestamp
for deadline enforcement, which miners can manipulate by up to ~15 seconds, potentially affecting order timing.
Likelihood:
When orders have very short deadlines (minutes to hours)
When miners have incentive to include/exclude specific transactions
During periods of high network congestion with MEV opportunities
Impact:
Orders may expire slightly earlier or later than intended
Miners could potentially manipulate order execution timing
Minor unfairness in deadline enforcement (±15 seconds)
Miner Manipulation Scenario: This demonstrates how miners can manipulate timestamps to affect order timing.
Manipulation scenarios:
Favorable inclusion: Miner manipulates timestamp to make favorable orders execute
Unfavorable exclusion: Miner manipulates timestamp to prevent unfavorable orders
MEV opportunities: Miners coordinate timestamp manipulation with arbitrage strategies
Short deadline orders: Orders with minutes-level deadlines are most vulnerable
Network congestion: During high gas periods, miners have more manipulation incentive
Solution: Document the limitation and consider block-based deadlines for critical applications.
Why this works:
Block-based deadlines: Miners cannot manipulate block numbers as easily as timestamps
Predictable progression: Blocks advance at a more predictable rate than timestamps
Reduced manipulation: Eliminates the ±15 second timestamp manipulation window
Better for short deadlines: More reliable for time-sensitive orders
Trade-offs:
Variable block times: Block times can vary (8-20 seconds), making exact timing harder
User experience: Users think in time units, not blocks
Current implementation: May be acceptable for most use cases with longer deadlines (hours/days)
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.