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
I can't find a reason why totalNftMintCount in Factory can't be replaced with ERC721 totalSupply() to make it less error-prone. As nfthub.mint issues a new token it should automatically increment totalSupply and this assignment won't be needed:
totalNftMintCount = totalNftMintCount + _tokenURIs.length;
Also in function setNftHubAddress you need to manually set _newNftMintCount if you want to change nfthub so an invalid value may crash the system. totalSupply() will eliminate totalNftMintCount and make the system more robust.
Recommended Mitigation Steps
Replace totalNftMintCount with nfthub totalSupply() in Factory contract.
The text was updated successfully, but these errors were encountered:
Sometimes what looks like a small fix just takes you all the way down the rabbithole, this was one of them. totalSupply() isn't included by default so I had to import the Enumerable extension.
fixed here
Handle
pauliax
Vulnerability details
Impact
I can't find a reason why totalNftMintCount in Factory can't be replaced with ERC721 totalSupply() to make it less error-prone. As nfthub.mint issues a new token it should automatically increment totalSupply and this assignment won't be needed:
totalNftMintCount = totalNftMintCount + _tokenURIs.length;
Also in function setNftHubAddress you need to manually set _newNftMintCount if you want to change nfthub so an invalid value may crash the system. totalSupply() will eliminate totalNftMintCount and make the system more robust.
Recommended Mitigation Steps
Replace totalNftMintCount with nfthub totalSupply() in Factory contract.
The text was updated successfully, but these errors were encountered: