paint-brush
5 Minutes is All You Need to Deploy Your Very First Smart Contract to Polkadot Using This Methodby@brunopgalvao
215 reads

5 Minutes is All You Need to Deploy Your Very First Smart Contract to Polkadot Using This Method

by brunopgalvaoDecember 5th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

This tutorial will guide you on how to deploy a Solidity smart contract to Polkadot.
featured image - 5 Minutes is All You Need to Deploy Your Very First Smart Contract to Polkadot Using This Method
brunopgalvao HackerNoon profile picture

This tutorial will guide you on deploying a Solidity smart contract to Polkadot.

TL;DR;

Prerequisites

You will need the MetaMask wallet:

Smart Contracts on Polkadot

We will be deploying to Asset Hub on the Polkadot test network: "Westend".


Asset Hub is a system parachain on Polkadot.


A parachain is an L1 blockchain that has its blocks finalized by the Polkadot Relay chain.


Add Asset Hub parachain to the MetaMask wallet:

MetaMask (Settings)


Network name: Asset-Hub Westend Testnet

RPC URL URL: https://westend-asset-hub-eth-rpc.polkadot.io

Chain ID: 420420421

Currency Symbol: WND

Block Explorer URL: https://assethub-westend.subscan.io

Get some tokens

Go to the Westend faucet and request some tokens using your Ethereum account:

Westend Faucet


On success, you will have some WND tokens in your account. We are now ready to deploy contracts to Asset Hub!

Deploying to Polkadot

Go to the polkadot-forked REMIX IDE:

REMIX IDE

Compile the _Storage.sol contract.

Compile

Deploy the contract.

Deploy

Make sure to pin the contract so we can interact with it.

Pin


We can now interact with the contract's methods.

Store


Retrieve


Congratulations! You have successfully deployed a Solidity smart contract to Polkadot!

Resources:

Learn: contracts.polkadot.io

Watch: