0

If I have a contract (ContractFactory) that creates several instances of some other contract (SubContract), is there a way to verify all instances of SubContract?

pragma solidity ^0.4.19;

contract ContractFactory {
    address[] public deployed;

    function createSubContract() public {
        deployed.push(new SubContract());
    }
}
contract SubContract {
    uint public var1;
    uint public var2;

    function SubContract() public {
        var1 = 1;
        var2 = 10000;
    }
}
0

If you deploy a contract with identical bytecode to one that's already verified on Etherscan, the new copy of the contract is also already verified.

  • I thought so too, but it's not happening, at least on Ropsten etherscan. I deployed one SubContract using the above code, verified it, and then deployed several others. Non are verified. – JS_Riddler Jan 5 '18 at 5:41
  • Interesting. Is the code in your post the actual code? I think that if you use constructor parameters, different values for the parameters will require separate verification. – smarx Jan 5 '18 at 5:42
  • Yes, I used that exact code because I figured constructor params could get in the way. – JS_Riddler Jan 5 '18 at 5:48
  • I personally haven't tried this exact scenario. Can you link to the ContractFactory on ropsten.etherscan.io? – smarx Jan 5 '18 at 5:50
  • Here's a factory: ropsten.etherscan.io/address/… – JS_Riddler Jan 5 '18 at 6:00

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.