Skip to content

Instantly share code, notes, and snippets.

@Souptacular
Created December 29, 2016 05:28
Show Gist options
  • Save Souptacular/c964f2617d7c8062084a47a12ba79f00 to your computer and use it in GitHub Desktop.
Save Souptacular/c964f2617d7c8062084a47a12ba79f00 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