standards

Explain Ethereum token standards with Solidity examples and Foundry tests.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/andginja/ethskills --skill standards-andginja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: standards
Source: https://github.com/andginja/ethskills/tree/main/skills/standards
Command: npx skills add https://github.com/andginja/ethskills --skill standards-andginja

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill clarifies the complexities of Ethereum's essential token standards (ERC-20, ERC-721, ERC-1155, ERC-4626), agent identity (ERC-8004), and advanced transaction protocols (EIP-7702, EIP-3009, x402), preventing common bugs and enabling robust development.

Core Features & Use Cases

  • Standard Explanations: Detailed breakdowns of each standard's interface, purpose, and common pitfalls.
  • Implementation Examples: Practical Solidity code snippets and Foundry tests for each standard.
  • Protocol Integration: Guidance on using EIP-7702 for batch transactions, EIP-3009 for gasless transfers, and x402 for web3 payments.
  • Use Case: A developer needs to implement a new ERC-20 token but is unsure about the decimals() trap or approve() pitfalls. This Skill provides the exact code and warnings to avoid these issues.

Quick Start

Explain the ERC-20 decimals trap and provide a Solidity code example to handle it correctly.

Frequently Asked Questions about standards

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

FAQPage Schema
How do I avoid the ERC-20 decimals trap when implementing a Solidity token contract?

To avoid the ERC-20 decimals trap, you must correctly scale integer values during token transfers. This Skill provides Solidity code examples and OpenZeppelin implementations to handle decimals safely and prevent calculation errors.

What is the difference between ERC-721 and ERC-1155 for Ethereum token development?

ERC-721 defines unique non-fungible tokens individually, while ERC-1155 allows batching multiple token types within a single contract. This Skill explains both Ethereum standards with interface breakdowns and Solidity code snippets.

Can I use EIP-3009 for gasless ERC-20 transfers?

Yes, EIP-3009 enables gasless ERC-20 transfers using meta-transaction signatures. This Skill details how to integrate EIP-3009 protocols to facilitate gasless transfers within your Ethereum smart contracts.

How do I implement an ERC-4626 vault with OpenZeppelin and Foundry?

Implement an ERC-4626 vault using OpenZeppelin base contracts and validate the logic with Foundry tests. This Skill provides practical code examples for the ERC-4626 tokenized vault standard to ensure robust integration.

What are common pitfalls when calling the approve function on ERC-20 tokens?

Common approve pitfalls include front-running vulnerabilities and allowance overwrites during token interactions. This Skill outlines ERC-20 approve risks and provides Solidity code patterns to prevent common development errors.

Does EIP-7702 support batch transactions for smart EOAs?

Yes, EIP-7702 supports batch transactions by assigning smart contract code to externally owned accounts. This Skill provides protocol integration guidance for using EIP-7702 to enable advanced smart EOA batch functionalities.