Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

open-dust/cairo-foundry

Folders and files

NameName
Last commit message
Last commit date
Jun 24, 2022
Jan 18, 2023
Jun 24, 2022
Dec 1, 2022
Jun 24, 2022
Feb 20, 2023
Feb 20, 2023
Jan 20, 2023
Jun 24, 2022
Jan 20, 2023
Jun 24, 2022
Jun 24, 2022
Dec 27, 2022
Feb 20, 2023
Feb 20, 2023
Jun 17, 2022
Feb 8, 2023
Nov 24, 2022
Nov 24, 2022
Nov 24, 2022
Jan 18, 2023

Repository files navigation

cairo-foundry

Blazingly fast testing framework for Starknet contracts development inspired by Foundry πŸ¦€ πŸ”₯


⚠️ WARNING! ⚠️

This repo contains highly experimental code. Expect rapid iteration & frequent breaking changes.


πŸ—οΈ Architecture

Flow Diagram:

cairo-foundry-architecture-diagram


Objective: match Foundry and/or Protostar utils functions

cairo-foundry

🎟️ 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

  1. Cairo-Foundry uses Rust as its main programming language. To install it πŸ¦€, follow the install steps for the Rust programming language.

  2. For now, Cairo-Foundry relies on cairo-compile, a Starkware program used to compile Cairo. To install cairo-compile, you'll need to install cairo-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, a cairo-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 for cairo-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 install1 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 project
    • cargo 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.

Footnotes

  1. If you haven't installed poetry yet, run: curl -sSL https://install.python-poetry.org | python3 - ↩

About

Foundry like framework for starknet contracts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published