Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

In the Horse Store Huff contract the total supply not incremented causes paused horse NFT minting

Summary

The total supply is not incremented in horse store huff contract which will pause the minting of NFT and not allows user to mint more NFTs.

Impact

User can't mint horse.

PoC

forge test --mt test_HorseIsMintedButTotalSupplyNotIncremented
function test_HorseIsMintedButTotalSupplyNotIncremented() public {
uint256 totalSupply = horseStore.totalSupply();
vm.prank(user);
horseStore.mintHorse();
uint256 tokenSupplyAfterMintingHorse = horseStore.totalSupply();
assertEq(tokenSupplyAfterMintingHorse, totalSupply);
address alice = makeAddr("alice");
vm.prank(alice);
vm.expectRevert();
horseStore.mintHorse();
}

Tools Used

Manual Review

Recommendations

Increment the total supply after each nft mint.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Failure to increment total supply on mint

Support

FAQs

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