2018-10-24 12:52:11 +00:00
|
|
|
pragma solidity >=0.0;
|
2017-07-12 13:46:33 +00:00
|
|
|
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
|
2019-10-21 22:05:34 +00:00
|
|
|
/// @return signedMessageOracle Oracle contract
|
2017-07-12 13:46:33 +00:00
|
|
|
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);
|
2018-06-27 08:35:38 +00:00
|
|
|
emit SignedMessageOracleCreation(msg.sender, signedMessageOracle, oracle);
|
2017-07-12 13:46:33 +00:00
|
|
|
}
|
|
|
|
}
|