Solidity

Deadline

A deadline is an expiry timestamp or block condition after which a signed action, swap, permit, or operation is no longer valid.

A deadline stops an old approval or trade from being used later than intended.

Deadline Explained in Detail

A deadline limits when an action can execute. It is common in permits, swaps, meta-transactions, and account abstraction operations.

Deadlines reduce relayer optionality and protect users from stale execution.

Smart contract example

require(block.timestamp <= deadline, "expired");

The expected comparison should match the standard or protocol design.

Deadline in Auditing

Without a deadline, an old signature or trade may remain usable indefinitely. That increases replay risk and lets relayers wait for a better moment to execute.

Auditors verify that the deadline is included in signed data and enforced before sensitive effects.

Red flags in code

  • No deadline for a time-sensitive signed action.

  • Deadline is not included in the signed digest.

  • Expired actions are accepted.

  • 0 or type(uint256).max is accepted without clear intent.

  • Deadline is checked after external effects.

How to test or review it

  • Execute at deadline - 1, exactly deadline, and deadline + 1.

  • Replay an old signature.

  • Verify the signed payload includes deadline, nonce, chain, and verifying contract.

  • Check batched and relayed paths enforce the same expiry.

  • Review whether block timestamp is acceptable for the use case.

Practice this in real audit scenarios

Definitions help, but auditors need reps. SCH turns concepts like Deadline into exploit labs, code review habits, and report-writing practice.

Start the free trial or see the full smart contract auditing course.

Sources