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
In TAU._decreaseCurrentMinted, when accountMinted < amount, the currentMinted is not decreased.
Vulnerability Detail
In TAU._decreaseCurrentMinted:
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];
if (accountMinted >= amount) {
currentMinted[msg.sender] = accountMinted - amount;
}
}
The if statement only decrease currentMinted when accountMinted >= amount. However, if accountMinted < amount(it's possible, since who burn the TAU can be different from who mint TAU to this account), the amount is not decreased.
Impact
In some cases, this will make some vaults get unexpectedly more power to mint. Anyway, it's some unexpected behaviour, so I marked it as Medium.
In fact, the currentMinted management in this TAU contract is somehow chaotic. The governance can give power to same vaults to mint TAU, but the power is not just as seen in the mintLimit, since the decrease management is sometimes not working as expected. Combining with abother issue that msg.sender not identical with account, I think this part's related features need to be reconsidered and refactored.
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
y1cunhui
medium
Not decreasing
currentMinted
inTAU
in some casesSummary
In
TAU._decreaseCurrentMinted
, whenaccountMinted < amount
, thecurrentMinted
is not decreased.Vulnerability Detail
In
TAU._decreaseCurrentMinted
:The
if
statement only decreasecurrentMinted
whenaccountMinted >= amount
. However, ifaccountMinted < amount
(it's possible, since who burn the TAU can be different from who mint TAU to this account), the amount is not decreased.Impact
In some cases, this will make some vaults get unexpectedly more power to mint. Anyway, it's some unexpected behaviour, so I marked it as Medium.
Code Snippet
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/TAU.sol#L76-L83
Tool used
Manual Review
Recommendation
In fact, the
currentMinted
management in thisTAU
contract is somehow chaotic. The governance can give power to same vaults to mint TAU, but the power is not just as seen in themintLimit
, since the decrease management is sometimes not working as expected. Combining with abother issue thatmsg.sender not identical with account
, I think this part's related features need to be reconsidered and refactored.Duplicate of #149
The text was updated successfully, but these errors were encountered: