Pass factory address at contract creation phase

This commit is contained in:
Makoto Inoue
2016-10-26 09:12:17 +01:00
parent a02a8a6e41
commit 721d8fbbf7
2 changed files with 29 additions and 8 deletions

View File

@ -16,16 +16,21 @@ contract Target {
function checkInvariant() returns(bool);
}
contract Bounty is PullPayment {
contract SimpleTokenBounty is PullPayment {
Target target;
bool public claimed;
address public factoryAddress;
mapping(address => address) public researchers;
function() {
if (claimed) throw;
}
function createTarget(address factoryAddress) returns(Target) {
function SimpleTokenBounty(address _factoryAddress){
factoryAddress = _factoryAddress;
}
function createTarget() returns(Target) {
target = Target(Factory(factoryAddress).deployContract());
researchers[target] = msg.sender;
return target;