Skip to content

Instantly share code, notes, and snippets.

@simondlr
Created October 17, 2017 13:00
Show Gist options
  • Save simondlr/2496c4d4dcee58f40017f4bc2e3c8ece to your computer and use it in GitHub Desktop.
Save simondlr/2496c4d4dcee58f40017f4bc2e3c8ece to your computer and use it in GitHub Desktop.
ETHUSDHandlerFactory
pragma solidity ^0.4.10;
import "./ETHUSDHandler.sol";
contract ETHUSDHandlerFactory {
mapping(address => address[]) public userToHandlers;
function createNewHandler (
address _beneficiary,
uint256 _initialPriceInUSD,
address _admin,
address _oracleAddress,
uint256 _gracePeriod) returns (address)
{
ETHUSDHandler handler = new ETHUSDHandler(_beneficiary, _initialPriceInUSD, _admin, _oracleAddress, _gracePeriod);
userToHandlers[msg.sender].push(handler);
return handler;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment