I am new to programming with solidity and ethers.js and web3.js. I have created a factory contract with solidity as described in this blog post: factory pattern. I am now working on the front end, web3-react and ether.js. I see that ether.js has contract factory API, but it seems, if understand correctly, that ether.js allows you to deploy the "child" contracts directly, thus making a factory contract in solidity redundant.
The problem is that the factory contract in solidity serves two purposes one to deploy child contracts and two to track the deployed contracts, whereas, ether.js only deploys contracts.
How does one handle tracking, or more specifically mapping account to deployed contract address with ethers.js? Does one create a separate contract for tracking only, and then send an update that contract each time a new contract is deployed by the factory? Or, are there any other recommended patterns to solve this?
createChildContracttx is confirmed, just query the information. However, if you use CREATE2 (e.g. like how UniswapV2 does), then you can deterministically compute the contract address using input parameters. You can also see https://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed – Soham Zemse May 01 '21 at 22:37