Awesome
<p align="center"> <img width="150" src="resources/img/logo.png"> </p> <div align="center"> <h1 align="center">cairo-foundry</h1> <p align="center"> <a href="https://discord.gg/mCTgxg52"> <img src="https://img.shields.io/badge/Discord-6666FF?style=for-the-badge&logo=discord&logoColor=white"> </a> </p> <h3 align="center">Blazingly fast testing framework for Starknet contracts development inspired by <a href="https://github.com/foundry-rs/foundry"> Foundry 🦀 🔥 </a></h3> </div> <br><br>⚠️ WARNING! ⚠️
This repo contains highly experimental code. Expect rapid iteration & frequent breaking changes.
🏗️ Architecture
Flow Diagram:
</br>Objective: match Foundry and/or Protostar utils functions
🎟️ Description
Cairo-Foundry is a blazingly fast toolkit for Starknet application development. It is comprised of:
- ✅ A testing framework 🦀
- 🗓️ (long-term plan) A modular CLI/SDK to interact with Starknet smart contracts, sending transactions and getting chain data.
- 🗓️ (long-term plan) A local Starknet node wrapper
The short-term goal is to build an efficient test runner for Cairo smart contract development in Rust. Good comparisons are Protostar test suite (written in Python, for Cairo) or - though less comparable - Jest (written in Javascript, for Javascript) and Pytest (written in Python, for Python).
🎗️ Prerequisites
-
Cairo-Foundry uses Rust as its main programming language. To install it 🦀, follow the install steps for the Rust programming language.
-
For now, Cairo-Foundry relies on
cairo-compile
, a Starkware program used to compile Cairo. To installcairo-compile
, you'll need to installcairo-lang
as a python package on your local machine. Follow the install steps for the Cairo programming language.a. For Mac M1 users, if the install does not work, you may need to refer to this issue linked to the M1 chip and
fast-ecdsa
, acairo-lang
dependency package. TL;DR:-
brew install gmp
to install the latest version of the GNU Multiple Precision Arithmetic Library. -
Anytime you interact with pip3, or some python package manager that interacts with
cairo-lang
, you'll need specific flags active. Example for installing dependency package forcairo-lang
:CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip3 install ecdsa fastecdsa sympy
-
📦 Installation
- fork the repository
- create a clone of your fork locally:
git clone https://github.com/<YOUR_HANDLE>/cairo-foundry
- if need be, run
poetry install
1 to synchronise the python packages, though you shouldn't have to if you followed to steps from the Cairo programming language set-up guide, i.e:python3.9 -m venv ~/cairo_venv
source ~/cairo_venv/bin/activate
pip3 install cairo-lang
- You're all set! Run:
cargo run
to compile projectcargo test
to run the repository's tests
🔬 Usage
Coming soon! 👷
🌡️ Testing
Coming soon! 👷
🫶 Contributing
Pull requests are welcome, please check our contribution guidelines.
📄 License
Cairo-Foundry is released under the MIT.