AbdelStark / token-vesting-contracts

ERC20 token vesting smart contracts 💰⏳
Apache License 2.0
193 stars 135 forks source link

Error with yarn coverage #36

Open joelamouche opened 1 year ago

joelamouche commented 1 year ago

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.
mujahid002 commented 1 year ago

once check version used in .sol files and package.json, must use same version.Fix to one version and develop projects :)

joelamouche commented 1 year ago

@mujahid002 the versions of what are you referring to please?

mujahid002 commented 1 year ago

@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

joelamouche commented 1 year ago

What package are you refering to when you say you use ^0.8.6 ?

GGAlanSmithee commented 1 year ago

@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.

zerodev68 commented 5 months ago

I have same error. How can fix it?

mujahid002 commented 5 months ago

While importing packages please check it whether its correctly importing from node_modules!

For eg: import "../../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol";