Skip to content

Difference between _ContractFactory_ and _getContractFactory_ #881

Answered by krakxn
Mark-Four asked this question in Q&A
Discussion options

You must be logged in to vote

It is because these are some pre-defined functions by Hardhat: (if you are not technical, promises followed by colons here are returns simply put, whereas the left one is the method signature with parameters, and parameters with a ? are not compulsory - ie optional)

function getContractFactory(name: string, signer?: ethers.Signer): Promise<ethers.ContractFactory>;

function getContractFactory(name: string, factoryOptions: FactoryOptions): Promise<ethers.ContractFactory>;

function getContractFactory(abi: any[], bytecode: ethers.utils.BytesLike, signer?: ethers.Signer): Promise<ethers.ContractFactory>;

Whereas in Ethers (there is no getter function), we have to do it manually (ie, first c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Mark-Four
Comment options

Answer selected by Mark-Four
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants