Writing a Substrate Smart Contract with Ink

Exploring Ink syntax and Rust concepts with a Non-Fungible Token smart contract

Ross Bulat
The Block Journal

--

Ink is a smart contract language specifically for use with a Substrate-based blockchain. This talk will delve into a non-fungible token contract written in Ink; we will visit implementations of the minting, transferring and approval functions, and explain the syntax along the way. Ink is indeed built on top of the Rust programming language, so we will explore some Rust concepts here and how they work with our smart contract.

This talk continues from the previous article where we introduced Ink, how to install it along with Rust and Substrate, and how Ink syntax differs to Solidity at a high level. Read that introduction here:

The NFToken contract itself is available on Github in full here.

Note: Ink is in rapid development at the time of writing. This article and the accompanying contract will be enhanced as new Ink features are made public.

--

--

Ross Bulat
The Block Journal

Programmer and Author. @ Parity Technologies, JKRB Investments