feat: add minimal ERC721-style NFT contract with tests#4
Merged
Conversation
No metadata or safeTransfer hooks - tight surface for unit + fuzz tests. Covers happy path, double-mint revert, approval cleared on transfer, operator vs per-token approval, and zero-address guards. Closes #3
Owner
Author
|
Reviewed - 11/11 NFT tests pass, full suite at 33/33, no regressions. Approval-on-transfer clear is the bit I wanted to see covered and it is. Merging. |
oliv3rdrt
added a commit
that referenced
this pull request
Jun 27, 2026
No metadata or safeTransfer hooks - tight surface for unit + fuzz tests. Covers happy path, double-mint revert, approval cleared on transfer, operator vs per-token approval, and zero-address guards. Closes #3 Co-authored-by: Oliver Anyanwu <oliver.anyanwu@aol.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/NFT.sol: minimal ERC721 (ownerOf, balanceOf, transferFrom, approve, setApprovalForAll). Mint is open so tests don't need role plumbing. No metadata, no safeTransfer hooks.test/NFT.t.sol: 10 unit + 1 fuzz test. Covers double-mint revert, approval cleared on transfer, both approval modes (per-token and operator), and zero-address guards.Test plan
forge test --match-contract NFTTest- 11/11 passedforge test- 33/33 passed, no regressionsCloses #3