Skip to content

Support for Hardhat 3 #471

@luispedro18

Description

@luispedro18

Add Hardhat 3 support - Plugin system migration needed

Problem

The solidity-docgen package is currently incompatible with Hardhat 3 due to fundamental changes in how plugins and tasks are defined. This is currently blocking the migration of our project to version 3. According to the Hardhat 3 migration guide, Hardhat 3 introduced several breaking changes:

  1. Declarative config: Plugins, tasks, and other extensions must be configured explicitly in the config instead of being registered by side effects
  2. ESM-first: Hardhat config must be an ES module
  3. Extensibility through hooks: Features like extendConfig and subtask overriding were replaced by the new hooks system

Current Error

When trying to use solidity-docgen with Hardhat 3, users encounter:

Error HHE404: Task "docgen" not found

This occurs because:

  • The hardhat API structure changed significantly

Expected Behavior

solidity-docgen should work seamlessly with Hardhat 3 by:

  1. Using the new declarative plugin system
  2. Following the new hooks system for extending functionality

Proposed Solution

  1. Implement declarative plugin: Create a proper plugin that can be added to the plugins array in hardhat.config.ts
  2. Update documentation: Provide migration examples for users upgrading from Hardhat 2

Environment

  • Hardhat version: 3.0.6
  • solidity-docgen version: 0.6.0-beta.36
  • Node.js version: 24.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions