Introduction
⚡️ use.ink helps you easily build safe, efficient smart contracts for Polkadot and Substrate-based blockchains.
🚀 Write smart contracts in ink!, a domain-specific language built on top of Rust — combining safety, performance, and scalability.
🛠 Use familiar Rust tooling like clippy
, cargo
, crates from crates.io
, and popular IDEs for a seamless development experience.
🤝 Interoperability with Solidity: Solidity developers can call ink! contracts just like other Solidity contracts, enabling cross-ecosystem collaboration.
The latest release, v6.0.0-alpha, is an alpha version.
ink! v6.0.0
introduces support for both native ink! and Solidity ABI specifications.
However, Solidity compatibility is still under development and may be incomplete or unstable in this alpha release.
🌎 Deploy ink! smart contracts on blockchains built with the Polkadot SDK. Check supported chains here.
ink! v6 is no longer using WebAssembly and pallet-contracts
!
Instead we migrated to RISC-V, PolkaVM, and pallet-revive
.
Read more about the transition here.
Fast Track
Install Rust and cargo
: Installation Guide.
Download the binary for a local development node here.
# Install our cli tool from the `6.0.0-alpha` release.
# It wraps around `cargo build` to build contracts with optimal
# flags for blockchains. It also allows for deploying + interacting
# with contracts.
$ rustup component add rust-src
$ cargo install cargo-contract@6.0.0-alpha
# Create a simple contract.
$ cargo contract new flipper && cd flipper
$ cargo contract build --release
# Start your local development node in a separate shell session
$ chmod +x ink-node (makes the node's binary executable)
$ ink-node (starts the node, try `./ink-node` if the previous command doesn't work)
# Instantiate this contract on-chain.
$ cargo contract instantiate --suri //Alice --args true -x
# Dry-run a call of it.
$ cargo contract call --suri //Alice --contract 0x… --message get
# Execute a contract call, as a transaction on-chain.
$ cargo contract call --suri //Alice --contract 0x… --message flip -x
Using the Contracts UI
The Contracts UI for ink! v6 uses an alpha version of the interface: https://inkv6alpha.netlify.app/.
-
Upload your contract:
Follow the steps in Deploy your Contract Using the Contracts UI.
-
Interact with your contract:
Learn how in Call your Contract Using the Contracts UI
Where to Deploy your Ink!v6 Contracts
-
To deploy a contract to Passet Hub, you must get PAS tokens. To do so, you can use the Passet Hub Faucet. You need to specify the address where you want to receive the tokens from the faucet.
-
To deploy a contract to the Pop Network, you need to bridge tokens from Paseo (Asset Hub) to Pop. To do so, follow the guide Get tokens on Pop (Testnet).
-
To deploy a contract to the Westend Asset Hub, you must get WND tokens. To do so, you can use the Westend Faucet. You need to specify the address where you want to receive the tokens from the faucet.
- Passet Hub: A stable, community-maintained testnet running the current Polkadot relay chain runtime. Ideal for testing parachains and smart contracts before mainnet deployment.
- Westend: an unstable environment for core protocol developers to preview upgrades and changes to the main protocol.
- Pop: A network for experimenting with smart contracts and cross-chain interoperability.
For an overview of all currently supported chains, check the supported chains here.
Smart Contract Examples
Our "Hello, World!".
» view example
An ERC-20 implementation.
» view example
An upgradeable contract.
» view example
A multi-signature wallet.
» view example
Allow runtime access.
» view example