Is the intended use of the Factory non-type .ts file documented?
See original GitHub issueI’m curious what the purpose of the ...Factory.ts
file is in a project like this:
types/Greeter.d.ts
types/GreeterFactory.ts
types/index.d.ts
Is that documented somewhere? I’m not sure if this question is ethers-specific or not. Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
JavaScript libraries should be written in TypeScript
I completely agree with the sentiment that typed libraries are more stable and self-documenting. You can autogenerate documentation from ...
Read more >What's new in ReSharper - JetBrains
XML documentation in decompiled / metadata view file header. ... Improved performance of fix in scope, as it now uses the results of ......
Read more >3a2425a5aed1bef93dab954745...
testRenamingUpdatesTheStub() 82b3364: fixed tests (documentation format) ... 34f02fe: added mako file type factory ad41d5b: Merge branch ...
Read more >Programming, Coding and Algorithms Questions and Answers
Programming, Coding and Algorithms Questions and Answers. Coding is a complex process that requires precision and attention to detail.
Read more >1:11 vo0?31 o0~P~ - DTIC
The chronicles of disasters is as old as recorded history, ranging from the ... extraordinarily complex task was a leading purpose of the...
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
I’ve added a simple readme including what I’ve wrote above plus some basic info about contract type declarations. Thanks @pcowgill for the suggestion!
Yes. I’ll write a short overview here, @pcowgill please tell us what should be described more.
The factory classes are an extension of ethers’
ContractFactory
. They serve two main purposes:ContractFactory
class, so you don’t have to load and parse the JSON manuallyContractFactory
(since it returns plainContract
instances).Another case are abstract contracts or solidity interfaces, because they have no bytecode. For those, a simplified factory is generated that doesn’t extends
ContractFactory
, and only includes the staticconnect
method, so you can easily connect to a deployed instance without having to pass the ABI manually.Very simple example: