_executeOpenOperation passes wrong token to _call1InchSwap, causing DoS or incorrect accountingIn Stratax::_executeOpenOperation (L513-514), flashParams.borrowToken is passed as the second parameter to _call1InchSwap, but it should be _asset (the collateral token). This parameter is used in the fallback branch of _call1InchSwap (L625) to query the contract's token balance when the 1inch router returns no data:
Since all borrowToken was already swapped away, the balance query returns ~0, causing require(returnAmount >= totalDebt) to fail.
When the 1inch swap function returns no data, createLeveragedPosition always reverts, making leveraged position creation impossible through those swap routes. If the contract holds pre-existing borrowToken, the stale balance could bypass checks, leading to incorrect flash loan repayment accounting.
Full runnable test: test/audit/H1_WrongAssetInSwap.t.sol
Pass the collateral token address instead of borrowToken:
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.
The contest is complete and the rewards are being distributed.