Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: high
Valid

First person cant reedem right after the deposit

Vulnerability Details

In the Thunderloan.sol contract user can deposit the allowed tokens and and can mint the assetTokens in return.But if a first user who deposit the tokens and tried to redem the tokens right after the deposit it fails because the minted tokens for the first person is in the ratio of 1:1 and the the exchange rate will be increased making the user to reedem more tokens than deposited.

uint256 amountUnderlying = (amountOfAssetToken * exchangeRate) / assetToken.EXCHANGE_RATE_PRECISION();

But the contract didn't have sufficient amount to transfer the tokens to the user making the function fails.
So protocol fails to gains interset if there is no one taking flash loans but it is increasing interests irrespective of flash loans.

Impact

High

Tools Used

Manual Review

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

can't redeem because of the update exchange rate

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.