Package Exports
- @parity/hardhat-polkadot
Readme
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
- Import the package in the
hardhat.config.ts
file:
...
import "@parity/hardhat-polkadot";
...
Create 2 binaries - One for the node and another for the ETH-RPC adapter. See step 1. of Deploying with a Local Node.
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
See Examples
Get started from scratch with How to use Hardhat with Polkadot
Follow tutorial with Test and Deploy with Hardhat