Snowman Merkle Airdrop

First Flight #42
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: medium
Likelihood: low
Invalid

Timestamp Manipulation via block.timestamp

Root + Impact

require(block.timestamp >= startTime, "Too early");
vm.warp(block.timestamp + 1 weeks); // in tests
In production, any on‑chain time comparisons can be manipulated by miners. If airdrop claim windows or rate limits hinge on exact timestamps, an attacker in collusion with a miner could gain early or repeated access.

Des

Critical logic (minting intervals, vesting, claim windows) relies directly on block.timestamp, which miners can skew by up to ~15 seconds.

Risk Explanation

Miners can manipulate block.timestamp by up to ~15 seconds to pass or fail time-dependent checks prematurely or late, enabling:
Early or multiple claims of time-locked rewards or airdrops
Circumventing rate limits or vesting schedules relying on exact timestamps

Likelihood

Likelihood Explanation
Possible – Requires miner cooperation but is a known attack pattern for time‑sensitive contracts.

Impact

Medium – While small skews rarely break weekly limits, they can be leveraged in competitive or high‑value mint windows (e.g., NFT drops) to gain slight advantages.

Proof of Concept

A miner could include your transaction in a block with a timestamp +13 s ahead, bypassing a require(block.timestamp > deadline) check by submitting just before deadline.

Recommended Mitigation

Use block numbers instead of timestamps for coarse intervals: require(block.number >= startBlock).

If timestamps are needed, add a slack window: require block.timestamp + 15 seconds >= deadline.

Document acceptable skew and test for boundary conditions.

- remove this code
require(block.timestamp >= startTime, "Too early");
vm.warp(block.timestamp + 1 weeks);
+ add this code
// Example using blocks (~15 s per block)
uint256 public startBlock = block.number + 40320; // ~1 week
require(block.number >= startBlock, "Too early");
Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.