20,000 USDC
View results
Submission Details
Severity: medium
Valid

Using block.timestamp as the swap deadline

Summary

The deadline parameter for the swap inside the sellProfits is hardcoded to block.timestamp.

Vulnerability Details

The deadline parameter is intended to ensure that the swap can be executed within a specific timeframe. However, using the current timestamp (the value from the block in which the transaction is included) invalidates its purpose, as the deadline would be valid for any block in which the transaction is executed.

Impact

Protocols shouldn't set the deadline to block.timestamp as a validator can hold the transaction and the block it is eventually put into will be block.timestamp, so this offers no protection.
More on this

Tools Used

Manual review

Recommendations

Consider providing a deadline value off-chain, as a function argument.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.