Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

No Maximum Supply Limit on minting NFTs (NFTFactory.sol)

Summary:

Hi,

I have found out potential bug in your contract 'NFTFactory.sol' which can leads to unlimited NFT minting theoratically by no maximum supply limit in the contract.

Vulnerability Details:

The key details of this potential vulnerability can be given as follows:

In this contract, the function createEstate is able to mint NFTs for the Inheritance Manager without restriction as there's no maximum supply of NFT check available. With this, it can lead inflation in the value of NFTs minted and eventually degrade it's worth.

Impact:

Unlimited minting of NFTs leads to inflation, reducing its value.

Tools Used:

Manual Code Analysis

Recommendations:

It's preferable to put limit on NFTs minted to maintain it's value and gas efficient. The sample code for implementation is given below:

uint256 private constant MAX_SUPPLY = 10_000; // Example max supply
uint256 private counter = 0;
function createEstate(string memory description) external onlyInheritanceManager returns (uint256 itemID) {
require(counter < MAX_SUPPLY, "Maximum supply reached");
uint256 ID = _incrementCounter();
_mint(msg.sender, ID);
_setTokenURI(ID, description);
return ID;
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.