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