token-vesting-contracts
token-vesting-contracts copied to clipboard
Error with yarn coverage
Even after building with forge, I get these errors when running yarn coverage
:
yarn run v1.22.10
$ npx hardhat coverage --solcoverjs ./.solcover.js
Version
=======
> solidity-coverage: v0.7.22
Instrumenting for coverage...
=============================
> MockTokenVesting.sol
> Token.sol
> TokenVesting.sol
Compilation:
============
Compiling 7 files with 0.8.19
ParserError: Source "solmate/tokens/ERC20.sol" not found: File not found. Searched the following locations: "".
--> src/Token.sol:7:1:
|
7 | import {ERC20} from "solmate/tokens/ERC20.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ParserError: Source "solmate/tokens/ERC20.sol" not found: File not found. Searched the following locations: "".
--> src/TokenVesting.sol:8:1:
|
8 | import {ERC20} from "solmate/tokens/ERC20.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ParserError: Source "solmate/auth/Owned.sol" not found: File not found. Searched the following locations: "".
--> src/TokenVesting.sol:9:1:
|
9 | import {Owned} from "solmate/auth/Owned.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ParserError: Source "solmate/utils/SafeTransferLib.sol" not found: File not found. Searched the following locations: "".
--> src/TokenVesting.sol:10:1:
|
10 | import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ParserError: Source "solmate/utils/ReentrancyGuard.sol" not found: File not found. Searched the following locations: "".
--> src/TokenVesting.sol:11:1:
|
11 | import {ReentrancyGuard} from "solmate/utils/ReentrancyGuard.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in plugin solidity-coverage: HardhatError: HH600: Compilation failed
For more info run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
once check version used in .sol files and package.json, must use same version.Fix to one version and develop projects :)
@mujahid002 the versions of what are you referring to please?
@mujahid002 the versions of what are you referring to please?
I use ^0.8.6, try to use >=0.8.0 and while using any frameworks like truffle,hardhat once check solidity version in package.json
What package are you refering to when you say you use ^0.8.6 ?
@mujahid002 I understand there is some discrepancy between package versions, but I'm having a bit of a struggle figuring out the correct configuration. Would you mind providing more information? Thanks.
I have same error. How can fix it?
While importing packages please check it whether its correctly importing from node_modules!
For eg: import "../../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol";