Skip to content

Instantly share code, notes, and snippets.

@Souptacular
Created December 29, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Souptacular/32303f714ec00e9e6852f250d8dcc183 to your computer and use it in GitHub Desktop.
Save Souptacular/32303f714ec00e9e6852f250d8dcc183 to your computer and use it in GitHub Desktop.
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