Ape compiler plugin around the Starknet Cairo language.
- python3 version 3.9 up to 3.11.
- (Recommended) If you have Scarb project, please install Scarb .
# Install via quick installation script
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
or
# Install via asdf version manager
asdf plugin add scarb
asdf install scarb latest
asdf global scarb latest
You can install the latest release via pip
:
pip install ape-cairo
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
ape-cairo
can compile Scarb projects that defines Scarb.toml
file.
Scarb binary is required to compile Scarb projects. Please add it to your $PATH if you have not done so.
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/
directory.
You can also get debug outputs by running the command with the
-v DEBUG
flag.ape compile -v DEBUG
See the examples directory for examples.
Please see the contributing guide to learn more how to contribute to this project. Comments, questions, criticisms and pull requests are welcomed.