Typechain fails when there is a `provider` method on contract
See original GitHub issuewith the error message:
Property 'provider' in type 'MMInstantiator' is not assignable to the same property in base type 'Contract'.
Type '(_index: BigNumberish, overrides?: CallOverrides | undefined) => Promise<string>' is not assignable to type 'Provider'.ts(2416)
Class 'Contract' defines instance member property 'provider', but extended class 'MMInstantiator' defines it as instance member function.ts(2425)
If I rename it, then all issues go away. Currently, I cannot lightly rename this method since there are deployed contracts already working with the current ABI.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Introducing TypeChain — Typescript bindings for Ethereum ...
Usually to interact with a smart contract on the Ethereum blockchain you use Web3js: you pass an ABI and an address, you call...
Read more >ContractFactory - ethers
The Contract Factory sends a special type of transaction, ... extracting the ABI and bytecode from it, allowing for the various formats the...
Read more >Using TypeScript | Ethereum development environment for ...
To do it, open your terminal, go to your Hardhat project, and run: ... types for your smart contract you should install and...
Read more >ethers-io/Lobby - Gitter
I've not tried if multiple address works now with ethers js. But in case it doesn't you can send raw rpc methods with...
Read more >Migration guides — waffle documentation - Read the Docs
ethereum-provider - mock provider to interact with an in-memory blockchain ... is called waffle.json , it's possible to use just waffle to build...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ethers have two ways of calling a method, using the function and signature string:
AFAIK, when there are some conflicts with ethers reserved properties on the
contract
likeprovider
in this case, ethers.js drops that function but the alternate method is available. There was an issue on ethers repo maybe a year back, I couldn’t find it to link here.@gbarros You can use this alternate syntax in your project. And until this problem is fixed, whenever you run typechain you’d just need to remove the function (which is highlighted as error). And the fix is probably about removing functions with reserved names.
Released: https://github.com/ethereum-ts/TypeChain/releases/tag/typechain%404.0.1