Skip to content

Enhance OpenZeppelin Documentation for Solidity Version Compatibility in Hardhat Projects #392

Description

@ThomasCode92

After installing @openzeppelin/contracts in my Hardhat project, I encountered a VS Code status bar error when importing an OpenZeppelin contract.

Error message
image

Solidity code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import '@openzeppelin/contracts/access/Ownable.sol';

Upon investigation, I discovered that the issue originated from my hardhat.config.js, where I had specified Solidity version 0.8.18, while the OpenZeppelin contracts required version 0.8.20. Updating the Solidity version in my configuration resolved the error.

This addition to the documentation would help prevent similar issues for other users and enhance the overall developer experience.
Thank you for considering this suggestion. I would like to make the update to the documantation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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