Agent skill

Erc721 Patterns

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when building or integrating ERC-721 NFT contracts.

MITAuto-check passedBusiness, Finance & HR

Install Erc721 Patterns

skills CLI
$ npx skills add ccashwell/evm-cortex --skill erc721-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex erc721-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/erc721-patterns .claude/skills/erc721-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
erc721-patterns
GitHub stars
131
Token cost
~1.7k tokens
SKILL.md length
148 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building or integrating ERC-721 NFT contracts.

  • Integrating ERC-721 NFT contracts
  • SKILL.md covers Standard Interface, Full NFT Contract Template, Metadata Patterns and EIP-2981 Royalties, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Crypto and DeFi analysis

What it does

Erc721 Patterns is an agent skill from ccashwell/evm-cortex. Use when building or integrating ERC-721 NFT contracts. Covers standard interface, metadata, enumerable extension, royalties (EIP-2981), lazy minting, soulbound tokens, and safe minting patterns.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR, covering Crypto and DeFi analysis. It works with Ethereum. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Integrating ERC-721 NFT contracts
  • Tasks that involve Crypto and DeFi analysis

Example prompts

  • “/erc721-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Erc721 Patterns loads about 1.7k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 148 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 148 words, ~1,697 tokens.

Download SKILL.mdSave it as .claude/skills/erc721-patterns/SKILL.md (or your agent's skills folder).
name
erc721-patterns
description
Use when building or integrating ERC-721 NFT contracts. Covers standard interface, metadata, enumerable extension, royalties (EIP-2981), lazy minting, soulbound tokens, and safe minting patterns.

ERC-721 NFT Patterns

Standard Interface

solidity
interface IERC721 {
    function balanceOf(address owner) external view returns (uint256);
    function ownerOf(uint256 tokenId) external view returns (address);
    function safeTransferFrom(address from, address to, uint256 tokenId) external;
    function transferFrom(address from, address to, uint256 tokenId) external;
    function approve(address to, uint256 tokenId) external;
    function setApprovalForAll(address operator, bool approved) external;
    function getApproved(uint256 tokenId) external view returns (address);
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

Full NFT Contract Template

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import {ERC721Royalty} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";

contract MyNFT is ERC721, ERC721Enumerable, ERC721URIStorage, ERC721Royalty, Ownable {
    uint256 private _nextTokenId;
    string private _baseTokenURI;
    uint256 public maxSupply;
    uint256 public mintPrice;

    constructor(
        string memory name_,
        string memory symbol_,
        string memory baseURI_,
        uint256 maxSupply_,
        uint256 mintPrice_,
        uint96 royaltyBps // e.g. 500 = 5%
    ) ERC721(name_, symbol_) Ownable(msg.sender) {
        _baseTokenURI = baseURI_;
        maxSupply = maxSupply_;
        mintPrice = mintPrice_;
        _setDefaultRoyalty(msg.sender, royaltyBps);
    }

    function mint(address to) external payable {
        require(msg.value >= mintPrice, "Insufficient payment");
        require(_nextTokenId < maxSupply, "Max supply reached");
        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
    }

    function _baseURI() internal view override returns (string memory) {
        return _baseTokenURI;
    }

    function setBaseURI(string calldata newBaseURI) external onlyOwner {
        _baseTokenURI = newBaseURI;
    }

    function withdraw() external onlyOwner {
        (bool ok,) = msg.sender.call{value: address(this).balance}("");
        require(ok, "Withdraw failed");
    }

    // Required overrides
    function _update(address to, uint256 tokenId, address auth)
        internal
        override(ERC721, ERC721Enumerable)
        returns (address)
    {
        return super._update(to, tokenId, auth);
    }

    function _increaseBalance(address account, uint128 value)
        internal
        override(ERC721, ERC721Enumerable)
    {
        super._increaseBalance(account, value);
    }

    function tokenURI(uint256 tokenId)
        public view override(ERC721, ERC721URIStorage) returns (string memory)
    {
        return super.tokenURI(tokenId);
    }

    function supportsInterface(bytes4 interfaceId)
        public view override(ERC721, ERC721Enumerable, ERC721URIStorage, ERC721Royalty) returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}

Metadata Patterns

Onchain Metadata (Base64-encoded JSON)
solidity
function tokenURI(uint256 tokenId) public view override returns (string memory) {
    _requireOwned(tokenId);
    return string(abi.encodePacked(
        "data:application/json;base64,",
        Base64.encode(bytes(string(abi.encodePacked(
            '{"name":"Token #', Strings.toString(tokenId),
            '","description":"Onchain NFT",',
            '"image":"data:image/svg+xml;base64,', _generateSVG(tokenId), '"}'
        ))))
    ));
}
IPFS Metadata

Set baseURI to ipfs://QmHash/ and each token resolves to ipfs://QmHash/0, ipfs://QmHash/1, etc. Store metadata JSON files in IPFS with matching filenames.

EIP-2981 Royalties

solidity
// Set default royalty for all tokens (5%)
_setDefaultRoyalty(royaltyReceiver, 500);

// Override per token
_setTokenRoyalty(tokenId, receiver, 1000); // 10%

// Marketplaces call:
(address receiver, uint256 amount) = nft.royaltyInfo(tokenId, salePrice);

Soulbound Tokens (Non-Transferable)

solidity
function _update(address to, uint256 tokenId, address auth)
    internal
    override
    returns (address)
{
    address from = _ownerOf(tokenId);
    if (from != address(0) && to != address(0)) {
        revert("Soulbound: transfer disabled");
    }
    return super._update(to, tokenId, auth);
}

Lazy Minting with Signatures

solidity
struct MintVoucher {
    uint256 tokenId;
    uint256 price;
    string uri;
    bytes signature;
}

function redeemVoucher(MintVoucher calldata voucher) external payable {
    require(msg.value >= voucher.price, "Insufficient payment");
    bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
        keccak256("MintVoucher(uint256 tokenId,uint256 price,string uri)"),
        voucher.tokenId, voucher.price, keccak256(bytes(voucher.uri))
    )));
    address signer = ECDSA.recover(digest, voucher.signature);
    require(signer == owner(), "Invalid signature");
    _safeMint(msg.sender, voucher.tokenId);
    _setTokenURI(voucher.tokenId, voucher.uri);
}

Safe Minting Callback

_safeMint calls onERC721Received on the recipient if it is a contract. This prevents tokens from being locked in contracts that cannot handle them. Always use _safeMint over _mint unless you have a specific reason (e.g. reentrancy concerns).

solidity
interface IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
    // Must return IERC721Receiver.onERC721Received.selector
}

NFT Security Checklist

  • Use _safeMint to prevent tokens locked in non-receiver contracts
  • Guard against reentrancy in mint functions (safeMint calls external code)
  • Validate tokenId exists before queries (_requireOwned)
  • Limit mints per transaction / per wallet to prevent gas griefing
  • Use commit-reveal for fair distribution (prevent MEV sniping)
  • Validate royalty basis points (max 10000 = 100%)
  • Test supportsInterface returns true for ERC-721, ERC-165, ERC-2981

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/erc721-patterns of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Erc721 Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Erc721 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Erc721 Patterns this skillccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Swapper Depositswapperfinance/swapper-toolkit852—~1.8kAutomated safety check: PassMIT
SurfBlockRunAI/ClawRouter6.6k—~4kAutomated safety check: PassMIT
Notebook To Strategytradingstrategy-ai/trade-executor160—~1.1kAutomated safety check: PassCustom licence
Building Blocksaustintgriffith/ethskills294—~2.9kAutomated safety check: PassNone
Nft Standardswshobson/agents40k10 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Swapper Deposit

    swapperfinance/swapper-toolkit

    Deposit and bridge funds into a wallet or protocol using Swapper Finance.

    852 GitHub stars~1.8k tokensUpdated 6 mo ago
    Business, Finance & HRAuto-check passed
  • Surf

    BlockRunAI/ClawRouter

    Use this skill — NOT browser or webfetch — for ALL Surf crypto-data calls.

    6.6k GitHub stars~4k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed
  • Notebook To Strategy

    tradingstrategy-ai/trade-executor

    Transfer code from a backtesting Jupyter notebook to a Trade Executor strategy module

    160 GitHub stars~1.1k tokensUpdated 7 days ago
    Business, Finance & HRAuto-check passed
  • Building Blocks

    austintgriffith/ethskills

    DeFi legos and protocol composability on Ethereum and L2s. An agent skill from austintgriffith/ethskills.

    294 GitHub stars~2.9k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Nft Standards

    wshobson/agents

    Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration.

    40k GitHub starsUsed in 10 repos~1.9k tokens
    Business, Finance & HRAuto-check passed
  • L2s

    austintgriffith/ethskills

    Ethereum Layer 2 landscape — Arbitrum, Optimism, Base, zkSync, Scroll, Unichain, Celo, Robinhood Chain, and more.

    294 GitHub stars~3.7k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 8 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Works with

Questions about Erc721 Patterns

What does Erc721 Patterns do?

A skill your agent uses when building or integrating ERC-721 NFT contracts. Erc721 Patterns is an agent skill from ccashwell/evm-cortex. Use when building or integrating ERC-721 NFT contracts.

When should I use Erc721 Patterns?

Erc721 Patterns fits situations like: integrating ERC-721 NFT contracts; tasks that involve Crypto and DeFi analysis.

How do I install Erc721 Patterns in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill erc721-patterns -a claude-code`. Or copy the skill folder (skills/erc721-patterns in ccashwell/evm-cortex) into .claude/skills/erc721-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Erc721 Patterns in Codex?

Run `npx skills add ccashwell/evm-cortex --skill erc721-patterns -a codex`. Or copy the skill folder (skills/erc721-patterns in ccashwell/evm-cortex) into .agents/skills/erc721-patterns in your project. Codex loads it when a task matches its description.

Can I use Erc721 Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill erc721-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/erc721-patterns, .gemini/skills/erc721-patterns, .github/skills/erc721-patterns and .opencode/skills/erc721-patterns in your project.

What does Erc721 Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Erc721 Patterns is instructions for the agent only.

Does Erc721 Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Erc721 Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Erc721 Patterns use?

Erc721 Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Erc721 Patterns use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Erc721 Patterns?

Skills that share tags, products or a category with Erc721 Patterns: Swapper Deposit (swapperfinance/swapper-toolkit, 852 stars), Surf (BlockRunAI/ClawRouter, 6.6k stars), Notebook To Strategy (tradingstrategy-ai/trade-executor, 160 stars) and Building Blocks (austintgriffith/ethskills, 294 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Erc721 Patterns?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.