Book a free call

How to Develop and Deploy a Polkadot Smart Contract

A Polkadot smart contract runs on Asset Hub or a parachain, written in ink! or Solidity. Here is the toolchain, the 7 build steps and the testnet deploy.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How to Develop and Deploy a Polkadot Smart Contract
On this page

Short answer

A Polkadot smart contract is a program that runs on a contract chain such as Polkadot Asset Hub, written in ink! (Rust) or Solidity, and deployed with the cargo-contract CLI or a Solidity toolchain. You build it locally, test it, map your account on the revive pallet, then deploy it to the Paseo Asset Hub testnet before any live launch.

What is a Polkadot smart contract?

A Polkadot smart contract is a small program that runs on a chain in the Polkadot network and carries out rules automatically once it is deployed. It stores state on chain, takes calls from wallets and apps, and changes that state only when its own rules allow it.

Polkadot itself does not run contracts on its relay chain. Contracts run on chains built for them, such as Polkadot Asset Hub, or on parachains such as Astar. Your app talks to the contract through a wallet and a JavaScript or Rust client, and every call is a signed transaction that costs a small fee.

Most teams write contracts in one of two languages. ink! is a Rust-based language made for Polkadot, and Solidity is the language of Ethereum contracts, which now also runs on Polkadot chains through the revive pallet. The choice shapes your tools, your testing and your hiring, so decide it before you write code.

Should you write in ink! or Solidity?

Pick the language that matches your team, not the one that sounds newer. A Rust team will move faster with ink!, while a team that already ships Ethereum contracts will move faster with Solidity on the revive pallet.

Pointink! (Rust)Solidity (revive)
LanguageRust, with the ink! macrosSolidity, as on Ethereum
Runs onPolkaVM through pallet-revivePolkaVM through pallet-revive
Toolchaincargo-contract CLIStandard Solidity toolchain
Code reuseOpenBrush librariesOpenZeppelin contracts
Team fitRust and Substrate teamsEthereum and EVM teams
Risk to noteSmaller hiring poolNewer path on Polkadot

ink! version 6 targets pallet-revive and compiles to PolkaVM, the virtual machine that Polkadot contract chains now use. Older guides that mention pallet-contracts and WebAssembly describe the previous setup, so check the date on any tutorial before you follow it.

One fact to weigh in 2026: the ink! Alliance announced in January 2026 that further ink! language development was deprioritised after funding talks ended. ink! version 6 still works, and existing contracts keep running, but a team starting today should know that Solidity on revive is the path with the larger community behind it.

What tools do you need before you start?

Set up the toolchain once and the rest of the work is ordinary contract code. You need Rust, the cargo-contract command line tool, a wallet with test tokens, and a way to call the contract from a front end.

ToolWhat it doesNotes
Rust and cargoBuilds ink! contractsAdd the rust-src component first
cargo-contractCreates, builds and deploys contractsInstall with cargo install --locked
Polkadot.js walletSigns testnet transactionsBrowser extension, free
Paseo Asset HubPublic testnet for contractsTest tokens from the Paseo faucet
Contracts UIDeploys and calls contracts in a browserGood for a first manual test
Polkadot-API (PAPI)Type-safe calls from a web appHas an ink! SDK for front ends

For a Solidity contract you swap the first two rows for a Solidity compiler and a deploy script, and keep the rest. The wallet, the testnet and the front-end client stay the same either way.

How do you develop a Polkadot smart contract in 7 steps?

Follow these steps in order and you will have a tested contract on a public testnet. Each step has a clear output, so you can tell at once when something is wrong.

  1. Define the contract in one paragraph. Write down what it stores, who can call each function, and what must never happen. A ticket-sale contract, for example, stores ticket prices, seat counts and buyers, and must never sell the same seat twice.
  2. Pick the language and the chain. Choose ink! or Solidity, then choose where the contract will run: Paseo Asset Hub for testing, and Asset Hub or Astar for a live launch.
  3. Scaffold the project. For ink!, run cargo contract new and open the generated code. It already contains a small storage struct, a constructor and one message you can build on.
  4. Write the messages and the checks first. Add the functions your app needs, and put the safety checks at the top of each one: check the caller, check the payment, then change state. Tests are easier to write when the rules sit in one place.
  5. Write unit tests next to the code. ink! contracts carry Rust tests in the same file, so run them with cargo test before you touch a chain. A test that buys a ticket twice and expects the second call to fail is worth more than a long review.
  6. Build the contract file. Run cargo contract build --release. It produces a .contract file that bundles the PolkaVM code with the metadata your front end needs.
  7. Try it on a local node, then on testnet. A local node with the revive pallet catches most errors for free. Only move to Paseo Asset Hub once the local run passes, because testnet tokens and time are both limited.

How do you deploy to a testnet?

Deploying to Paseo Asset Hub takes a few minutes once your wallet is ready. The chain is the public testnet for Polkadot contracts, so treat it as a rehearsal for the live network.

First, get test tokens from the Paseo faucet and pick the Paseo Asset Hub network. Then map your account: on revive chains, a native Substrate account must be linked to an Ethereum-style address before it can deploy or call a contract. You do this with the revive mapAccount call in Polkadot.js Apps, under Developer, then Extrinsics.

Next, deploy with the command line or the Contracts UI. With cargo-contract you run cargo contract instantiate, pass the constructor name and its arguments, point at the Paseo Asset Hub endpoint, and add --execute to send the transaction. The output gives you the contract address and the code hash; save both, because your front end needs the address.

Finally, call the contract from the Contracts UI once by hand before you wire up the front end. Send a real transaction, read the state back, and check that the result matches what your tests predicted. If a call fails, the error message names the failing check, which usually points straight at the bug.

Example (hypothetical): a ticket-sale contract for a small venue

Example (hypothetical): a venue with 200 seats wants to sell tickets on chain. The team writes an ink! contract that stores the price, the seats sold and the buyer of each seat, and refuses a sale when a seat is already taken.

The build budget is $85,000: $60,000 for two developers over six weeks, $15,000 for an outside audit, and $10,000 for testnet work, tooling and the first live deployment. That adds up to $60,000 + $15,000 + $10,000 = $85,000.

On sale night the contract sells 200 tickets at $25 each, which is 200 x $25 = $5,000 in sales. Each buyer call costs about $0.40 in fees, so 200 calls cost 200 x $0.40 = $80. The team checks the contract state after the sale and finds 200 seats marked sold, 0 seats sold twice, and $5,000 held in the contract, which matches the plan exactly.

What are the common mistakes?

The most common mistake is writing the contract before writing the rules. If you cannot state in one sentence when a call must fail, the contract will have a gap, and the gap will be found by a user, not by a test.

Another mistake is testing only on a local node and then deploying straight to a live chain. Testnet exists to catch the differences between your machine and a real network, such as fee levels, block times and account mapping. Use it.

Teams also forget access control. A function that anyone can call, such as one that sets the ticket price or withdraws funds, must check the caller first. Put the owner check at the top of the function, not at the bottom, and write a test that calls it from a different account.

Finally, do not skip the audit for a contract that holds money. An audit costs a fraction of what a lost balance costs, and it finds the problems that unit tests miss, such as re-entrancy and arithmetic edge cases.

For a full background on the stack, read our guide to what Substrate is.

To see how Polkadot compares with its rivals, read our Cosmos vs Polkadot guide.

Key takeaways

  • Polkadot contracts run on Asset Hub or a parachain, never on the relay chain
  • ink! v6 targets pallet-revive and PolkaVM; older pallet-contracts guides are out of date
  • ink! language work was deprioritised in January 2026, so weigh Solidity on revive too
  • Map your account with revive mapAccount before you deploy or call a contract
  • Test locally, then on Paseo Asset Hub, and audit any contract that holds money

Frequently asked questions

What language do Polkadot smart contracts use?

ink! (Rust) and Solidity both work on modern Polkadot contract chains, which run the revive pallet and PolkaVM. ink! is the native Rust path, while Solidity lets Ethereum teams reuse their code and tools.

Where do I deploy a Polkadot smart contract for testing?

Use Paseo Asset Hub, the public testnet for Polkadot contracts. Get test tokens from the Paseo faucet, map your account with revive mapAccount, then deploy with cargo-contract or the Contracts UI.

What is cargo-contract?

cargo-contract is the command line tool for ink! contracts. It scaffolds a project, builds the .contract file that bundles code and metadata, and deploys it with the instantiate command.

Do I need to map my account before deploying?

Yes, on revive chains your native Substrate account must be linked to an Ethereum-style address first. You do this with the revive mapAccount call in Polkadot.js Apps before you deploy or call a contract.

Is ink! still a safe choice in 2026?

ink! v6 works and existing contracts keep running, but the ink! Alliance announced in January 2026 that further language development was deprioritised. New teams should compare it with Solidity on revive before committing.

How much does it cost to build a Polkadot smart contract?

A small contract with tests, a testnet deploy and an outside audit often lands near $85,000 for a two-developer team over six weeks. Costs vary with scope, audit depth and front-end work, so treat that figure as a planning band.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a contract on Polkadot? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Blockchain Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call