<!-- canonical: https://0xsimao.com/findings/trestle-deadline-argument-top-minimum -->

# Swaps should use the deadline argument on top of minimumAmountOut

Medium · Three Sigma · Modular blockchain infrastructure · 27th January 2024

Finding 3S-TR-M02 of the Trestle wTIA Bridge security review.

- Report: /reports/trestle-wtia-bridge
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-01-27-trestle.pdf

---

### Description

Swapping with block.timestamp as deadline means validators may do MEV up to the
minimumAmountOut.
https://github.com/TrestleProtocol/Audit-Contracts/blob/main/src/Trestle.sol#L441
https://github.com/TrestleProtocol/Audit-Contracts/blob/main/src/Trestle.sol#L709
https://github.com/TrestleProtocol/Audit-Contracts/blob/main/src/Trestle.sol#L727

### Status

Addressed by disabling taxes.

Disclosed by 0xSimao (https://0xsimao.com/).

---

Related findings:

- [Swapping with deadline as block.timestamp and 0 minimum amount out is vulnerable to MEV](https://0xsimao.com/findings/clip-finance-i-swapping-deadline-timestamp-mev): Clip Finance Strategies
- [Allow lenders to set a minimum amount of asset they would take for their shares](https://0xsimao.com/findings/maple-finance-ii-lenders-minimum-they-shares): Maple Withdrawal Manager
