Skip to main content
Looking for Contributors — This Skill needs implementation. If you’re interested in building Hardhat integration for Voltaire, open an issue or submit a PR.

Hardhat Integration

This Skill will provide seamless integration between Voltaire and Hardhat for Solidity development.

Planned Features

  • Hardhat Network — Connect Voltaire providers to Hardhat’s built-in network
  • Artifact Loading — Import ABIs and bytecode from Hardhat’s artifacts/ directory
  • Task Integration — Use Voltaire primitives in custom Hardhat tasks
  • Plugin API — Extend Hardhat Runtime Environment with Voltaire
  • TypeChain Compatibility — Work alongside TypeChain-generated types

Example Usage (Proposed)

import { hardhat } from "./skills/hardhat/index.js";
import * as Address from "@voltaire/primitives/Address";
import * as Hex from "@voltaire/primitives/Hex";

// Connect to Hardhat Network
const hre = await hardhat.connect();

// Load contract from Hardhat artifacts
const Token = await hardhat.loadArtifact("artifacts/contracts/Token.sol/Token.json");

// Deploy using Voltaire transaction building
const deployTx = await hre.deploy(Token, {
  args: ["MyToken", "MTK", 18n],
});

const tokenAddress = Address.from(deployTx.contractAddress);

// Interact with deployed contract
const balance = await hre.call({
  to: tokenAddress,
  data: Token.interface.encodeFunctionData("balanceOf", [hre.signer.address]),
});

console.log("Balance:", Hex.toBigInt(balance));

Contributing

To implement this Skill:
  1. Fork the Voltaire repository
  2. Create examples/hardhat/ directory
  3. Implement the integration following Skills Philosophy
  4. Add tests and documentation
  5. Submit a PR
Key implementation areas:
  • Hardhat Network JSON-RPC client using Voltaire’s provider primitives
  • Artifact parser for ABI/bytecode from artifacts/ directory
  • HRE extension plugin for adding Voltaire to hre
  • Task helpers for common deployment patterns
  • Test helper utilities for Chai assertions with Voltaire types