【发布时间】:2022-12-02 00:10:10
【问题描述】:
I have been working on my ethereum project when face with issue new contracts stops compiling with error message:
blockchain/contracts/Utils.sol:2
pragma solidity ^0.8.9;
^^^^^^^^
SyntaxError: Unexpected identifier
I simply can not create a new contract anymore. It looks like there is some break in the environment.
Have you ever face with this issue? Do you have any thoughts what is wrong here?
Hardhat config is:
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
const config: HardhatUserConfig = {
solidity: "0.8.9",
};
export default config;
【问题讨论】:
-
it's possible it's missing a
;in the line above (?) -
Thank you, I have found the issue in import the contract into the test .ts file. See my answer below.