Implementation of setAllowedToken
results in the liquidity provider by users getting stuck in the AssetToken
contract because there is no mechanism to withdraw assets after disabling a token.
Let's assume the owner enables a token to be accepted in the protocol, then users will deposit that token as liquidity. Later the owner calls setAllowedToken
to disable the token.
At this point the users cannot withdraw their assets from the protocol; enabling the token again will only result in a brand new AssetToken
being created that will point to a different address that doesn't have the balance of the users.
AssetToken
mainly provides basic ERC-20 logic and all deposit and redemption logics are in ThunderLoan
/ThunderLoanUpgraded
. This mean the users cannot use AssetToken
directly to get their assets back.
The following code snippet shows an example of the vulnerability.
Lost of users funds.
VS Code and Foundry.
Disallow disabling a token if the contract holds underlying balance or provide a channel for users to withdraw their assets if the token is disabled.
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.