Overview
Cairo By Example is a project that aims to provide minimal StarkNet contract examples in the Cairo programming language. It is deployed and can be accessed at cairo-by-example.xyz. The project is still in the early and experimental phase and has not been audited or reviewed for security vulnerabilities. Therefore, it is not recommended for production use.
Features
- Verbosely documented minimal StarkNet contract examples
- Contracts defined and available for extensible use in the contracts subdirectory
Installation
To use Cairo By Example, follow these steps:
- Clone the repository.
- Install the required dependencies.
- Run the project locally.
- Compile the contracts.
- Run tests.
Additional installation instructions can be found in the cairo-lang documentation. Before installing Cairo on your machine, make sure to install gmp. If you encounter any issues with the installation on an Apple M1 computer, refer to the list of potential solutions provided.
For Visual Studio Code (VSCode) support, download cairo-0.6.2.vsix
from the GitHub releases page and follow the instructions for setup.
To set up the environment, navigate to the cloned repository and create a Python virtual environment called Nile. Then, install the Nile dev environment to obtain the Cairo language, a local network, and a testing framework.
Summary
Cairo By Example is a project that provides minimal StarkNet contract examples written in the Cairo programming language. It is deployed and can be accessed at cairo-by-example.xyz. The project is still in the early and experimental phase and should not be used in production environments due to potential security vulnerabilities. Installation instructions are provided to clone the repository, install dependencies, compile contracts, and run tests. Additional instructions and support for Visual Studio Code are available.