Git Product home page Git Product logo

cairo's Introduction

Cairo ๐Ÿบ

โšก Blazing โšก fast โšก compiler for Cairo, written in ๐Ÿฆ€ Rust ๐Ÿฆ€


Report a Bug - Request a Feature - Ask a Question

GitHub Workflow Status Project license Pull Requests welcome

Table of Contents

About

Cairo is the first Turing-complete language for creating provable programs for general computation.

Getting Started

Prerequisites

  • Install Rust
  • Setup Rust:
rustup override set stable && rustup update

Ensure rust was installed correctly by running the following from the root project directory:

cargo test

Compiling and running Cairo files

Compile Cairo to Sierra:

cargo run --bin cairo-compile -- --single-file /path/to/input.cairo /path/to/output.sierra --replace-ids

Compile Sierra to casm (Cairo assembly):

cargo run --bin sierra-compile -- /path/to/input.sierra /path/to/output.casm

Run Cairo code directly:

cargo run --bin cairo-run -- --single-file /path/to/file.cairo

See more information here. You can also find Cairo examples in the examples directory.

For running tests specifically, see here: cairo-test

Compiling Starknet Contracts

Compile a Starknet Contract to a Sierra ContractClass:

cargo run --bin starknet-compile -- --single-file /path/to/input.cairo /path/to/output.json

Or specify the contract path if multiple contracts are defined in the same project:

cargo run --bin starknet-compile -- /path/to/input/crate /path/to/output.json --contract-path path::to::contract

Compile the ContractClass of a CompiledClass:

cargo run --bin starknet-sierra-compile -- /path/to/input.json /path/to/output.casm

Development

Install the language server

Follow the instructions in vscode-cairo.

Roadmap

The next milestone is to reach feature parity with the old Cairo version. You can track the exact progress here.

Support

Project assistance

If you want to say thank you or/and support active development of Cairo:

  • Add a GitHub Star to the project.
  • Tweet about your Cairo work.
  • Write interesting articles about the project on Dev.to, Medium or your personal blog.

Together, we can make Cairo better!

Contributing

First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.

Please read our contribution guidelines, and thank you for being involved!

Authors & contributors

For a full list of all authors and contributors, see the contributors page.

Security

Cairo follows good practices of security, but 100% security cannot be assured. Cairo is provided "as is" without any warranty. Use at your own risk.

For more information and to report security issues, please refer to our security documentation.

License

This project is licensed under the Apache 2.0.

See LICENSE for more information.

cairo's People

Contributors

abdelstark avatar alon-ti avatar amosstarkware avatar arielelp avatar bbrandtom avatar dorimedini-starkware avatar enitrat avatar ericnordelo avatar gaetbout avatar gilbens-starkware avatar ilyalesokhin-starkware avatar jamestark avatar liorgold2 avatar lucaslvy avatar maciejka avatar maciektr avatar milancermak avatar mkaput avatar orizi avatar piotmag769 avatar spapinistarkware avatar szymmis avatar tarrencev avatar tdelabro avatar tomerstarkware avatar tserg avatar wraitii avatar xjonathanlei avatar yuvalsw avatar zuphitf avatar

Watchers

 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.