0

I have a function which when deployed through Remix on the Javascript VM perfectly fine returns a contract address for the new contract, however, I'm not able to get it to return the new contract address when I deploy to Rinkeby or Ropsten?

function addNewContract(string _aa string _bb, string _cc, address _aa, bool _created, address _bb, address _cc) external onlyOwner returns(address newContract) {
        Contract c = new Contract(_aa, _bb, _cc, _aa, _registeredBusiness, _bb, _cc);
        associatedContracts.push(address(c));
        return address(c);
    }

am I looking in the wrong place or is the issue related to something else, should I be approaching a testnet differently than the Javascript VM - how can I retrieve the address?

2 Answers 2

1

Try using Ropsten instead of Rinkeby, it seems that the Rinkeby testnet on etherscan has some issues in terms of reading contract creation code and therefore it won't show the related contract-tabs once a contract is created by another contract.

1
  • 1
    for some reason it seems to work on ropsten
    – NowsyMe
    May 29, 2018 at 22:43
-1

If you have deploy to ropsten or rinkeby, then you can search your account address at https://ropsten.etherscan.io/ or https://rinkeby.etherscan.io/, then you'll find the transcation which create your contract and there its address.

1
  • It not there, I was expecting it to return in the console but there are no address being returned when I deploy on testnet, however, on Javascript VM it appears.
    – NowsyMe
    May 29, 2018 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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