Home

Awesome

Quick Start

Ape compiler plugin around the Starknet Cairo language.

Dependencies

Requirements

Installation

via pip

You can install the latest release via pip:

pip install ape-cairo

via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

git clone https://github.com/ApeWorX/ape-cairo.git
cd ape-cairo
python3 setup.py install

Quick Usage

ape-cairo can compile,

✿ Scarb Projects

Scarb binary is required to compile Scarb projects. Please add it to your $PATH if you have not done so.

Now, when compiling, Ape will use the command scarb build. You can specify the Scarb manifest file (Scarb.toml) in your ape-config.yaml file:

cairo:
  scarb_manifest: /Users/home/path/to/scarb/project/Scarb.toml

❂ Other Cairo Projects

Cairo compiler binaries are required to compile other Cairo projects.

Please add them to your $PATH. You can verify them by doing:

which sierra-compile

and

which starknet-compile

or you can specify the Cairo manifest path in your ape-config.yaml file:

cairo:
  cairo_manifest: /Users/home/path/to/cairo/Cargo.toml

If you have a package that defines cairo_project.toml file, you can also specify the package manifest path in your ape-config.yaml file, if it is not in the directory where ape-config.yaml is located.

cairo:
  package_manifest: /Users/home/path/to/package/cairo_project.toml

★ Using the Compiler

In a project directory where there are .cairo files in your contracts/ directory, run the compile command:

ape compile

It should compile your Cairo contracts. You can find the compiled contract artifacts (Sierra/Casm) in the .build/ folder.

You can also get debug outputs by running the command with the --debug flag.

ape compile -v DEBUG

Manage Cairo Project Dependencies

ape-cairo can manage your Cairo project dependencies. See Ape documentation. But, it is recommended to use Scarb for managing dependencies in Scarb projects.

Ape Config Parameters

Development

Please see the contributing guide to learn more how to contribute to this project. Comments, questions, criticisms and pull requests are welcomed.