Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

GimelSec - currentMinted doesn't return to zero. #158

Closed
sherlock-admin opened this issue Mar 13, 2023 · 0 comments
Closed

GimelSec - currentMinted doesn't return to zero. #158

sherlock-admin opened this issue Mar 13, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 13, 2023

GimelSec

medium

currentMinted doesn't return to zero.

Summary

When a vault burn exceeds the currentMinted amount, the currentMinted will not be subtracted, resulting in that although the token is burned, the vault limit still has a non-zero value instead of returning to zero.

Vulnerability Detail

The _decreaseCurrentMinted():

    function _decreaseCurrentMinted(address account, uint256 amount) internal virtual {
        uint256 accountMinted = currentMinted[account];
        if (accountMinted >= amount) {
            currentMinted[msg.sender] = accountMinted - amount;
        }
    }

The TAU token will burn exceeds the currentMinted amount if a keeper calls SwapHandler.swapForTau().
The currentMinted[vault] still has a non-zero value instead of returning to zero.

Impact

The currentMinted[vault] still has a non-zero value, the mint quota of the vault will become less.

Code Snippet

https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/TAU.sol#L76-L83

Tool used

Manual Review

Recommendation

    function _decreaseCurrentMinted(address account, uint256 amount) internal virtual {
        uint256 accountMinted = currentMinted[account];
        if (accountMinted >= amount) {
            currentMinted[msg.sender] = accountMinted - amount;
        } else {
            currentMinted[msg.sender] = 0;
        }
    }

Duplicate of #149

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Mar 21, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant