Skip to content

Latest commit

 

History

History
119 lines (64 loc) · 8.3 KB

File metadata and controls

119 lines (64 loc) · 8.3 KB

🚀 Smart Contract Development on Polkadot

Polkadot enables smart contract development with pallet-revive. This allows using familiar Ethereum tools and libraries while leveraging Polkadot’s robust ecosystem.

Please provide feedback on your experience deploying smart contracts on Polkadot using this feedback form.

Refer to the known issues document if you're running into issues deploying contracts or using any of the tools below. If you have a new bug or problem, please raise an issue in the Contracts Bug tracker on Github.

🚀 Quick Start with DevContainers

  • To speed things up and have your "batteries included" dev environment, you can use DevContainers. They are regularly maintained and tested by the ecosystem professionals. You can find the configuration for Polkadot smart contract development in the smart-contracts-devcontainer repository.
  • To use it, you need to have Docker or Podman installed and running on your machine. You also need the Vscode extension for DevContainers. You can install it from the VSCode Marketplace.
  • Once Docker is running and the DevContainers extension is installed, simply create a new folder and run the following command to get started:
curl -fsSL https://raw.githubusercontent.com/paritytech/smart-contracts-devcontainer/main/.devcontainer/fetch-devcontainer.sh | bash -s --

GitHub enforces a rate limit per hour. If you run into this, just follow the Hardhat path shown in the next section.

📚 Solidity Development Environments

There are multiple development environments already available for Polkadot smart contract development. Here are some of the most popular ones:

  • [RECOMMENDED] Hardhat - a popular Ethereum development environment that can be used for Polkadot smart contract development with the help of custom plugins.

  • 🤠 Foundry - a smart contract development toolchain that manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the contracts.

🦀 Rust Contracts

Besides Solidity, you can also write smart contracts in Rust using ink! — the go-to language for Rust-based smart contract development on Polkadot. Check out the ink! Docs to get started.

👨‍💻 Contract Interaction Libraries

Several libraries can be used to interact with smart contracts deployed on Polkadot for both Solidity and Rust.

Solidity

ink!

📚 Tutorials and Guides

Here you can find some useful tutorials and resources to help you get started with smart contract development on Polkadot:

🔑 How to Connect to Polkadot Hub Testnet

You can use any Ethereum-compatible wallet wallet to connect to Polkadot Hub Testnet. Follow the Connect your Wallet guide to connect using MetaMask. We also recommend using Talisman, which is built for both Polkadot and Ethereum.

Quick Setup: Use Chainlist to automatically configure Passet Hub in your wallet with one click.

Testnet details:
* Network name: Passet Hub
* Chain ID: 420420422
* RPC URL: https://testnet-passet-hub-eth-rpc.polkadot.io
* Block Explorer URL: https://blockscout-passet-hub.parity-testnet.parity.io/

💧 Polkadot Faucet

Need testnet tokens? Get some from the Testnet Faucet 💧

Note: Make sure you've selected the Passet Hub chain on the Paseo network!

🏆 Starter Templates

Jumpstart your smart contract dApp with these templates:

  • create-polkadot-dapp - a scaffolding tool to generate project boilerplates. Explore the react-solidity template located in the templates folder which comes pre-configured with React, Tailwind CSS, and Ethers.js for frontend interaction with your smart contracts

  • create-dot-app - a comprehensive scaffolding tool with Solidity templates for both React and Vue, making it easy to get started with smart contract development on Polkadot

  • hardhat-polkadot-example - a demo for how to use Hardhat with Polkadot.

Vibe coding with AI: LLM configuration helper

  • If using AI tools like LLMs, remember to direct them to use the most up-to-date documentation.

  • For AI Coding Assistants: Use the Agents.md file as context for your coding agents (Claude Code, Cursor, etc.). This comprehensive guide includes network configurations, deployment strategies, common errors, and troubleshooting steps. Copy it to your project root or reference it in your AI assistant's context. Note: kitdot automatically includes this file in new projects.

  • Especially if you are using Claude, this document contains configuration settings for using the testnet to deploy smart contracts, and we recommend informing your LLM to refer to it.