erc1155-patterns

erc1155-patterns is a skill for Claude Code, Codex from ccashwell/evm-cortex. It costs 43 tokens per session (1,515 once invoked), scanned A, original, MIT.

A guide to ERC-1155 multi-token contracts, which can represent many interchangeable and unique items under one contract.

In plain words
What is it for?
Use it for batch transfers, game items, mixed fungible and non-fungible assets, metadata, and supply tracking.
Why use it?
It reduces the need for separate contracts and supports transferring many token types or amounts in a single operation.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ccashwell/evm-cortex/erc1155-patterns
Any agent
npx skills add ccashwell/evm-cortex --skill erc1155-patterns
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for erc1155-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccashwell/evm-cortex/erc1155-patterns.svg)](https://agentmods.dev/skills/ccashwell/evm-cortex/erc1155-patterns)
Your own site
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/erc1155-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/erc1155-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,515 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.01515
Opus 5 $0.00022 $0.00758
Sonnet 5 $0.00009 $0.00303
Haiku 4.5 $0.00004 $0.00152

Measured yesterday against content hash 4909b9fb9062, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

erc1155-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/erc1155-patterns/SKILL.md · 179 lines

How it starts

The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ERC-1155 Multi-Token Patterns

Standard Interface

interface IERC1155 {
    function balanceOf(address account, uint256 id) external view returns (uint256);
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external view returns (uint256[] memory);
    function setApprovalForAll(address operator, bool approved) external;
    function isApprovedForAll(address account, address operator) external view returns (bool);
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
    function safeBatchTransferFrom(
        address from, address to, uint256[] calldata ids,
        uint256[] calldata amounts, bytes calldata data
    ) external;
}

Implementation Pattern

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

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import {ERC1155Supply} from "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import {ERC1155URIStorage} from "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract GameItems is ERC1155, ERC1155Supply, ERC1155URIStorage, Ownable {
    // Token type constants
    uint256 public constant GOLD = 0;       // fungible
    uint256 public constant SILVER = 1;     // fungible
    uint256 public constant SWORD = 2;      // non-fungible (supply = 1 each)
    uint256 public constant SHIELD = 3;     // semi-fungible

    uint256 private _nextUniqueId = 1000;

    mapping(uint256 tokenId => uint256 maxSupply) public caps;

    constructor(string memory baseUri) ERC1155(baseUri) Ownable(msg.sender) {
        caps[GOLD] = type(uint256).max;
        caps[SILVER] = type(uint256).max;
        caps[SWORD] = 100;
        caps[SHIELD] = 500;
    }

    function mintFungible(address to, uint256 id, uint256 amount) external onlyOwner {
        require(totalSupply(id) + amount <= caps[id], "Cap exceeded");
        _mint(to, id, amount, "");
    }

    function mintBatch(address to, uint256[] calldata ids, uint256[] calldata amounts)
        external onlyOwner
    {
        for (uint256 i = 0; i < ids.length; i++) {
            require(totalSupply(ids[i]) + amounts[i] <= caps[ids[i]], "Cap exceeded");
        }
        _mintBatch(to, ids, amounts, "");
    }

    function mintUnique(address to, string calldata tokenUri) external onlyOwner returns (uint256) {
        uint256 tokenId = _nextUniqueId++;
        caps[tokenId] = 1;
        _mint(to, tokenId, 1, "");
        _setURI(tokenId, tokenUri);
        return tokenId;
    }

    function uri(uint256 tokenId) public view override(ERC1155, ERC1155URIStorage) returns (string memory) {
        return super.uri(tokenId);
    }

    function _update(address from, address to, uint256[] memory ids, uint256[] memory values)
        internal override(ERC1155, ERC1155Supply)
    {
        super._update(from, to, ids, values);
    }
}

Read the full file on GitHub · 179 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 179 lines · 43 tokens per session scan A 4909b9fb9062

Subscribe to this mod's changes

erc1155-patterns is a skill published in the GitHub repository ccashwell/evm-cortex (127 stars, last pushed 25d ago), licensed MIT. It adds 43 tokens to every session and 1,515 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

enum-struct

Create, modify, and introspect UserDefinedEnums and UserDefinedStructs (EnumStructService). Use when the user asks to create a Blueprint enum or struct, add enum values or struct members, or inspect an enum/struct's fields. Useful for defining a DataTable row struct.

kevinpbuckley/VibeUE · 62 tokens

yoink

Play Yoink capture-the-flag game on Base - yoink the flag, check scores, compete for trophy.

alsk1992/CloddsBot · 25 tokens

authoring-godot-prompter-skills

Use when writing or editing a SKILL.md or an agent definition in this repo — required frontmatter, section ordering, and the GDScript-then-C# example convention.

jame581/GodotPrompter · 47 tokens

cattown

Interact with Cat Town — a Farcaster-native game world on Base. Covers KIBBLE staking (stake, claim, unlock, unstake, leaderboard, deposit history); live world state (season, weather, time of day, weekend flag); fishing drops filtered by world state; Isabella's weekend fishing competition with live prize-pool math…

BankrBot/skills · 223 tokens

cgs-create-control-manifest

Use for create control manifest tasks that define implementation rules, boundaries, allowed dependencies, validation commands, and review gates; produce verification evidence, changed or proposed files, and handoff boundaries.

merlinhu1/codex-game-studio · 44 tokens

cgs-regression-suite

Use for regression suite tasks that define or run regression coverage for changed systems, prior bugs, critical paths, and release blockers; produce verification evidence, changed or proposed files, and handoff boundaries.

merlinhu1/codex-game-studio · 45 tokens