sherlock-audit / 2023-04-unitasprotocol-judging

4 stars 3 forks source link

PawelK - No `deadline` in `swap` function #98

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

PawelK

medium

No deadline in swap function

Summary

No deadline parameter in swap function

Vulnerability Detail

Swap function doesn't contain a deadline. The transaction can be stuck in mempool, and can be executed when the price won't be favorable for the user.

Impact

Financial loss due to receiving execution of the transaction in a time not controlled by the user

Code Snippet

// deadline parameter missing
function swap(address tokenIn, address tokenOut, AmountType amountType, uint256 amount)

Tool used

Manual Review

Recommendation

Add deadline parameter to swap function

Duplicate of #88