Normal behavior: after swapping borrowed token to collateral token, the contract should measure received collateral to verify flash-loan repayment.
Issue: createLeveragedPosition passes borrowToken into _call1InchSwap as _asset. In fallback mode (empty router return data), _call1InchSwap reads balanceOf(_asset) from the wrong token, producing incorrect returnAmount and false repayment failure.
Likelihood:
Reason 1 // Non-standard/empty return-data path from router execution occurs in integration edge cases.
Reason 2 // Flash-loan open flow depends entirely on returnAmount correctness for repayment validation.
Impact:
Impact 1 // False negative repayment check can revert open-position transaction.
Impact 2 // Protocol availability for opening leverage is reduced under router return-data variability.
This PoC configures the mock router to execute via fallback (empty return data), while still minting enough destination tokens to cover repayment. The transaction then reverts with Insufficient funds to repay flash loan, confirming that fallback accounting reads the wrong token balance.
The mitigation ensures the open flow always measures output in the destination token (_asset) and, ideally, by balance delta. That avoids dependence on router return-data shape and prevents false repayment failures.
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.