In CreditDelegationBranch.sol
, the calculateSwapAmount
function is called with reversed token order in rebalanceVaultsAssets
, which could lead to incorrect swap amount calculations and potential underflows.
Relevant Links:
In rebalanceVaultsAssets
, calculateSwapAmount
is called with USDC as assetIn
and the vault's collateral asset as assetOut
when the vault is in debt, where as the correct operation should be to swap the collateral asset to usdc. This leads to calculation of incorrect swap amounts
in the calculateSwapAmount call, the order of assetIn and assetOut is reversed:
which is then passed as an input to perform the swap this could lead to wrong swap performed
This is a significant issue because it will calculate the wrong swap amount, potentially leading to incorrect debt settlement calculations.
Manual Review
the order of inputs to calculateSwapAmount should be corrected as shown below
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.