Created
December 29, 2016 05:28
-
-
Save Souptacular/c964f2617d7c8062084a47a12ba79f00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.7; | |
contract Factory { | |
bytes32[] Names; | |
address[] newContracts; | |
function createContract (bytes32 name) { | |
address newContract = new Contract(name); | |
newContracts.push(newContract); | |
} | |
function getName (uint i) { | |
Contract con = Contract(newContracts[i]); | |
Names[i] = con.Name(); | |
} | |
} | |
contract Contract { | |
bytes32 public Name; | |
function Contract (bytes32 name) { | |
Name = name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment