cairo-contracts
by OpenZeppelin
A secure and modular library of smart contract components written in Cairo for developing on Starknet, a decentralized ZK Rollup.
OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup
Primary Use Case
This tool is used by blockchain developers to build secure, reusable smart contracts on Starknet using the Cairo programming language. It simplifies the development process by providing audited, standard contract implementations like ERC20 tokens, enabling faster and safer deployment of decentralized applications.
- Secure smart contract components written in Cairo
- Support for Starknet, a decentralized ZK Rollup
- Modular design allowing selective dependency inclusion
- Pre-built ERC20 token contract implementation
- Comprehensive documentation and interactive contract generator
- Integration with Scarb build system
- Open source with active maintenance by OpenZeppelin
Installation
- Install Cairo and Scarb following https://docs.swmansion.com/scarb/download
- Create a new project with `scarb new my_project && cd my_project`
- Edit `Scarb.toml` and add the dependency, e.g., `openzeppelin = "3.0.0-alpha.0"` or `openzeppelin_token = "3.0.0-alpha.0"`
- Build the project with `scarb build` to download and compile dependencies
Usage
>_ scarb new my_project && cd my_projectCreates a new Cairo project and navigates into it
>_ scarb buildBuilds the project and downloads the OpenZeppelin Cairo contracts dependencies
>_ git clone [email protected]:OpenZeppelin/cairo-contracts.gitClones the cairo-contracts repository locally for development or contribution
>_ scarb build -wBuilds the cloned project in watch mode for development
>_ snforge test -wRuns the test suite in watch mode
>_ Use example ERC20 contract code in `src/lib.cairo`Demonstrates how to implement an ERC20 token contract using the OpenZeppelin Cairo library
- Integrate this library into CI/CD pipelines to enforce secure smart contract standards automatically.
- Use the modular design to create minimal attack surface contracts, reducing exploitable code.
- Combine with blockchain security scanners to detect vulnerabilities early in development.
- Leverage the interactive contract generator to educate developers on secure contract patterns.
- Employ as a baseline for purple team exercises simulating smart contract exploitation and defense.
Docs Take 2 Hours. AI Takes 10 Seconds.
Ask anything about cairo-contracts. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.
This tool hasn't been indexed yet. Request indexing to enable AI chat.
Admin will review your request within 24 hours
Related Tools
PayloadsAllTheThings
swisskyrepo/PayloadsAllTheThings
A list of useful payloads and bypass for Web Application Security and Pentest/CTF

hoppscotch
hoppscotch/hoppscotch
Open source API development ecosystem - https://hoppscotch.io (open-source alternative to Postman, Insomnia)
ImHex
WerWolv/ImHex
🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.

termux-app
termux/termux-app
Termux - a terminal emulator application for Android OS extendible by variety of packages.

sentry
getsentry/sentry
Developer-first error tracking and performance monitoring
CheatSheetSeries
OWASP/CheatSheetSeries
The OWASP Cheat Sheet Series was created to provide a concise collection of high value information on specific application security topics.
