I am new to ethereum.

I am trying to create a contract from a factory contract, which works fine and even returns the address of the newly created contract

Contract FactoryContract {
    event ContarctCreated(address index contractAddress)
    address[] public alladdresses;
    function CreateChild(string memory arg1) {
        address newChild = ChildContract(_arg1)
        emit ContarctCreated(newChild)


Contract ChildContract {
    string arg1;
    constructor(string memory _arg1) public {

Now I want to load this newly created child contract through UI (web3) in my case.How would I do it? If I try this in Remix and click ATADDRESS button, I get the relevant details of the contract.I want these details to be loaded through my UI. Any help is really appreciated.


Install web3.js v1.2.6, and then do something like this:

const Web3 = require("web3");
const web3 = new Web3("https://mainnet.infura.io/v3/YourInfuraProjectID");
const FACTORY_ABI = [

const factory = new web3.eth.Contract(FACTORY_ABI, YourFactoryAddress);

factory.methods.alladdresses(0).then(function(address0) {
    // `address0` is the address of your first created child contract
| improve this answer | |
  • Thankyou for the response. I am good till the point that you have answered.I am able to get the addresses of the child contracts. Now, with the given child contract address, how do load it .How do I load the details of child contract as I don't know its ABI. – Jiny May 4 at 3:17
  • @Jiny: If you have another question, then please post it separately. If this has answered your current question, then please accept it by clicking on the V. – goodvibration May 4 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.