Get Started with Smart Contracts¶
Introduction¶
This page collects the starting points for building smart contracts on pallet-revive. Start with a local development environment, then connect to a live network such as Polkadot Hub when you are ready to deploy. To run pallet-revive on your own chain, see Add pallet-revive to Your Runtime.
pallet-revive runs contracts on two backends. REVM executes standard EVM bytecode and is the default choice for existing Solidity projects. PVM runs contracts compiled to PolkaVM with resolc; it is newer, and its tooling is still maturing.
Build and Test Locally¶
Run a local chain and iterate on your contracts before deploying anywhere. The local development node serves Ethereum JSON-RPC at http://127.0.0.1:8545.
| Title | Difficulty | Tools | Description |
|---|---|---|---|
| Local Development Node | 🟢 Beginner | Polkadot SDK node | Spin up a local node for iterative development. |
| Hardhat Polkadot | 🟢 Beginner | N/A | Compile, test, and deploy Solidity contracts to PVM with Hardhat. |
| OpenZeppelin Contracts Wizard for Polkadot | N/A | OpenZeppelin | Generate ERC-20, ERC-721, and other OpenZeppelin-standard contracts without writing code |
| Rust for PVM | N/A | Cargo-pvm-contract, Pallet-revive-uapi | Write PVM smart contracts natively in Rust and build them into PolkaVM program blobs |
Ethereum Tool Differences on Polkadot EVM¶
Tools like Foundry and Hardhat are built for standard Ethereum nodes. A chain running pallet-revive exposes the same Ethereum JSON-RPC interface through the eth-rpc adapter, but executes contracts in a different environment (a Polkadot SDK runtime with the REVM or PVM backend). As a result:
- Local tests (for example,
forge testor Hardhat's default network) run in the tool's own EVM, not in pallet-revive, so behavior can differ from the real chain. - Time and snapshot helpers (for example,
evm_increaseTimeorloadFixture) are often not supported by the adapter. - Gas reports from these tools may not match the gas charged on-chain.
To check chain-specific behavior, run your contracts against a local development node. For more details, see EVM vs PVM, Gas Model, and Contract Deployment. Guides for using third-party tools such as Remix, Foundry, and vanilla Hardhat are on the Polkadot Developer Docs.
Connect to a Network¶
When you are ready to deploy to a live network, see Connect to Polkadot on the Polkadot Developer Docs for network details, test tokens, and block explorers.
Ethereum Developer Resources¶
Learn how pallet-revive differs from Ethereum: account mapping, gas and fees, JSON-RPC, and deployment.
| Title | Description |
|---|---|
| Accounts | How 20-byte Ethereum addresses map to 32-byte Polkadot accounts. |
| Gas Model | Gas vs. weight, proof size, storage deposits, and fees. |
| Contract Deployment | Deployment mechanics, gas estimation, and storage model. |
| EVM vs PVM | Compare EVM and PVM architectures, gas models, and key differences. |
| JSON-RPC APIs | Supported Ethereum JSON-RPC methods and examples. |
Cookbook: Hands-on Tutorials¶
Follow step-by-step guides that walk through common tasks and complete dApp examples.
| Tutorial | Tools | Description |
|---|---|---|
| Deploy a Basic Contract | Remix | Minimal deployment walkthrough |
| Deploy an ERC-20 | Remix, OpenZeppelin | Create, deploy, and mint a fungible token |
| Deploy an NFT (ERC-721) | Remix, OpenZeppelin | Build and deploy an NFT collection |
| Uniswap V2 | Hardhat | Full dApp project: compile, test, deploy |
| Zero‑to‑Hero dApp | Multiple | End‑to‑end dApp patterns and practices |
Libraries¶
pallet-revive exposes the standard Ethereum JSON-RPC API through the eth-rpc adapter, so Ethereum client libraries such as ethers.js, viem, and wagmi work unchanged. Setup guides for these libraries are in the Polkadot Developer Docs.
Integrations¶
Wallets and other integrations for dApps are covered in the Polkadot Developer Docs.
Precompiles¶
Discover the precompiles that pallet-revive implements and how to use them.
| Title | Description |
|---|---|
| Ethereum Native | EVM precompiles and interfaces. |
| ERC-20 | Interact with Assets pallet assets using standard ERC-20 interfaces. |
| System | Access core runtime functionality and cryptographic operations from smart contracts. |
| Storage | Access low-level contract storage with reads, writes, and key inspection. |
| XCM | Cross-chain messaging helpers for contracts. |
| Custom Precompiles | Expose your own runtime logic to smart contracts through a precompile. |
From here, iterate locally with the development node and Hardhat Polkadot, connect to a network when you are ready, and use the guides, libraries, integrations, and precompiles as you grow into production-ready dApps. If you get stuck, open an issue or reach out in the community channels.
| Created: January 14, 2026