Skip to content

feat: add minimal ERC721-style NFT contract with tests#4

Merged
oliv3rdrt merged 1 commit into
mainfrom
feat/nft-contract
May 17, 2026
Merged

feat: add minimal ERC721-style NFT contract with tests#4
oliv3rdrt merged 1 commit into
mainfrom
feat/nft-contract

Conversation

@oliv3rdrt

Copy link
Copy Markdown
Owner

Summary

  • Adds 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.
  • Adds 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 passed
  • forge test - 33/33 passed, no regressions

Closes #3

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
@oliv3rdrt

Copy link
Copy Markdown
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 oliv3rdrt merged commit 3d2c836 into main May 17, 2026
@oliv3rdrt oliv3rdrt deleted the feat/nft-contract branch May 17, 2026 11:29
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a minimal NFT (ERC721-style) contract sample

1 participant