The contract performs external token transfers (e.g., via safeTransferFrom) without a re-entrancy guard. If the token contract is nonstandard or maliciously designed, it could trigger a callback and re-enter the swap function, potentially causing state inconsistencies.
An abstraction of the vulnerable section:
Re-entrancy Attacks: A malicious token contract could re-enter the function during the external call and manipulate the state or drain funds.
Unexpected Behavior: The absence of guards may lead to double spending, faulty fee calculations, or collateral mismanagement.
Manual review
Re-entrancy analysis tools
Static analysis
Implement Re-entrancy Guard: Add a standard nonReentrant modifier (using OpenZeppelin’s ReentrancyGuard) around functions performing external calls.
Order of Operations: Ensure that all critical state changes are made before any external call and consider using a Checks-Effects-Interactions pattern.
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.