ape-cairo: A compiler plugin for the cairo programming language
Project description
Quick Start
Ape compiler plugin around the Cairo language.
Dependencies
- python3 version 3.8 or greater, python3-dev
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
In a project directory where there are .cairo
files in your contracts/
directory, run the compile
command:
ape compile
Configure Dependencies
You can configure dependencies, such as from GitHub
, using your ape-config.yaml
file.
There are two things you need to add:
- Add your dependency to Ape's root
dependencies:
key to trigger downloading and compiling it. - Configure the
ape-cairo
plugin to load that dependency in your project.
For more information on dependencies, see this guide.
Your ape-config.yaml
will look something like:
dependencies:
- name: OpenZeppelinCairo
github: OpenZeppelin/cairo-contracts
version: 0.1.0
contracts_folder: src
cairo:
dependencies:
- OpenZeppelinCairo@0.1.0
NOTE: We are changing the contracts/
folder to be src
for this dependency.
Now, in my contracts/
folder, I can import from openzeppelin
:
from openzeppelin.token.erc20.library import (
ERC20_name,
ERC20_symbol,
ERC20_totalSupply,
ERC20_decimals,
ERC20_balanceOf,
ERC20_allowance,
ERC20_mint,
ERC20_burn,
ERC20_initializer,
ERC20_approve,
ERC20_increaseAllowance,
ERC20_decreaseAllowance,
ERC20_transfer,
ERC20_transferFrom
)
Development
This project is in development and should be considered a beta. Things might not be in their final state and breaking changes may occur. Comments, questions, criticisms and pull requests are welcomed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ape_cairo-0.5.0a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 747d5f3fbd0b46b29b723ef4a999fbfbd399bd3fa68525ecbf8e2cf5e3627609 |
|
MD5 | 8f8c675af0b9d0852ae08ac6eb231a06 |
|
BLAKE2b-256 | 58515a725ce0ee3e68cdbf980fd60a245047b3249e7211c899d773d14b4fb7a0 |