code-423n4 / 2021-11-vader-findings

0 stars 0 forks source link

Possibility of reducing the maxSupply of Vader #198

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

ksk2345

Vulnerability details

Impact

There is a possibility of unintentionally reducing the maxSupply of Vader, via the adjustMaxSupply function

Proof of Concept

Ref : line 212 in contracts/tokens/Vader.sol

As per the comments in the Requirements, we should be only increasing the value than the current value of maxSupply, but in the implementation, its possible to set a new maxSupply to a value below the current maxSupply, since we are comparing with totalSupply()

Tools Used

Manual review

Recommended Mitigation Steps

If the Requirement statement is correct then, In function adjustMaxSupply, compare the value with maxSupply

function adjustMaxSupply(uint256 _maxSupply) external onlyDAO {
    require(
        _maxSupply >= maxSupply,
        "Vader::adjustMaxSupply: Max supply cannot subcede current supply"
    );
alcueca commented 2 years ago

No grounds for dispute