JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2668
  • Score
    100M100P100Q128389F
  • License AGPL-3.0

Use Hardhat with Polkadot all-in-one plugin

Package Exports

  • @parity/hardhat-polkadot

Readme

Build on Polkadot with Hardhat Plugin


Compatibility

  • Not compatible with solidity versions lower than 0.8.0.

Installation

Using npm:

$ npm install -D @parity/hardhat-polkadot

Using yarn:

$ yarn add -D @parity/hardhat-polkadot 

Using pnpm:

$ pnpm add -D @parity/hardhat-polkadot 

Configuration

  1. Import the package in the hardhat.config.ts file:
...
import "@parity/hardhat-polkadot";
...
  1. Create 2 binaries - One for the node and another for the ETH-RPC adapter. See step 1. of Deploying with a Local Node.

  2. Example configuration in hardhat.config.ts

const config: HardhatUserConfig = {
  networks: {
    hardhat: {
      polkadot: true,
      nodeConfig: {
        nodeBinaryPath: 'INSERT_PATH_TO_SUBSTRATE_NODE',
        rpcPort: 8000,
        dev: true,
      },
      adapterConfig: {
        adapterBinaryPath: 'INSERT_PATH_TO_ETH_RPC_ADAPTER',
        dev: true,
      },
    },
  },
};

Usage

Get started from a boilerplate.

$ npx hardhat-polkadot init

Compile solidity smart contracts for the Polkadot network, creating Polkadot compatible hardhat artifacts.

$ npx hardhat compile

Test smart contracts locally. See more in Testing Your Contract.

$ npx hardhat test

Deploy smart contracts locally or to a Live Network. See more in Deploying with a Local Node and Deploying to a live Network.

$ npx hardhat ignition deploy ./ignition/modules/deploy.js

Run custom scripts locally or on a Live Network. See more in Interacting with Your Contract.

$ npx hardhat run scripts/interact.js

Documentation

Getting Help

Happy building! 👷‍♀️👷‍♂️