{"_id":"@avalix/hardhat-polkavm","_rev":"2-3410355d9ab7e954df1b36a9a809359f","name":"@avalix/hardhat-polkavm","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@avalix/hardhat-polkavm","version":"0.1.0","keywords":["ethereum","polkadot","polkavm","resolc","revive","solidity","smart-contracts","hardhat","hardhat3","hardhat-plugin"],"license":"MIT","_id":"@avalix/hardhat-polkavm@0.1.0","maintainers":[{"name":"preschian","email":"preschian27@gmail.com"}],"dist":{"shasum":"6302617041a7e62fa1ad5c26351e5e7d26814f8c","tarball":"https://registry.npmjs.org/@avalix/hardhat-polkavm/-/hardhat-polkavm-0.1.0.tgz","fileCount":18,"integrity":"sha512-wJB3Fiw5KGzCF93VNzK0r/tvj6fF/tOv7/LFw3v0wTmE7B8Gd3J6GkJYHRQ7/AtZO4LEy8LUa4iLhh5Dd1+Trw==","signatures":[{"sig":"MEUCIQDgrNBYwn7dxo8vZkMO8j4RUVp4FBZ/pLbr2+jAnq9g7AIgaxw6Zen7N8XmemOmkhEPOol3RQ8oxtgNL9olHw6dzyA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36261},"type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"cf2e7b05504db09b794add09bad4c0012d72c7e2","scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"preschian","email":"preschian27@gmail.com"},"_npmVersion":"11.13.0","description":"Hardhat 3 plugin to compile Solidity to PolkaVM (Polkadot) using the resolc / revive compiler.","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@parity/resolc":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.2","vitest":"^4.1.8","hardhat":"^3.8.0","typescript":"^6.0.3","@types/node":"^25.9.1"},"peerDependencies":{"hardhat":"^3.4.0"},"_npmOperationalInternal":{"tmp":"tmp/hardhat-polkavm_0.1.0_1780900814601_0.6976214423798488","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@avalix/hardhat-polkavm","version":"0.2.1","description":"Hardhat 3 plugin to compile Solidity to PolkaVM (Polkadot) using the resolc / revive compiler.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/avalix-labs/hardhat-polkavm.git","directory":"packages/hardhat-polkavm"},"keywords":["ethereum","polkadot","polkavm","resolc","revive","solidity","smart-contracts","hardhat","hardhat3","hardhat-plugin"],"exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"types":"./dist/index.d.mts","scripts":{"build":"tsdown","dev":"tsdown --watch","test":"vitest run","typecheck":"tsc --noEmit"},"dependencies":{"@parity/resolc":"^1.2.0"},"peerDependencies":{"hardhat":"^3.4.0"},"devDependencies":{"@types/node":"^25.9.2","hardhat":"^3.9.0","tsdown":"^0.22.2","typescript":"^6.0.3","vitest":"^4.1.8"},"_id":"@avalix/hardhat-polkavm@0.2.1","gitHead":"512e19723e9111d16356739bcb98e9afdca59ca1","bugs":{"url":"https://github.com/avalix-labs/hardhat-polkavm/issues"},"homepage":"https://github.com/avalix-labs/hardhat-polkavm#readme","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-bG8rJ9l5xO7rtwqJEcRL1Y1ATtWeOoGzVfRSMf+gaJNKEEfK94Arv+xEs/ZlU86tVYmwYH21QkkMjFWh5cuMAQ==","shasum":"d661c4360e69d33ce040ed569522703dca1e6bd4","tarball":"https://registry.npmjs.org/@avalix/hardhat-polkavm/-/hardhat-polkavm-0.2.1.tgz","fileCount":18,"unpackedSize":36408,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@avalix%2fhardhat-polkavm@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICdMsxuaL6kRsalRJkV/xkK0dU6wcrYvNR1UQtfLETLIAiBMCvkTyhUQwcJ3cshOwyr8fyfSMKRccXZsLyL5LpqzuQ=="}]},"_npmUser":{"name":"preschian","email":"preschian27@gmail.com"},"directories":{},"maintainers":[{"name":"preschian","email":"preschian27@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hardhat-polkavm_0.2.1_1781061281938_0.6356578277097111"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-08T06:40:14.481Z","modified":"2026-06-10T03:14:42.354Z","0.1.0":"2026-06-08T06:40:14.761Z","0.2.1":"2026-06-10T03:14:42.075Z"},"license":"MIT","keywords":["ethereum","polkadot","polkavm","resolc","revive","solidity","smart-contracts","hardhat","hardhat3","hardhat-plugin"],"description":"Hardhat 3 plugin to compile Solidity to PolkaVM (Polkadot) using the resolc / revive compiler.","maintainers":[{"name":"preschian","email":"preschian27@gmail.com"}],"readme":"# @avalix/hardhat-polkavm\n\nA **Hardhat 3** plugin that compiles your Solidity contracts to **PolkaVM**\nbytecode using Parity's [`resolc`](https://github.com/paritytech/revive)\n(revive) compiler, so you can deploy them to Polkadot smart-contract chains\n(e.g. Asset Hub).\n\n> The official [`paritytech/hardhat-polkadot`](https://github.com/paritytech/hardhat-polkadot)\n> targets Hardhat 2. This plugin is a lightweight reimplementation for the\n> Hardhat 3 plugin system (config + `solidity` hooks).\n\n## Install\n\n```bash\nnpm install --save-dev @avalix/hardhat-polkavm\n# or: bun add -d @avalix/hardhat-polkavm\n```\n\nRequires `hardhat@^3.4.0`.\n\n## Usage\n\nAdd the plugin and a top-level `resolc` block to your config. The presence of\nthat block transparently switches **every** Solidity compiler from `solc` (EVM)\nto `resolc` (PolkaVM) — there is no per-compiler `type` wiring to do.\n\n```ts\n// hardhat.config.ts\nimport { defineConfig } from \"hardhat/config\";\nimport hardhatPolkaVM from \"@avalix/hardhat-polkavm\";\n\nexport default defineConfig({\n  plugins: [hardhatPolkaVM],\n  solidity: \"0.8.29\",\n  resolc: {\n    compilerSource: \"npm\",\n    optimizer: { enabled: true, runs: 200 },\n  },\n});\n```\n\nThen compile as usual:\n\n```bash\nnpx hardhat compile\n```\n\nThe emitted artifacts contain PolkaVM bytecode. Remove the `resolc` block to go\nback to a normal EVM build.\n\n## Compiler sources\n\n| `compilerSource` | How it works | When to use |\n| --- | --- | --- |\n| `\"npm\"` *(default)* | Uses the self-contained [`@parity/resolc`](https://www.npmjs.com/package/@parity/resolc) package, which bundles `solc`. No downloads, works on every platform/arch. | The simplest, most portable option. |\n| `\"binary\"` | Downloads the native `resolc` release from GitHub and drives it over `--standard-json`, calling Hardhat's `solc` via `--solc`. Faster, but native binaries exist only for macOS, Linux x64 and Windows x64. | Larger projects where compile speed matters. |\n\n## Configuration reference\n\n```ts\nresolc: {\n  // \"npm\" (default) | \"binary\"\n  compilerSource: \"npm\",\n\n  // revive/resolc release for \"binary\" mode (default: \"1.2.0\")\n  version: \"1.2.0\",\n\n  optimizer: {\n    enabled: true,   // default: true\n    runs: 200,       // default: 200\n    mode: \"3\",       // \"0\" | \"1\" | \"2\" | \"3\" | \"s\" | \"z\" (optional)\n    fallbackOz: true // retry with -Oz if the bytecode is too large (optional)\n  },\n\n  // \"binary\" mode only — skip the download / use your own toolchain:\n  resolcPath: \"/path/to/resolc\",\n  solcPath: \"/path/to/solc\",\n}\n```\n\n## How it works\n\nHardhat 3 exposes a `solidity` hook with two extension points the plugin uses:\n\n- **`getCompiler`** — returns a custom `Compiler` for `type: \"resolc\"` that\n  produces PolkaVM bytecode (instead of solc's EVM bytecode).\n- **`downloadCompilers`** — fetches the native resolc binary in `\"binary\"` mode.\n\nA `config` hook resolves the `resolc` block and rewrites the resolved Solidity\nconfig so each compiler uses `type: \"resolc\"`.\n\n## License\n\nMIT\n","readmeFilename":"README.md","homepage":"https://github.com/avalix-labs/hardhat-polkavm#readme","repository":{"type":"git","url":"git+https://github.com/avalix-labs/hardhat-polkavm.git","directory":"packages/hardhat-polkavm"},"bugs":{"url":"https://github.com/avalix-labs/hardhat-polkavm/issues"}}