Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typechain-hardhat does not consider hardhat 'sources' config #881

Open
FFdhorkin opened this issue Oct 20, 2023 · 0 comments
Open

typechain-hardhat does not consider hardhat 'sources' config #881

FFdhorkin opened this issue Oct 20, 2023 · 0 comments

Comments

@FFdhorkin
Copy link

FFdhorkin commented Oct 20, 2023

Hardhat allows you to move your contracts folder: https://hardhat.org/hardhat-runner/docs/config#path-configuration

When config.paths.sources is nonstandard, typechain-hardhat refuses to generate types.

for example:

const config: HardhatUserConfig = {
  solidity: "0.8.18",
  paths: {
    artifacts: "./hardhatstuff/artifacts",
    cache: "./hardhatstuff/artifacts/cache",
    sources: "./hardhatstuff/contracts",
  },
  typechain: {
    discriminateTypes: true,
    outDir: "./hardhatstuff/artifacts/typechain-types",
  },
};
➜  /workspace git:(master) ✗ npx hardhat clean && npx hardhat compile
Generating typings for: 3 artifacts in dir: ./hardhatstuff/artifacts/typechain-types for target: ethers-v6
Successfully generated 0 typings!
Compiled 3 Solidity files successfully (evm target: paris).
Versions:
        "@nomicfoundation/hardhat-ethers": "^3.0.4",
        "@nomicfoundation/hardhat-toolbox": "^3.0.0",
        "@openzeppelin/contracts": "^4.9.3",
        "@typechain/ethers-v6": "^0.4.3",
        "@typechain/hardhat": "^8.0.3",
        "ethers": "^6.7.1",
        "hardhat": "^2.18.0",
        "typechain": "^8.3.1"

Incidentally, it appears if I move it to the default location, compile, then move it back, subsequent compiles properly do types...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@FFdhorkin and others