The compound
function transfers tokens and interacts with external contracts (swap and add liquidity operations). If those contracts are not secure, they could potentially call back into this contract leading to reentrancy attacks. However, this risk is mitigated if the external contracts are trusted and do not have any callbacks.
The function calls external contracts (tokenA, tokenB, GMXManager) which could be manipulated by an attacker to re-enter the function before the first call is finished.
An attacker could potentially drain the contract of funds by causing the function to be called recursively before the first call is finished.
Slither, Manual Review
Use the Checks-Effects-Interactions pattern to prevent reentrancy attacks. Try to make any state changes before calling external contracts.
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.