2020-08-04 18:19:42 +00:00
|
|
|
//SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity >= 0.5.0 < 0.7.0;
|
|
|
|
|
2020-11-14 11:25:14 +00:00
|
|
|
import "@openzeppelin/contracts/access/Ownable.sol";
|
|
|
|
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
2020-11-25 18:54:59 +00:00
|
|
|
import "./DioneStaking.sol";
|
2020-11-14 11:25:14 +00:00
|
|
|
|
2020-11-15 10:16:38 +00:00
|
|
|
interface IMediator {
|
|
|
|
function _receiveDataCallback(uint256 reqID, string memory data) external;
|
|
|
|
}
|
|
|
|
|
2020-11-14 11:25:14 +00:00
|
|
|
contract Aggregator is Ownable, ReentrancyGuard {
|
2020-11-25 18:54:59 +00:00
|
|
|
DioneStaking public dioneStaking;
|
2020-08-04 18:19:42 +00:00
|
|
|
|
2020-11-25 18:54:59 +00:00
|
|
|
constructor(DioneStaking _dioneStaking) public {
|
2020-11-14 11:25:14 +00:00
|
|
|
dioneStaking = _dioneStaking;
|
2020-08-04 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
2020-11-25 18:54:59 +00:00
|
|
|
function collectData(uint256 reqID, string memory data, IMediator callbackAddress) public {
|
|
|
|
dioneStaking.mine(msg.sender);
|
2020-11-15 10:16:38 +00:00
|
|
|
callbackAddress._receiveDataCallback(reqID, data);
|
2020-08-04 18:19:42 +00:00
|
|
|
}
|
|
|
|
}
|