deadline is designed for the caller to specify a deadline time for the transaction to be packed. However, since the deadline is calculated based on block.timestamp + 5 minutes, it won't be effective (it always passes).
Therefore, changing it to block.timestamp will make the code simpler and save some gas.
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/YETI/sYETIToken.sol#L231-L231
deadline
is designed for the caller to specify a deadline time for the transaction to be packed. However, since thedeadline
is calculated based onblock.timestamp + 5 minutes
, it won't be effective (it always passes).Therefore, changing it to
block.timestamp
will make the code simpler and save some gas.Recommendation
Change to: