question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hardhat plugin always rebuilds typechain artifacts

See original GitHub issue

Bug with the @typechain/hardhat package.

When using the typechain plugin for hardhat, typechain artifacts will always be rebuilt, even if the smart contracts haven’t changed. While this isn’t breaking, it adds an additional few seconds to every time a hardhat command is run.

Is there any way that the plugin could detect that the typechain artifacts are out of date? Perhaps check the modified time of the artifacts compared to the source solidity files and only regenerate if needed?

I’d be interested in fixing this and submitting it as a PR if it’s not already in progress.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Remscarcommented, Sep 11, 2021

Wanted to come back and say thank you so much for adding this feature. Really appreciate it!

1reaction
alcuadradocommented, Mar 16, 2021

@alcuadrado any suggestions? Perhaps we could use the same machinery as hardhat uses internally to realize which files need recompiling.

Pretty sure you can. Will think about it and get back to this tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeChain/index.ts at master - hardhat - GitHub
TypeScript bindings for Ethereum smart contracts - TypeChain/index.ts at ... if this is not full rebuilding, always re-generate types for external artifacts.
Read more >
Compiling your contracts | Ethereum development ... - Hardhat
The compiled artifacts will be saved in the artifacts/ directory by default, or whatever your configured artifacts path is.
Read more >
@typechain/hardhat - npm
This plugin overrides the compile task and automatically generates new Typechain artifacts on each compilation. There is an optional flag --no- ...
Read more >
TypeChain: TypeScript Bindings for Ethereum Smart Contracts
TypeChain always will rewrite existing files. You should not commit them. ... To make it work great with Hardhat, use Hardhat plugin.
Read more >
awesome-solidity - Ben Kremer
paulrberg/solidity-template - Github template for writing contracts (uses: Hardhat, TypeChain, Ethers, Waffle, Solhint, Solcover, Prettier Plugin Solidity).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found