Create Your Project by Using ink!
Let's make a folder for your project. We are going to use the ink! CLI to help us with this.
1
cargo contract new my_contract
Copied!
This command creates a new folder named my_contract .
1
cd my_contract
Copied!
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.

Test

An off-chain test environment is provided by ink! to quickly test our code. First, let's build the files.
1
cargo +nightly build
Copied!
Then to run the test,
1
cargo +nightly test
Copied!
You should see the output of 2 successful tests in your command line.
Any questions? Feel free to ask us.
Last modified 4mo ago
Copy link
Contents
Test