Skip to content

Commit

Permalink
Update solmate-nft.md (#1142)
Browse files Browse the repository at this point in the history
- mintTo function should set the currentTokenId only of newTokenId doesn't exceed TOTAL_SUPPLY.
- `test_NewMintOwnerRegistered`,  `with_key(1)` should be `with_key(address(1))`
  • Loading branch information
tuncatunc authored Mar 12, 2024
1 parent 1695343 commit 90bcd80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tutorials/solmate-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ contract NFT is ERC721, Ownable {
if (msg.value != MINT_PRICE) {
revert MintPriceNotPaid();
}
uint256 newTokenId = ++currentTokenId;
uint256 newTokenId = currentTokenId + 1;
if (newTokenId > TOTAL_SUPPLY) {
revert MaxSupply();
}
currentTokenId = newTokenId;
_safeMint(recipient, newTokenId);
return newTokenId;
}
Expand Down Expand Up @@ -239,7 +240,7 @@ contract NFTTest is Test {
uint256 slotOfNewOwner = stdstore
.target(address(nft))
.sig(nft.ownerOf.selector)
.with_key(1)
.with_key(address(1))
.find();
uint160 ownerOfTokenIdOne = uint160(
Expand Down

0 comments on commit 90bcd80

Please sign in to comment.