Last active
September 6, 2018 15:33
-
-
Save apalepu23/9180abcf48070caf02e5fb997f1e1436 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.17; | |
import "./MillionairesProblem.sol"; | |
contract MillionairesProblemFactory { | |
address public enigmaAddress; | |
// List of addresses for deployed MillionaireProblem instances | |
address[] public millionairesProblems; | |
constructor(address _enigmaAddress) public { | |
enigmaAddress = _enigmaAddress; | |
} | |
// Create a new MillionaireProblem and store address to array | |
function createNewMillionairesProblem() public { | |
address newMillionairesProblem = new MillionairesProblem( | |
enigmaAddress, | |
msg.sender | |
); | |
millionairesProblems.push(newMillionairesProblem); | |
} | |
// Obtain list of all deployed MillionaireProblem instances | |
function getMillionairesProblems() public view returns (address[]) { | |
return millionairesProblems; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment