Let's make a folder for your project. We are going to use the ink! CLI to help us with this.
cargo contract new my_contract
This command creates a new folder named
This folder contains a
Cargo.toml file and a
lib.rs file. The
lib.rs file is an example of a very simple ink! smart contract. When writing your own smart contracts, feel free to edit the files accordingly.
An off-chain test environment is provided by ink! to quickly test our code. First, let's build the files.
cargo +nightly build
Then to run the test,
cargo +nightly test
You should see the output of 2 successful tests in your command line.
Any questions? Feel free to ask us.