The amendSellOrder()
function should safely modify an existing sell order by adjusting token amounts (transferring additional tokens to contract or returning excess tokens to seller) and updating order parameters atomically without risk of reentrancy.
The function violates the Checks-Effects-Interactions (CEI) pattern by making external calls (safeTransferFrom
/safeTransfer
) before completing all state updates, creating a reentrancy vulnerability that allows malicious token contracts to re-enter the function during token transfers.
Likelihood:
wETH, wBTC, and wSOL are established tokens with standard ERC20 implementations
These legitimate tokens are unlikely to contain malicious reentrancy code
However, the vulnerability exists and could be exploited if any whitelisted token had non-standard behavior
Impact:
Malicious token contracts could re-enter during safeTransferFrom
or safeTransfer
Attacker could manipulate order state before original amendments are applied
Could lead to inconsistent order state, double-spending of amendments, or fund manipulation
More complex than createSellOrder
due to bidirectional token transfers
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.