README.md 1.17 KB
Newer Older
1
2
3
4
5
6
7
8
# ink! code examples

This folder contains a set of example contracts for ink!.

Have a look at the different examples to better understand how to use ink! to build your own Substrate smart contracts.

## Preparation

9
For building the example smart contracts found in this folder you will need to have [`cargo-contract`](https://github.com/paritytech/cargo-contract) installed.
10
11

```
12
cargo install cargo-contract --force
13
14
15
16
17
18
19
20
21
22
```

We use the `--force` to update to the most recent `cargo-contract` version.

## Build example contract and generate the contracts metadata

To build a single example and generate the contracts Wasm file, navigate to the root of the smart contract and run the following command:

`cargo contract build`

23
24
You should now have an optimized `<contract-name>.wasm` file, a `metadata.json` file and a `<contract-name>.contract` file in the `target` folder of your contract.
The `.contract` file combines the Wasm and metadata into one file and can be used for deployment.
25
26
27

## License

28
The entire code within this repository is licensed under the [GPL v3](LICENSE). Please [contact us](https://www.parity.io/contact/) if you have questions about the licensing of our products.