Giter Site home page Giter Site logo

cairo-foundry's Introduction

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 dependecy 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 - โ†ฉ

cairo-foundry's People

Contributors

tdelabro avatar bernardstanislas avatar eikix avatar anthonybuisset avatar gdnathan avatar bacharif avatar internnos avatar oxlime avatar ptisserand avatar zarboq avatar jdembdr avatar gaetbout avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.