In the amendSellOrder() function, the contract calls token.safeTransfer(...) to return the difference in token amount to the msg.sender before updating the internal state of the order.
While this is currently safe due to the limited set of supported tokens, it introduces a potential reentrancy vector when in the future the protocol allows arbitrary or unverified tokens (e.g., memecoins) to be traded.
This violates the Checks-Effects-Interactions pattern, which is crucial to prevent reentrancy.
Likelihood:
When the protocol evolves and allows the trading of not verified tokens
Impact:
Lost of funds from the protocol
Although this is not currently exploitable, it becomes critical if new tokens are allowed in the future or dynamic listing is implemented.
Consider adding a validation check before user token.safeTransfer
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.