sherlock-audit / 2023-12-dodo-judging

5 stars 4 forks source link

bigbick123456789000 - Lack of Effective Deadline Check in Token Swap Functions #3

Closed sherlock-admin closed 8 months ago

sherlock-admin commented 8 months ago

bigbick123456789000

medium

Lack of Effective Deadline Check in Token Swap Functions

Summary

The contract lacks an effective deadline check in its token swap functions (sellToken and buyToken). The absence of a robust deadline mechanism can expose users to potential security risks, including front-running attacks, unexpected execution of pending transactions, and slippage due to outdated pricing information.

Vulnerability Detail

In the provided code, the token swap functions sellToken and buyToken lack a comprehensive deadline check mechanism. The absence of a reliable deadline check introduces the following vulnerabilities:

Manual Review

Recommendation

A more sophisticated deadline check mechanism that considers factors such as on-chain oracles for real-time pricing information, auction mechanisms, and a threshold for block confirmations.

nevillehuang commented 8 months ago

Invalid, deadline checks present here and here where sellToken() and buyToken() is called respectively.