Back to tutorials
ink! Tutorial:

Creating an ink! Project

Number 1Start, build and test your smart contract!

ink! is an Embedded Domain Specific Language (EDSL) that you can use to write WebAssembly based smart contracts in the Rust programming language.

ink! is just standard Rust in a well defined contract format with specialized #[ink(…)] attribute macros. These attribute macros tell ink! what the different parts of your Rust smart contract represent, and ultimately allow ink! to do all the magic needed to create Substrate compatible Wasm bytecode! Use the ink! CLI to generate an initial smart contract with some scaffolding code. Make sure you are in your working directory, and then run:


Number 2Deploy and interact with your smart contract!

Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quos.


Number 3Frontend development 101

Overview

Now after you wrote, compiled and deployed your smart contract, it is time to craft a user experience around it. While this can take many forms, web apps dominate Web3 today.

JavaScript, as the web's native language, offers the best tools for building these experiences, especially for smart contract interaction. Here, we focus on TypeScript-powered tools that provide both JavaScript flexibility and type safety.


JavaScript and TypeScript Tools

There are several levels of abstraction where you can start your journey creating a web frontend for your contracts. Each levels offers different advantages and disadvantages. The following list is of tools. They are sorted from the most generic no third party library way to interact with Polkadot's smart contracts to the most opinionated template using libraries and proven frontend frameworks.

React


useInkathon is recommended ✅ — a hooks library for the popular frontend javascript framework React with focus on smart-contract interactions. Built using @polkadot/api & @polkadot/api-contract.

React and Next.js


inkathon is recommended ✅ — a full stack web app template using the popular full stack template Next.js. Itself is using useInkathon. The fastest way to get up and running with a smart contract and a corresponding web app.

Using no third party libraries


RPC Interface is not recommended ❌— nodes participating in the blockchain network offer an JSON RPC interface to interact with the blockchains state and capabilities.


Other Languages

Of course the browser and JavaScript should not be the one and only platform for smart contract frontends. It's just the most mature for smart contract frontend tooling.

The following is a list of libraries which could be used to craft smart-contract dApps on other platforms than the web.

Have questions not covered here?