Supported protocols • Chainstack blog • Chainstack docs • Blockchain API reference • Start for free
This tutorial will show you how to create a simple smart contract in Cairo to save and retrieve a variable and then deploy it on the StarkNet testnet using ProtoStar.
Cairo is a relatively new language that powers StarkNet's smart contracts; it is worth learning more about it!
In this repo you will find the project with the smart contract and the compiled files in the protostar-project
directory.
See Deploy a simple storage smart contract on StarkNet for the entire tutorial.
- Linux or macOS
- Protostar development tool
To use this Protostar project:
curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash
-
Clone this repository.
-
Go into the Protostar project's directory:
cd protostar-project
- Compile the smart contract
protostar build
- Deploy the smart contract
protostar deploy ./build/main.json --network testnet
Now the smart contract is deployed and you can interact with it. See the interact with the deployed contract section of the tutorial for instructions.