solidity/test/compilationTests/gnosis/Oracles/DifficultyOracleFactory.sol

28 lines
857 B
Solidity
Raw Normal View History

2018-10-24 12:52:11 +00:00
pragma solidity >=0.0;
2017-07-12 13:46:33 +00:00
import "../Oracles/DifficultyOracle.sol";
/// @title Difficulty oracle factory contract - Allows to create difficulty oracle contracts
/// @author Stefan George - <stefan@gnosis.pm>
contract DifficultyOracleFactory {
/*
* Events
*/
event DifficultyOracleCreation(address indexed creator, DifficultyOracle difficultyOracle, uint blockNumber);
/*
* Public functions
*/
/// @dev Creates a new difficulty oracle contract
/// @param blockNumber Target block number
/// @return difficultyOracle Oracle contract
2017-07-12 13:46:33 +00:00
function createDifficultyOracle(uint blockNumber)
public
returns (DifficultyOracle difficultyOracle)
{
difficultyOracle = new DifficultyOracle(blockNumber);
2018-06-27 08:35:38 +00:00
emit DifficultyOracleCreation(msg.sender, difficultyOracle, blockNumber);
2017-07-12 13:46:33 +00:00
}
}