The UniswapSettlement::swapExactIn() and UniswapSettlement::swapExactOut() does not set an expiration deadline, resulting in losing a lot of funds when swapping tokens.
The deadline parameter in the swapExactIn() and swapExactOut() is set to block.timestamp. That means the function will accept a token swap at any block number (i.e., no expiration deadline).
Lines of code
https://github.com/code-423n4/2024-05-predy/blob/a9246db5f874a91fb71c296aac6a66902289306a/src/settlements/UniswapSettlement.sol#L34 https://github.com/code-423n4/2024-05-predy/blob/a9246db5f874a91fb71c296aac6a66902289306a/src/settlements/UniswapSettlement.sol#L50
Vulnerability details
Impact
The
UniswapSettlement::swapExactIn()
andUniswapSettlement::swapExactOut()
does not set an expiration deadline, resulting in losing a lot of funds when swapping tokens.The
deadline
parameter in theswapExactIn()
andswapExactOut()
is set toblock.timestamp
. That means the function will accept a token swap at any block number (i.e., no expiration deadline).Tools Used
Manual
Recommended Mitigation Steps
I recommend setting the
deadline
parameter with a proper timestamp.Assessed type
Context