22pragma solidity 0.8.3 ;
33
44/**
5- @author Tellor Inc.
5+ @author Fetch Inc.
66 @title Keeper
7- @dev This is contract for automatically paying for Tellor oracle data at
7+ @dev This is contract for automatically paying for Fetch oracle data at
88 * specific time intervals. Any non-rebasing ERC20 token can be used for payment.
99 * Only the first data submission within each time window gets a reward.
1010*/
1111
12- import "usingtellor /contracts/UsingTellor .sol " ;
12+ import "usingfetch /contracts/UsingFetch .sol " ;
1313import "./interfaces/IERC20.sol " ;
1414
15- contract Keeper is UsingTellor {
15+ contract Keeper is UsingFetch {
1616 // Storage
17- IERC20 public token; // TRB token address
17+ IERC20 public token; // FETCH token address
1818 address public owner;
1919 uint256 public fee; // 1000 is 100%, 50 is 5%, etc.
2020
@@ -77,16 +77,16 @@ contract Keeper is UsingTellor {
7777 // Functions
7878 /**
7979 * @dev Initializes system parameters
80- * @param _tellor address of Tellor contract
80+ * @param _fetch address of Fetch contract
8181 * @param _token address of token used for tips
8282 * @param _fee percentage, 1000 is 100%, 50 is 5%, etc.
8383 */
8484 constructor (
85- address payable _tellor ,
85+ address payable _fetch ,
8686 address _token ,
8787 address _owner ,
8888 uint256 _fee
89- ) UsingTellor (_tellor ) {
89+ ) UsingFetch (_fetch ) {
9090 token = IERC20 (_token);
9191 owner = _owner;
9292 fee = _fee;
@@ -188,9 +188,10 @@ contract Keeper is UsingTellor {
188188 emit KeeperJobFunded (msg .sender , _amount, _jobId);
189189 }
190190
191- function increaseMaxGasForExistingJob (bytes32 _queryId , uint256 _amount )
192- external
193- {
191+ function increaseMaxGasForExistingJob (
192+ bytes32 _queryId ,
193+ uint256 _amount
194+ ) external {
194195 KeeperTip storage _keep = keeperTips[_queryId];
195196 require (_keep.maxGasRefund > 0 , "Job not setup yet " );
196197 require (msg .sender == _keep.creator, "Not job creator " );
@@ -223,7 +224,7 @@ contract Keeper is UsingTellor {
223224 uint256 _interval ,
224225 uint256 _payReward
225226 ) external {
226- string memory _type = "TellorKpr " ;
227+ string memory _type = "FetchKpr " ;
227228 bytes memory _encodedArgs = abi.encode (
228229 _functionSig,
229230 _contractAddress,
@@ -312,10 +313,8 @@ contract Keeper is UsingTellor {
312313 _keeperTips.amount - ((_keeperTips.amount * fee) / 1000 )
313314 )
314315 );
315- token.approve (address (tellor), (_keeperTips.amount * fee) / 1000 );
316- tellor.addStakingRewards (
317- (_keeperTips.amount * fee) / 1000
318- );
316+ token.approve (address (fetch), (_keeperTips.amount * fee) / 1000 );
317+ fetch.addStakingRewards ((_keeperTips.amount * fee) / 1000 );
319318 _keeperTips.amount = 0 ;
320319 emit KeeperTipClaimed (_queryId, _keeperTips.amount, _keeperAddress);
321320 }
@@ -337,7 +336,7 @@ contract Keeper is UsingTellor {
337336 uint256 _maxGasRefund ,
338337 uint256 _tip
339338 ) external {
340- string memory _type = "TellorKpr " ;
339+ string memory _type = "FetchKpr " ;
341340 bytes memory _encodedArgs = abi.encode (
342341 _functionSig,
343342 _contractAddress,
@@ -382,7 +381,9 @@ contract Keeper is UsingTellor {
382381 }
383382
384383 // Getters
385- function continuousJobById (bytes32 _jobId )
384+ function continuousJobById (
385+ bytes32 _jobId
386+ )
386387 external
387388 view
388389 returns (
@@ -419,11 +420,9 @@ contract Keeper is UsingTellor {
419420 return userTipsTotal[_user];
420421 }
421422
422- function singleJobById (bytes32 _queryId )
423- external
424- view
425- returns (KeeperTip memory )
426- {
423+ function singleJobById (
424+ bytes32 _queryId
425+ ) external view returns (KeeperTip memory ) {
427426 return keeperTips[_queryId];
428427 }
429428
@@ -433,13 +432,12 @@ contract Keeper is UsingTellor {
433432 * @param _jobId JobID to generate queryId for
434433 * @param _timestamp Unique timestamp used to generate queryId
435434 */
436- function _generateQueryId (bytes32 _jobId , uint256 _timestamp )
437- internal
438- view
439- returns (bytes32 )
440- {
435+ function _generateQueryId (
436+ bytes32 _jobId ,
437+ uint256 _timestamp
438+ ) internal view returns (bytes32 ) {
441439 KeeperJobDetails storage _job = jobs[_jobId];
442- string memory _type = "TellorKpr " ;
440+ string memory _type = "FetchKpr " ;
443441 bytes memory _encodedArgs = abi.encode (
444442 _job.functionSig,
445443 _job.contractAddress,
0 commit comments