erc

Generate wallet-ready ERC method bindings with per-function files and selector registry updates.

1|Updated Jul 22, 2025
One-click install
npx skills add https://github.com/niconiahi/ethernauta --skill erc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erc
Source: https://github.com/niconiahi/ethernauta/tree/main/skills/erc
Command: npx skills add https://github.com/niconiahi/ethernauta --skill erc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of adding new Ethereum Request for Comment (ERC) contract standards to Ethernauta without breaking tree-shaking, ABI encoding/decoding, or wallet confirmation behavior.

Core Features & Use Cases

  • Deterministic ERC folder structure: Enforces the consistent packages/erc/src/<n>/ layout so generated methods are importable as @ethernauta/erc/<n> after build.
  • Per-function tree-shakable method files: Uses a one-generated-method-per-file rule to keep bundles minimal by importing only what you need.
  • Wallet confirmation correctness: Requires each method to export a <METHOD>_SIGNATURE sidecar so the wallet can render human-readable confirmations based on selector matching.
  • Two binding shapes for different contract interactions: Produces Callable<T> for view/pure methods and Signable<Bytes> for state-changing methods, matching the wallet’s signing flow.
  • Exact parameter schema conventions: Standardizes method inputs via union(tuple, object) and Valibot parsing so callers can use either tuple or object argument styles safely.
  • Automatic selector registry generation: Ensures new methods are discoverable by regenerating registry.generated.ts rather than editing it by hand.

Quick Start

Ask the skill to help you add a new standard by creating packages/erc/src/<n>/IERC<n>.abi.json, generating one method file per ABI function with the required <METHOD>_SIGNATURE, wiring exports through methods/index.ts and <n>/index.ts, writing a behavioral <n>.test.ts, regenerating the selector registry, then validating the build output.

Frequently Asked Questions about erc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate TypeScript bindings for ERC smart contracts that support wallet signing?

To generate wallet-ready ERC bindings, define the required folder structure under `packages/erc/src/<n>/` and create per-function files. This produces `Callable<T>` for view methods and `Signable<Bytes>` for state-changing methods, ensuring ABI-correct encoding and wallet confirmations work.

Why do I need a separate signature export for each ERC method file?

You need a separate `<METHOD>_SIGNATURE` export for each ERC method file to enable wallet confirmations. The wallet uses this sidecar to render human-readable confirmations by matching the function selector, ensuring users know exactly what state-changing transaction they are signing.

How do I keep ERC method bundles minimal when importing smart contract bindings?

To keep ERC method bundles minimal, the system uses a one-generated-method-per-file rule. This per-function tree-shakable structure ensures you only import the specific methods you need from `@ethernauta/erc/<n>`, preventing unnecessary code from bloating your final bundle.

Can I use tuple or object arguments for Valibot-validated smart contract parameters?

Yes, you can use either tuple or object argument styles safely for smart contract parameters. The system standardizes method inputs via a `union(tuple, object)` convention and uses Valibot parsing to validate the parameters, ensuring ABI-correct encoding and decoding regardless of the argument style.

How do I make new ERC methods discoverable without editing the selector registry by hand?

To make new ERC methods discoverable without manual edits, regenerate the selector registry. The system automatically updates `registry.generated.ts` during the build process, ensuring all newly generated method files are correctly indexed and discoverable without manual intervention.