|
1 | 1 | // SPDX-License-Identifier: MIT
|
2 | 2 | pragma solidity 0.8.3;
|
3 | 3 |
|
4 |
| -import {UsingFetch} from "usingfetch/contracts/UsingFetch.sol"; |
| 4 | +//TODO fix import paths |
| 5 | +import {UsingFetchUpgradeReady} from "usingfetch/contracts/UsingFetchUpgradeReady.sol"; |
5 | 6 | import {IERC20} from "./interfaces/IERC20.sol";
|
6 | 7 | import "./interfaces/IQueryDataStorage.sol";
|
| 8 | +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; |
| 9 | +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; |
| 10 | +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; |
7 | 11 |
|
8 | 12 | /**
|
9 | 13 | @author Fetch Inc.
|
10 | 14 | @title Autopay
|
11 | 15 | @dev This is a contract for automatically paying for Fetch oracle data at
|
12 | 16 | * specific time intervals, as well as one time tips.
|
13 | 17 | */
|
14 |
| -contract Autopay is UsingFetch { |
| 18 | +contract Autopay is UsingFetchUpgradeReady, Initializable, OwnableUpgradeable, UUPSUpgradeable { |
15 | 19 | // Storage
|
16 | 20 | IERC20 public token; // FETCH token address
|
17 | 21 | IQueryDataStorage public queryDataStorage; // Query data storage contract
|
@@ -91,20 +95,16 @@ contract Autopay is UsingFetch {
|
91 | 95 | address _reporter
|
92 | 96 | );
|
93 | 97 |
|
94 |
| - // Functions |
95 |
| - /** |
96 |
| - * @dev Initializes system parameters |
97 |
| - * @param _fetch address of Fetch contract |
98 |
| - * @param _queryDataStorage address of query data storage contract |
99 |
| - */ |
100 |
| - constructor( |
101 |
| - address payable _fetch, |
102 |
| - address _queryDataStorage |
103 |
| - ) UsingFetch(_fetch) { |
| 98 | + function initialize(address payable _fetch, address _queryDataStorage) public initializer { |
| 99 | + __Ownable_init(); |
| 100 | + setFetchAddress(_fetch); |
104 | 101 | token = IERC20(fetch.token());
|
105 | 102 | queryDataStorage = IQueryDataStorage(_queryDataStorage);
|
106 | 103 | }
|
107 | 104 |
|
| 105 | + function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner { |
| 106 | + } |
| 107 | + |
108 | 108 | /**
|
109 | 109 | * @dev Function to claim singular tip
|
110 | 110 | * @param _queryId id of reported data
|
|
0 commit comments