openzeppelin
Installation
SKILL.md
Develop Smart Contracts with OpenZeppelin
Adapted from OpenZeppelin's official skill for Scaffold-ETH 2 Solidity projects.
Prerequisites
Check if ./packages/nextjs/scaffold.config.ts exists directly in the current working directory (do not search subdirectories). If it doesn't exist, this is not a Scaffold-ETH 2 project. Follow the instructions at https://docs.scaffoldeth.io/SKILL.md to scaffold it first. If it exists, continue directly with building.
Detect the Solidity framework flavor:
- If
packages/hardhatexists → Hardhat flavor - If
packages/foundryexists → Foundry flavor
Core Principle: Prefer Library Components Over Custom Code
Before writing ANY contract logic, search the installed OpenZeppelin library for an existing component:
- Exact match exists? Import and use it directly — inherit, override only what's needed
- Close match exists? Import and extend — override only functions the library marks as
virtual - No match? Only then write custom logic. Confirm by browsing the library's directory first