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-polkadotUsing yarn:
$ yarn add -D @parity/hardhat-polkadot Using pnpm:
$ pnpm add -D @parity/hardhat-polkadot Configuration
- Import the package in the
hardhat.config.tsfile:
...
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: {
polkavm: true,
nodeConfig: {
nodeBinaryPath: 'INSERT_PATH_TO_SUBSTRATE_NODE',
rpcPort: 8000,
dev: true,
},
adapterConfig: {
adapterBinaryPath: 'INSERT_PATH_TO_ETH_RPC_ADAPTER',
dev: true,
},
},
},
resolc: {
version: "1.5.2",
compilerSource: "npm",
},
};Usage
Get started from a boilerplate.
$ npx hardhat-polkadot initCompile solidity smart contracts for the Polkadot network, creating PolkaVM compatible hardhat artifacts.
$ npx hardhat compileTest smart contracts locally. Instructions in Testing Your Contract.
$ npx hardhat testDeploy smart contracts locally or to a Live Network. Instructions in Deploying with a Local Node and Deploying to a live Network.
$ npx hardhat ignition deploy ./ignition/modules/deploy.jsRun custom scripts locally or on a Live Network. Instructions in Interacting with Your Contract.
$ npx hardhat run scripts/interact.jsDocumentation
See Examples.
Learn how to use Hardhat with Polkadot in Develop -> Smart Contracts -> Dev Environments -> Hardhat.
Follow tutorial in Tutorials -> Smart Contracts -> Launch Your First Project -> Test and Deploy with Hardhat.