The deposit function uses safeTransferFrom to transfer the underlying tokens to be flashloaned to the asset token contract. Because the ThunderLoan contract is sending the depositor's tokens to the asset token contract on the user's behalf, the user needs to approve the contract to transfer their tokens before calling safeTransferFrom().
I wrote this test to show that you can't successfully deposit without approve....it reverts due to insufficient allowance:
Deposits will fail. In the unit tests, we had to call approve before being able to successfully deposit, but once this protocol is live, that needs to be part of the deposit function.
Manual review
Add approve before safeTransferFrom:
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.