When to activate
- Creating NFT collections (PFP, art, gaming, utility)
- Building NFT marketplace or auction contracts
- Implementing ERC-2981 royalty standards
- Designing dynamic NFTs with on-chain metadata
- Integrating with OpenSea, Blur, or custom marketplaces
When NOT to use
- For fungible token (ERC-20) development
- For centralized digital asset management
- For physical art inventory systems
Instructions
- Choose standard. ERC-721 (unique), ERC-1155 (semi-fungible/batch), ERC-6551 (token-bound accounts).
- Design metadata. On-chain vs off-chain (IPFS/Arweave). Follow OpenSea metadata schema. Include traits, rarity.
- Implement minting. Allowlist (Merkle tree), public sale, Dutch auction, or reveal mechanics.
- Add royalties. ERC-2981 for on-chain royalty info. Operator filter for marketplace enforcement.
- Build marketplace. Listings, offers, auctions (English/Dutch). Escrow pattern for safe transfers.
- Gas optimization. Batch minting (ERC-1155), lazy minting (sign-to-mint), compressed metadata.
- Security. Prevent double-spend, reentrancy in transfers, enumeration attacks on large collections.
Example
// ERC-721 with Merkle allowlist mint
contract NFTCollection is ERC721, ERC721Enumerable {
bytes32 public merkleRoot;
mapping(address => bool) public claimed;
function allowlistMint(bytes32[] calldata proof) external {
require(!claimed[msg.sender], "Already claimed");
require(MerkleProof.verify(proof, merkleRoot, keccak256(abi.encodePacked(msg.sender))));
claimed[msg.sender] = true;
_safeMint(msg.sender, totalSupply() + 1);
}
}
1---2name: nft-marketplace3description: Build NFT contracts and marketplaces — ERC-721/1155, metadata standards, royalties, and listing mechanisms4allowed-tools: [Read, Write, Bash, Grep]5effort: medium6metadata:7 source: https://skillmd.com/skills/uitbreidenos/nft-marketplace8---910## When to activate1112- Creating NFT collections (PFP, art, gaming, utility)13- Building NFT marketplace or auction contracts14- Implementing ERC-2981 royalty standards15- Designing dynamic NFTs with on-chain metadata16- Integrating with OpenSea, Blur, or custom marketplaces1718## When NOT to use1920- For fungible token (ERC-20) development21- For centralized digital asset management22- For physical art inventory systems2324## Instructions25261. **Choose standard.** ERC-721 (unique), ERC-1155 (semi-fungible/batch), ERC-6551 (token-bound accounts).272. **Design metadata.** On-chain vs off-chain (IPFS/Arweave). Follow OpenSea metadata schema. Include traits, rarity.283. **Implement minting.** Allowlist (Merkle tree), public sale, Dutch auction, or reveal mechanics.294. **Add royalties.** ERC-2981 for on-chain royalty info. Operator filter for marketplace enforcement.305. **Build marketplace.** Listings, offers, auctions (English/Dutch). Escrow pattern for safe transfers.316. **Gas optimization.** Batch minting (ERC-1155), lazy minting (sign-to-mint), compressed metadata.327. **Security.** Prevent double-spend, reentrancy in transfers, enumeration attacks on large collections.3334## Example3536```solidity37// ERC-721 with Merkle allowlist mint38contract NFTCollection is ERC721, ERC721Enumerable {39 bytes32 public merkleRoot;40 mapping(address => bool) public claimed;41 42 function allowlistMint(bytes32[] calldata proof) external {43 require(!claimed[msg.sender], "Already claimed");44 require(MerkleProof.verify(proof, merkleRoot, keccak256(abi.encodePacked(msg.sender))));45 claimed[msg.sender] = true;46 _safeMint(msg.sender, totalSupply() + 1);47 }48}49```