@TODO: Fill this in, including @SRC links
new ethers.ContractFactory( interface , bytecode [ , signer ] )
ContractFactory.fromSolidity( compilerOutput [ , signer ] ) ⇒ ContractFactory
contractFactory.connect( signer ) ⇒ Contract
contractFactory.signer ⇒ Signer
contractFactory.attach( address ) ⇒ Contract
Return an instance of a Contract attched to address. This is the same as using the Contract constructor with address and this the the interface and signerOrProvider passed in when creating the ContractFactory.
Returns the unsigned transaction which would deploy this Contract with args passed to the Contract's constructor.
...args ) ⇒ Promise< Contract >
Uses the signer to deploy the Contract with args passed into the constructor and retruns a Contract which is attached to the address where this contract will be deployed once the transaction is mined.
The transaction can be found at
contract.deployTransaction, and no interactions should be made until the transaction is mined.
const signer = ethers.LocalSigner();
const ContractFactory = ethers.ContractFactory;
// If your contract constructor requires parameters, the ABI
// must include the constructor
const abi = [
"constructor(address owner, uint256 initialValue)"
const factory = new ContractFactory(abi, bytecode, signer)
const contract = await factory.deploy("ricmoo.eth", 42);
// The address is available immediately, but the contract
// is NOT deployed yet
// The transaction that the signer sent to deploy
// Wait until the transaction is mined
// Now the contract is safe to interact with