To check if a vault is undercollateralized or not, the protocol makes use of the maxMintable() function which internally calls euroCollateral(). This particular function loops through the list of current getTokenManager().getAcceptedTokens()
to find out the current collateral value in euro.
The problem arises in the following scenario:
User deposits collateral using a token from the accepted list say, sUSD
User mints some amount of EUROs
TokenManager due to any reason, calls removeAcceptedToken()
to remove sUSD
from the list of accepted tokens
Immediately, the Vault becomes undercollateralized and can be liqudated causing the user to lose all of his collateral.
There is no warning system or grace period which can give the user a chance to deposit a new token or swap the current one for another acceptable one.
While removing a token may be okay for upcoming vaults to be created in future, for existing vaults it is certainly required to have a grace period of some sort.
This scenario also effects other functions like claimRewards()
. All existing rewards associated with this token now vanish.
Apply the following patch to update test/smartVault.js
and run via npx hardhat test --grep 'removing token causes undercollateralization'
to see the test fail. The vault becomes undercollateralized as soon as the token is removed from accepted list.
Users lose funds with no warning system.
All existing rewards associated with the removed token vanish.
Hardhat
The protocol needs to think about having a two-step token removal system. They can initially mark a token as backlisted and give a grace period of X days to existing vault holders before they are affected.
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.