Skip to content
medium MEV / Ordering No SWC entry CWE-841

Missing Deadline on Swaps / Stale Execution

SAFE-0059 MEV / Ordering Checked automatically by the scanner
1

What goes wrong

Using block.timestamp as the deadline (or no deadline) lets a transaction sit in the mempool and execute much later at an unfavorable price.

2

How to fix it

the pattern that is safe
require(block.timestamp <= deadline, "expired");
router.swap(..., to, deadline);
Pass an explicit deadline from the caller.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0059 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs