0

I am working on a hardhat project by creating it from the CLI and using Typechain for the TS support. When running npx hardhat typechain it crashes at @chainlink/contracts/src/v0.8/vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol.

This is the error:

SyntaxError: Identifier expected. (4:18)
  2 | /* tslint:disable */
  3 | /* eslint-disable */
> 4 | import type * as 086 from './0.8.6';
    |                  ^
  5 | export type { 086 };

I noticed in the latest chainlink-contract the npm package that you are using Typechain's 5.0.0 version and I am using the latest stable Typechain version which is v8.1.1. I managed to bypass the problem by using ethers v4 but I had to do a lot of shenanigans to make them work like overriding the package version because of conflict between packages and the solution doesn't work well. Is there a better way I could make Typechain work with Chainlink's contract? I also noticed that the contract that was making a problem was KeeperRegistry2.0 and KeeperRegistrar2.0 so If you import it into one of your contracts, you will see the same issue as I've noticed.

Here's a repository where you can reproduce the issue - https://github.com/ivaylonikolov7/chainlink-typechain-error

To do so - npm install and npx hardhat typechain

  • Hi- can you link to your repo so this issue can be reproduced please? – ZeusLawyer Apr 18 '23 at 09:08
  • I wasnt able to reproduce using the out of the box steps. - npx hardhat - chose typescript project - npm install @chainlink/contracts --save - npx hardhat typechain ------> "Compiled 1 Solidity file successfully" worked? – ZeusLawyer Apr 18 '23 at 09:21
  • Here's a repository where I reproduced the error - https://github.com/ivaylonikolov7/chainlink-typechain-error. The step that you didn't include in your repository is importing KeeperRegistry2.0/KeeperRegistrar2.0 `npm install` and `npx hardhat typechain` so you can be able to reproduce it too – ivaylo nikolov Apr 18 '23 at 14:34

0 Answers0