openzeppelin/openzeppelin-skills

setup-cairo-contracts

Set up a Cairo smart contract project with OpenZeppelin Contracts for Cairo on Starknet.

First seen Mar 5, 2026

Installation

$ npx skills add openzeppelin/openzeppelin-skills --skill setup-cairo-contracts

Summary

  • Set up a Cairo smart contract project with OpenZeppelin Contracts for Cairo on Starknet.
  • Use when users need to: (1) create a new Scarb/Starknet project, (2) add OpenZeppelin Contracts for Cairo dependencies to Scarb.toml, (3) configure individual or umbrella OpenZeppelin packages, or (4) understand Cairo import conventions and component patterns for OpenZeppelin.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from openzeppelin/openzeppelin-skills · top by installs.

npx skills add openzeppelin/openzeppelin-skills

Browse all from openzeppelin/openzeppelin-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 208
License LICENSE
Default branch main
Open issues 3
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseAGPL-3.0-only
More metadata
author
OpenZeppelin

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,664 B
  • docs SUMMARY.md 395 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 171 installs

SKILL.md

Cairo Setup

Project Scaffolding

Install toolchain and create a project:

curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh
scarb new my_project --test-runner=starknet-foundry

This scaffolds a complete Starknet project with snforge testing preconfigured.

OpenZeppelin Dependencies

Look up the current version from https://docs.openzeppelin.com/contracts-cairo before adding. Add to Scarb.toml:

Full library (umbrella package):

[dependencies]
openzeppelin = "<VERSION>"

Individual packages (faster builds — only compiles what you use):

[dependencies]
openzeppelin_token = "<VERSION>"
openzeppelin_access = "<VERSION>"

Available individual packages: openzeppelinaccess, openzeppelinaccount, openzeppelinfinance, openzeppelingovernance, openzeppelininterfaces, openzeppelinintrospection, openzeppelinmerkletree, openzeppelinpresets, openzeppelinsecurity, openzeppelintoken, openzeppelinupgrades, openzeppelin_utils.

openzeppelininterfaces and openzeppelinutils are versioned independently. Check the docs for their specific versions. All other packages share the same version.

Import Conventions

The import path depends on which dependency is declared:

  • Umbrella package (openzeppelin = "..."): use openzeppelin:: as the root
  • Individual packages (openzeppelin_token = "..."): use the package name as the root
// Individual packages
use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl};
use openzeppelin_access::ownable::OwnableComponent;
use openzeppelin_upgrades::UpgradeableComponent;

// Umbrella package equivalents
use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl};
use openzeppelin::access::ownable::OwnableComponent;
use openzeppelin::upgrades::UpgradeableComponent;

Components are integrated via the component! macro, embedded impls, and substorage:

component!(path: ERC20Component, storage: erc20, event: ERC20Event);

#[abi(embed_v0)]
impl ERC20MixinImpl = ERC20Component::ERC20MixinImpl<ContractState>;
impl ERC20InternalImpl = ERC20Component::InternalImpl<ContractState>;