Full burning of EUROs
token to get all the collateral back is not possible in a smart vault due to flawed logic implementation.
Let's suppose, Vault owner supplies 15 PAXG
tokens into the vault as collateral. With that the owner mints 15000 EUROs
tokens.
Now, After some time, Vault owner doesn't need any EUROs
tokens, So, The owner decides to burn all of his 15000 EUROs
token to get his 15 PAXG
collateral back.
When, the owner calls the burn()
with 15000
, the burn function will revert because of incorrect burn fee handling.
Basically, first tokens are burned here and fee amount is EUROs
is transferred here.
Thus, In case of full burn, the owner won't have any EUROs
tokens left to pay burn fee
to the protocol.
This issue will cause inconvenience and grief to the Vault owner as owner has to manually calculate the burn fees and adjust burn amount accordingly for fully burning all of EUROs
tokens.
Manual Analysis
The burn()
should be modified as below to mitigate this issue:
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.