diff options
Diffstat (limited to 'test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol')
-rw-r--r-- | test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol b/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol new file mode 100644 index 00000000..0884d8ca --- /dev/null +++ b/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol @@ -0,0 +1,31 @@ +pragma solidity ^0.4.11; +import "../Oracles/SignedMessageOracle.sol"; + + +/// @title Signed message oracle factory contract - Allows to create signed message oracle contracts +/// @author Stefan George - <stefan@gnosis.pm> +contract SignedMessageOracleFactory { + + /* + * Events + */ + event SignedMessageOracleCreation(address indexed creator, SignedMessageOracle signedMessageOracle, address oracle); + + /* + * Public functions + */ + /// @dev Creates a new signed message oracle contract + /// @param descriptionHash Hash identifying off chain event description + /// @param v Signature parameter + /// @param r Signature parameter + /// @param s Signature parameter + /// @return Oracle contract + function createSignedMessageOracle(bytes32 descriptionHash, uint8 v, bytes32 r, bytes32 s) + public + returns (SignedMessageOracle signedMessageOracle) + { + signedMessageOracle = new SignedMessageOracle(descriptionHash, v, r, s); + address oracle = ecrecover(descriptionHash, v, r, s); + SignedMessageOracleCreation(msg.sender, signedMessageOracle, oracle); + } +} |