2018-10-24 12:52:11 +00:00
|
|
|
pragma solidity >=0.0;
|
2017-07-12 13:46:33 +00:00
|
|
|
import "../Oracles/UltimateOracle.sol";
|
|
|
|
|
|
|
|
|
|
|
|
/// @title Ultimate oracle factory contract - Allows to create ultimate oracle contracts
|
|
|
|
/// @author Stefan George - <stefan@gnosis.pm>
|
|
|
|
contract UltimateOracleFactory {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Events
|
|
|
|
*/
|
|
|
|
event UltimateOracleCreation(
|
|
|
|
address indexed creator,
|
|
|
|
UltimateOracle ultimateOracle,
|
|
|
|
Oracle oracle,
|
|
|
|
Token collateralToken,
|
|
|
|
uint8 spreadMultiplier,
|
|
|
|
uint challengePeriod,
|
|
|
|
uint challengeAmount,
|
|
|
|
uint frontRunnerPeriod
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Public functions
|
|
|
|
*/
|
|
|
|
/// @dev Creates a new ultimate Oracle contract
|
|
|
|
/// @param oracle Oracle address
|
|
|
|
/// @param collateralToken Collateral token address
|
|
|
|
/// @param spreadMultiplier Defines the spread as a multiple of the money bet on other outcomes
|
|
|
|
/// @param challengePeriod Time to challenge oracle outcome
|
|
|
|
/// @param challengeAmount Amount to challenge the outcome
|
|
|
|
/// @param frontRunnerPeriod Time to overbid the front-runner
|
2019-10-21 22:05:34 +00:00
|
|
|
/// @return ultimateOracle Oracle contract
|
2017-07-12 13:46:33 +00:00
|
|
|
function createUltimateOracle(
|
|
|
|
Oracle oracle,
|
|
|
|
Token collateralToken,
|
|
|
|
uint8 spreadMultiplier,
|
|
|
|
uint challengePeriod,
|
|
|
|
uint challengeAmount,
|
|
|
|
uint frontRunnerPeriod
|
|
|
|
)
|
|
|
|
public
|
|
|
|
returns (UltimateOracle ultimateOracle)
|
|
|
|
{
|
|
|
|
ultimateOracle = new UltimateOracle(
|
|
|
|
oracle,
|
|
|
|
collateralToken,
|
|
|
|
spreadMultiplier,
|
|
|
|
challengePeriod,
|
|
|
|
challengeAmount,
|
|
|
|
frontRunnerPeriod
|
|
|
|
);
|
2018-06-27 08:35:38 +00:00
|
|
|
emit UltimateOracleCreation(
|
2017-07-12 13:46:33 +00:00
|
|
|
msg.sender,
|
|
|
|
ultimateOracle,
|
|
|
|
oracle,
|
|
|
|
collateralToken,
|
|
|
|
spreadMultiplier,
|
|
|
|
challengePeriod,
|
|
|
|
challengeAmount,
|
|
|
|
frontRunnerPeriod
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|