aboutsummaryrefslogtreecommitdiffstats
path: root/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol
diff options
context:
space:
mode:
Diffstat (limited to 'test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol')
-rw-r--r--test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol b/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol
new file mode 100644
index 00000000..67f8a96e
--- /dev/null
+++ b/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol
@@ -0,0 +1,64 @@
+pragma solidity ^0.4.11;
+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
+ /// @return Oracle contract
+ 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
+ );
+ UltimateOracleCreation(
+ msg.sender,
+ ultimateOracle,
+ oracle,
+ collateralToken,
+ spreadMultiplier,
+ challengePeriod,
+ challengeAmount,
+ frontRunnerPeriod
+ );
+ }
+}