Skip to content

Commit bd32be7

Browse files
committed
search and replace tellor for fetch and trb for fetch, both case sensitive
1 parent ffff033 commit bd32be7

File tree

14 files changed

+444
-437
lines changed

14 files changed

+444
-437
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[![Tests](https://github.com/tellor-io/autopay/actions/workflows/tests.yml/badge.svg)](https://github.com/tellor-io/autopay/actions/workflows/tests.ymli)
1+
[![Tests](https://github.com/fetch-io/autopay/actions/workflows/tests.yml/badge.svg)](https://github.com/fetch-io/autopay/actions/workflows/tests.ymli)
22

33
## Overview <a name="overview"> </a>
44

5-
<b>Autopay</b> is a system for creating and funding data feeds for use with Tellor.
5+
<b>Autopay</b> is a system for creating and funding data feeds for use with Fetch.
66

77
## To Use
88

@@ -73,7 +73,7 @@ To receive fees from a recurring feed:
7373
```solidity
7474
7575
/**
76-
* @param _reporter address of Tellor reporter
76+
* @param _reporter address of Fetch reporter
7777
* @param _feedId unique feed identifier
7878
* @param _queryId ID of reported data
7979
* @param _timestamps[] batch of timestamps array of reported data eligible for reward
@@ -119,13 +119,13 @@ npx hardhat test
119119
```
120120

121121
## Maintainers <a name="maintainers"> </a>
122-
This repository is maintained by the [Tellor team](https://github.com/orgs/tellor-io/people)
122+
This repository is maintained by the [Fetch team](https://github.com/orgs/fetch-io/people)
123123

124124

125125
## How to Contribute<a name="how2contribute"> </a>
126126

127-
Check out our issues log here on Github or feel free to reach out anytime [info@tellor.io](mailto:info@tellor.io)
127+
Check out our issues log here on Github or feel free to reach out anytime [info@fetch.io](mailto:info@fetch.io)
128128

129129
## Copyright
130130

131-
Tellor Inc. 2022
131+
Fetch Inc. 2022

contracts/Autopay.sol

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.3;
33

4-
import {UsingTellor} from "usingtellor/contracts/UsingTellor.sol";
4+
import {UsingFetch} from "usingfetch/contracts/UsingFetch.sol";
55
import {IERC20} from "./interfaces/IERC20.sol";
66
import "./interfaces/IQueryDataStorage.sol";
77

88
/**
9-
@author Tellor Inc.
9+
@author Fetch Inc.
1010
@title Autopay
11-
@dev This is a contract for automatically paying for Tellor oracle data at
11+
@dev This is a contract for automatically paying for Fetch oracle data at
1212
* specific time intervals, as well as one time tips.
1313
*/
14-
contract Autopay is UsingTellor {
14+
contract Autopay is UsingFetch {
1515
// Storage
16-
IERC20 public token; // TRB token address
16+
IERC20 public token; // FETCH token address
1717
IQueryDataStorage public queryDataStorage; // Query data storage contract
1818
uint256 public fee; // 1000 is 100%, 50 is 5%, etc.
1919

@@ -95,16 +95,16 @@ contract Autopay is UsingTellor {
9595
// Functions
9696
/**
9797
* @dev Initializes system parameters
98-
* @param _tellor address of Tellor contract
98+
* @param _fetch address of Fetch contract
9999
* @param _queryDataStorage address of query data storage contract
100100
* @param _fee percentage, 1000 is 100%, 50 is 5%, etc.
101101
*/
102102
constructor(
103-
address payable _tellor,
103+
address payable _fetch,
104104
address _queryDataStorage,
105105
uint256 _fee
106-
) UsingTellor(_tellor) {
107-
token = IERC20(tellor.token());
106+
) UsingFetch(_fetch) {
107+
token = IERC20(fetch.token());
108108
queryDataStorage = IQueryDataStorage(_queryDataStorage);
109109
fee = _fee;
110110
}
@@ -135,8 +135,8 @@ contract Autopay is UsingTellor {
135135
_cumulativeReward - ((_cumulativeReward * fee) / 1000)
136136
)
137137
);
138-
token.approve(address(tellor), (_cumulativeReward * fee) / 1000);
139-
tellor.addStakingRewards((_cumulativeReward * fee) / 1000);
138+
token.approve(address(fetch), (_cumulativeReward * fee) / 1000);
139+
fetch.addStakingRewards((_cumulativeReward * fee) / 1000);
140140
if (getCurrentTip(_queryId) == 0) {
141141
if (queryIdsWithFundingIndex[_queryId] != 0) {
142142
uint256 _idx = queryIdsWithFundingIndex[_queryId] - 1;
@@ -154,7 +154,7 @@ contract Autopay is UsingTellor {
154154
}
155155

156156
/**
157-
* @dev Allows Tellor reporters to claim their tips in batches
157+
* @dev Allows Fetch reporters to claim their tips in batches
158158
* @param _feedId unique feed identifier
159159
* @param _queryId ID of reported data
160160
* @param _timestamps batch of timestamps array of reported data eligible for reward
@@ -216,8 +216,8 @@ contract Autopay is UsingTellor {
216216
_cumulativeReward - ((_cumulativeReward * fee) / 1000)
217217
)
218218
);
219-
token.approve(address(tellor), (_cumulativeReward * fee) / 1000);
220-
tellor.addStakingRewards((_cumulativeReward * fee) / 1000);
219+
token.approve(address(fetch), (_cumulativeReward * fee) / 1000);
220+
fetch.addStakingRewards((_cumulativeReward * fee) / 1000);
221221
emit TipClaimed(_feedId, _queryId, _cumulativeReward, msg.sender);
222222
}
223223

contracts/Keeper.sol

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
pragma 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";
1313
import "./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,

contracts/QueryDataStorage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity 0.8.3;
33

44
/**
5-
@author Tellor Inc.
5+
@author Fetch Inc.
66
@title QueryDataStorage
77
@dev This contract is used for storing query data
88
*/

contracts/testing/AutopayMock.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import "../Autopay.sol";
55

66
contract AutopayMock is Autopay {
77
constructor(
8-
address payable _tellor,
8+
address payable _fetch,
99
address _queryDataStorage,
1010
uint256 _fee
11-
) Autopay(_tellor, _queryDataStorage, _fee) {}
11+
) Autopay(_fetch, _queryDataStorage, _fee) {}
1212

1313
function bytesToUint(bytes memory _b) public pure returns(uint256) {
1414
return _bytesToUint(_b);

0 commit comments

Comments
 (0)