rhlsthrm / hardhat-typechain

TypeChain tasks for Buidler
MIT License
18 stars 13 forks source link

typechain no export member #15

Open novaknole opened 3 years ago

novaknole commented 3 years ago

As we can see, it shows red line underneath it.

Screenshot 2021-02-26 at 9 00 50 PM

I have only 1 contract in contracts/Counter.sol

pragma solidity ^0.6.8;

import "hardhat/console.sol";

contract Counter {
    uint256 count = 0;

    event CountedTo(uint256 number);

    function getCount() public view returns (uint256) {
        return count;
    }

    function countUp() public returns (uint256) {
        console.log("countUp: count =", count);
        uint256 newCount = count + 1;
        require(newCount > count, "Uint256 overflow");

        count = newCount;

        emit CountedTo(count);
        return count;
    }

    function countDown() public returns (uint256) {
        console.log("countDown: count =", count);
        uint256 newCount = count - 1;
        require(newCount < count, "Uint256 underflow");

        count = newCount;

        emit CountedTo(count);
        return count;
    }
}

This is my hardhat config.

import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import 'hardhat-abi-exporter'
import 'hardhat-typechain'
import 'solidity-coverage'

This is my tsconfig.json

{
    "compilerOptions": {
      "target": "es2018",
      "module": "commonjs",
      "strict": true,
      "esModuleInterop": true,
      "outDir": "dist"
    },
    "include": ["./scripts", "./test", "./typechain"],
    "files": ["./hardhat.config.ts"]
  }

After running hardhat compile, it creates a typechain folder

Screenshot 2021-02-26 at 9 05 30 PM

and

Screenshot 2021-02-26 at 9 06 53 PM

The problem is why does it show red line in here and how do I fix it ?

Screenshot 2021-02-26 at 9 00 50 PM