unauthorized token burning
The vulnerability is located in lines 84 to 87. In these lines, the contract burns tokens from the liquidator's wallet without checking if the liquidator has approved the contract to do so. This could potentially lead to unauthorized token burning. The contract should first check if the liquidator has given the contract an allowance to burn their tokens. If not, the contract should revert or ask the liquidator to approve the contract to burn their tokens. This is a critical vulnerability as it could lead to loss of tokens for the liquidator.
vscode
To resolve this issue, you should add a check to ensure that the liquidator has approved the contract to burn their tokens. If not, the contract should revert with an appropriate error message. Here is a sample code snippet:
In the above code, we first check if the liquidator's wallet balance and allowance for the contract are both greater than or equal to the debt to be liquidated. If not, we revert with an error. Only then do we proceed to burn the tokens from the liquidator's wallet.
Also, make sure to define the InsufficientAllowanceOrBalance
error in your Errors
library.
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.