Skip to content

Update @nomicfoundation/hardhat-toolbox to latest version (6.1.0) and fix compatibility issues - #40

Draft
sonnyquinn24 with Copilot wants to merge 2 commits into
mainfrom
copilot/update-hardhat-toolbox-version
Draft

Update @nomicfoundation/hardhat-toolbox to latest version (6.1.0) and fix compatibility issues#40
sonnyquinn24 with Copilot wants to merge 2 commits into
mainfrom
copilot/update-hardhat-toolbox-version

Conversation

Copilot AI commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

This PR updates the project's devDependencies to use the latest version of @nomicfoundation/hardhat-toolbox (6.1.0) and resolves all compatibility issues that arose from the update.

Changes Made

1. Updated Hardhat Toolbox

  • Updated @nomicfoundation/hardhat-toolbox from ^6.1.0 to the latest version
  • Removed redundant individual dependencies (@nomicfoundation/hardhat-ethers, @nomicfoundation/hardhat-chai-matchers, chai, ethers) that are now provided by the toolbox
  • Updated hardhat to ^2.26.3 for compatibility with the toolbox

2. Fixed Configuration

  • Updated hardhat.config.js to import @nomicfoundation/hardhat-toolbox instead of individual @nomicfoundation/hardhat-ethers
  • This provides access to all toolbox features including ethers, chai matchers, network helpers, verification tools, gas reporting, and coverage

3. Resolved OpenZeppelin Contracts Compatibility

Fixed constructor issues in smart contracts due to OpenZeppelin Contracts v5.x requiring explicit owner parameters:

SEQICO.sol:

// Before
constructor(...) {

// After  
constructor(...) Ownable(msg.sender) {

SEQToken.sol:

// Before
constructor(...) ERC20("SEQ Token", "SEQ") {
    // ...
    _transferOwnership(owner);
}

// After
constructor(...) ERC20("SEQ Token", "SEQ") Ownable(owner) {
    // ... (removed manual ownership transfer)
}

4. Fixed ES Module Imports

Updated all script files to use compatible import syntax:

// Before
import { ethers } from "hardhat";

// After
import hre from "hardhat";
const { ethers } = hre;

This resolves ES module compatibility issues while maintaining the same functionality.

Verification

All existing functionality has been tested and verified:

  • ✅ Contract compilation successful
  • ✅ Both deployment scripts (deploy.js and deploy-DE.js) working correctly
  • ✅ All tests passing with gas reporting
  • ✅ Example calculation scripts (example-values.js, price-examples.js) functioning
  • ✅ GitHub Actions workflow compatibility maintained

Benefits

  1. Latest Features: Access to the newest Hardhat toolbox features and improvements
  2. Simplified Dependencies: Reduced dependency management by using the comprehensive toolbox
  3. Better Maintenance: Single package to update instead of multiple individual dependencies
  4. Enhanced Testing: Improved testing capabilities with the latest toolbox features

The update ensures the project uses the most current and stable versions of the Hardhat ecosystem while maintaining full backward compatibility with existing contracts and scripts.

This pull request was created as a result of the following prompt from Copilot chat.

Update the project's devDependencies to use the latest version of @nomicfoundation/hardhat-toolbox. Run 'npm install @nomicfoundation/hardhat-toolbox@latest --save-dev' to update package.json and package-lock.json accordingly. Ensure all workflow and contract scripts continue to function with the new toolbox version.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…on (6.1.0)

Co-authored-by: sonnyquinn24 <227287527+sonnyquinn24@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to latest @nomicfoundation/hardhat-toolbox version in devDependencies Update @nomicfoundation/hardhat-toolbox to latest version (6.1.0) and fix compatibility issues Sep 9, 2025
Copilot AI requested a review from sonnyquinn24 September 9, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants