You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 13, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
TAU currentMinted amount is not updated when tokens are burned from vault
Summary
TAU currentMinted amount is not updated when tokens are burned from vault.
Vulnerability Detail
BaseVault.sol burns TAU tokens of users when their debt is repaid or their position is liquidated. This is done by calling TAU.burnFrom(). As the documentation states, this call is supposed to decrease the burner's currentMinted amount if the burner is a vault. However, this is not the case.
TAU._decreaseCurrentMinted() checks that the currentMinted account is equal to or larger than the amount burned, but it incorrectly uses the currentMinted amount for the account whose tokens are being burned (user), instead of the currentMinted amount for the burner (vault). Thus, accountMinted will be zero and the currentMinted amount will never decrease.
function _decreaseCurrentMinted(addressaccount, uint256amount) internalvirtual {
// If the burner is a vault, subtract burnt TAU from its currentMinted.// This has a few highly unimportant edge cases which can generally be rectified by increasing the relevant vault's mintLimit.uint256 accountMinted = currentMinted[account]; // 👈 should be currentMinted[msg.sender]if (accountMinted >= amount) {
currentMinted[msg.sender] = accountMinted - amount;
}
}
Impact
Burning TAU via debt repayments or liquidations will not have the effect of reducing the currentMinted amount of vaults. Governance will be forced to permanently adjust the mint limit for each vault or give it a very high value to compensate for the lack of automatic readjustment, invalidating in practice the utility of this safety feature.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
shaka
medium
TAU
currentMinted
amount is not updated when tokens are burned from vaultSummary
TAU
currentMinted
amount is not updated when tokens are burned from vault.Vulnerability Detail
BaseVault.sol
burns TAU tokens of users when their debt is repaid or their position is liquidated. This is done by callingTAU.burnFrom()
. As the documentation states, this call is supposed to decrease the burner'scurrentMinted
amount if the burner is a vault. However, this is not the case.TAU._decreaseCurrentMinted()
checks that thecurrentMinted
account is equal to or larger than the amount burned, but it incorrectly uses thecurrentMinted
amount for the account whose tokens are being burned (user), instead of thecurrentMinted
amount for the burner (vault). Thus,accountMinted
will be zero and thecurrentMinted
amount will never decrease.Impact
Burning TAU via debt repayments or liquidations will not have the effect of reducing the
currentMinted
amount of vaults. Governance will be forced to permanently adjust the mint limit for each vault or give it a very high value to compensate for the lack of automatic readjustment, invalidating in practice the utility of this safety feature.Code Snippet
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/TAU.sol#L60-L83
Tool used
Manual Review
Recommendation
Duplicate of #149
The text was updated successfully, but these errors were encountered: