Reddio Cairo
This is the Reddio Cairo repo which contains some Cairo templates.
Compile & Build
Since Cairo is still in the early stages of development, the tools are constantly updated. Here, we use the Cairo CLI (Command Line Interface) to compile contracts.
Configure Environment
To use the Cairo CLI, we need to install Rust and clone the Cairo repo.
-
Download Rust
-
Install Rust:
rustup override set stable && rustup update
-
Verify that Rust is installed correctly:
cargo version
-
Clone the Cairo repo locally:
git clone https://github.com/starkware-libs/cairo
Compile Contracts
-
Switch to the Cairo repo folder locally:
cd cairo -
Use the following command to compile the Cairo contract into a Sierra ContractClass。 Replace
/path/to/input.cairowith the contract file directory, and/path/to/output.jsonwith the directory of the compiled output file.:cargo run --bin starknet-compile -- /path/to/input.cairo /path/to/output.json
On this page
Contributors
Created May 25, 2023
Updated May 25, 2023