The burn
function in SmartVaultV3
is supposed to allow a user to burn his EUROs
tokens.
However, the current implementation doesn't allow him to burn all of his tokens as the transaction will revert.
Let's take a look at the code:
Let's say the user has 1000 tokens and he tries to burn them all.
A certain amount of fee
will be calculated, and then the 1000 tokens will be burnt.
After that, the function attempts to transfer fee
from the user to the ISmartVaultManagerV3(manager).protocol()
. However, all of his tokens are already burned and this operation will revert.
A user can't burn all of his tokens which is a strange design decision and will lead to the user having to calculate what amount he has to burn so the fee succeeds in getting transferred.
Manual review
You should burn amount - fee
and then transfer the fee
:
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.