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

No Mechanism to update Token URI in NFTFactory.sol

Summary:

Hi,

I found out a potential bug in the contract 'NFTFactory.sol' in which there's no mechanism for the updation of token URI after the NFT is minted.

Vulnerability Details:

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

Although the contract is using **ERC721URIStorage **to store token URIs, yet there's no function to update the token URI after an NFT is minted leading to incorrect metadata of NFT minted.

Impact:

Immutable token URIs can lead to outdated / incorrect metadata, causing harm to project reputation.

Tools Used:

Manual Code Analysis

Recommendations:

Implement a proper updation function for Token URI for maintaining the metadata of the NFT minted in it's correct form. The sample code for implementation can be given as follows:

function updateTokenURI(uint256 tokenId, string memory newURI) external onlyInheritanceManager {
require(_exists(tokenId), "Token does not exist");
require(bytes(newURI).length > 0, "New URI cannot be empty");
_setTokenURI(tokenId, newURI);
}
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.