flashloan() logic is not correct for contracts that repay the loan's fee by redeeming assetTokens.
flashloan() is making a callback to receiverAddress, by calling executeOperation()
. Plus, it is assuming that receiverAddress is a contract. This is because the receiverAddress could have custom strategies to repay the loan and fee. But if the receiverAddress uses its assetToken to redeem for tokens to repay the fee, then this calculation will be incorrect:
It will fail to pass because the assetReceiver contract has withdrawn some tokens (because it is a lender) to repay the loan's fee.
assetReceiver contracts that redeems some assetToken to repay the loan's fee won't work.
Manual Review.
Include logic for cases where assetTokens were burned to pay for the fee.
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.