Skip to content
openzeppelin avatar

Setup Solidity Contracts

Setup guide for Solidity projects with OpenZeppelin Contracts across Hardhat and Foundry, including upgradeable variants.

CCM score
74 of 100
skills.sh installs
631
GitHub stars
226
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers project creation, OpenZeppelin dependency installation, and Foundry remapping configuration for both standard and upgradeable contracts
  • Provides npx hardhat init or --init commands for Hardhat v2 and v3, and forge init plus forge install for Foundry
  • Requires pinning Foundry installs to a release tag, since an unpinned install pulls the default branch, which may be unstable
  • Designed for developers starting a new Hardhat or Foundry project, or adding OpenZeppelin imports to an existing one

Install

$ npx -y skills add openzeppelin/openzeppelin-skills --skill setup-solidity-contracts -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Solidity Setup

For existing projects, detect the framework by looking for hardhat.config.* (Hardhat) or foundry.toml (Foundry). For new projects, ask the user which framework they prefer.

Hardhat Setup

  • Initialize project (only if starting a new project)
npx hardhat init        # Hardhat v2
npx hardhat --init      # Hardhat v3
  • Install OpenZeppelin Contracts:
npm install @openzeppelin/contracts
  • If using upgradeable contracts, also install the upgradeable variant:
npm install @openzeppelin/contracts-upgradeable

Foundry Setup

  • Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
  • Initialize project (only if starting a new project)
forge init my-project
cd my-project
  • Add OpenZeppelin Contracts:
forge install OpenZeppelin/openzeppelin-contracts@v<VERSION>
  • If using upgradeable contracts, also add the upgradeable variant:
forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v<VERSION>

Details

Repository
github.com/openzeppelin/openzeppelin-skills
Categories
Web3 & Crypto, Technical Documentation
First seen
Jun 3, 2026

Questions

What does the setup-solidity-contracts skill do?

It sets up a Solidity smart contract project with OpenZeppelin Contracts. It covers creating a new Hardhat or Foundry project, installing OpenZeppelin Contracts dependencies, configuring Foundry remappings, and explaining Solidity import conventions.

How do I install the setup-solidity-contracts skill?

Run npx -y skills add openzeppelin/openzeppelin-skills --skill setup-solidity-contracts -y in your project. The skill then lets your agent set up a Hardhat or Foundry project with OpenZeppelin Contracts.

Does it support upgradeable OpenZeppelin contracts?

Yes, the skill covers installing the upgradeable variant, @openzeppelin/contracts-upgradeable, for Hardhat and Foundry. It also gives the Foundry remappings needed for upgradeable contracts and Etherscan verification.

Where does this skill stand in the Web3 & Crypto category?

It sits in the Web3 & Crypto category alongside solana-dev, binance-agentic-wallet, okx-dex-market, gmgn-market and gmgn-token. It is aimed at Solidity developers starting an EVM project with OpenZeppelin Contracts.

More from openzeppelin/openzeppelin-skills

All 5

Similar to Setup Solidity Contracts

More Web3 & Crypto