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 the TAU.sol contract, _decreaseCurrentMinted is used to reduce a user's currentMinted value.
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;//@audit
}
}
In the last line, the code updates the value of currentMinted[msg.sender], which is incorrect. It should update the value of currentMinted[account].
For example, there are two users A and B. When A calls burn(1), the value of currentMinted[A] will be updated. However, when A calls burnFrom(B,1), the value of currentMinted[A] will still be updated, but it should update the value of currentMinted[B].
function _decreaseCurrentMinted(address account, uint256 amount) internal virtual {
// 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; + currentMinted[account] = accountMinted - amount;
}
}
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
8olidity
high
Logic Error in _decreaseCurrentMinted
Summary
Logic Error in _decreaseCurrentMinted
Vulnerability Detail
In the
TAU.sol
contract,_decreaseCurrentMinted
is used to reduce a user's currentMinted value.In the last line, the code updates the value of
currentMinted[msg.sender]
, which is incorrect. It should update the value ofcurrentMinted[account]
.For example, there are two users A and B. When A calls
burn(1)
, the value ofcurrentMinted[A]
will be updated. However, when A callsburnFrom(B,1)
, the value ofcurrentMinted[A]
will still be updated, but it should update the value ofcurrentMinted[B]
.Impact
Logic Error in _decreaseCurrentMinted
Code Snippet
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/TAU.sol#L81
Tool used
Manual Review
Recommendation
Duplicate of #149
The text was updated successfully, but these errors were encountered: