The UniswapV3Adapter and UniswapV2Adapter contracts inherit a global deadline
from BaseAdapter instead of allowing transactions to specify their own deadline values. This exposes transactions to MEV attacks, price slippage, and potential failures if the deadline is too short, reducing flexibility and security for time-sensitive trades.
The UniswapV3Adapter and UniswapV2Adapter contracts utilize a global deadline
rather than allowing each transaction to specify its own deadline
. In the executeSwapExactInputSingle
and executeSwapExactInput
functions, the deadline
is taken from BaseAdapter
contract instead of being explicitly provided in each trade. Uniswap’s native interface supports setting a per-transaction deadline, ensuring users can define a custom validity period for each trade.
src/utils/dex-adapters/BaseAdapter.sol:setDeadline#L153-L162
src/utils/dex-adapters/UniswapV2Adapter.sol:executeSwapExactInput#L131
src/utils/dex-adapters/UniswapV2Adapter.sol:executeSwapExactInputSingle#L101
src/utils/dex-adapters/UniswapV3Adapter.sol:executeSwapExactInput#L136
src/utils/dex-adapters/UniswapV3Adapter.sol:executeSwapExactInputSingle#L106
MEV Exploitation Risk: If the global deadline
is too long, transactions may remain in the mempool for extended periods, making them susceptible to MEV attacks, such as front-running or sandwich attacks.
Price Slippage Risk: A long deadline
increases the likelihood of significant price fluctuations before execution, potentially leading to worse trade execution than expected.
Reduced User Control: Users are unable to set specific deadlines for different transactions, reducing flexibility in executing time-sensitive trades.
Transaction Failures: If the global deadline
is too short, valid trades may fail unnecessarily.
Manual Code Review
It is recommended to add a deadline
parameter to SwapExactInputSinglePayload
and and SwapExactInputPayload
to use the transaction-specific deadline
in uniswap calls. If a transaction-specific deadline
is not provided, fallback to a reasonable default instead of a global value.
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.