Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 988 Bytes

File metadata and controls

24 lines (15 loc) · 988 Bytes

Cairo Zero example that uses output builtin.

Cairo Zero is a low level language for Cairo, a smart contract language for Starknet Blockchain.

To compile and run Cairo Zero programs, you would need to setup a python environment.

I had success using Conda.

Then, follow instructions from Cairo Zero documentation. I tried to use Python 3.11 but it didn't work. Use Python 3.9!

Once you are in the virtual python environment, compile the contract.

cairo-compile test_with_builtin.cairo --output test_compiled_builtin.json 

And with the output json file, run the following command to visualize the memory layout.

cairo-run \                                                                  
  --program=test_compiled_builtin.json --print_output \
  --print_info --print_segments --print_memory --layout=small