Skip to content

Commit

Permalink
Merge pull request #17 from fetchoracle/managed-feeds
Browse files Browse the repository at this point in the history
Managed Feeds
  • Loading branch information
jensendarren authored Mar 26, 2024
2 parents 49f6f40 + 851fcd0 commit 3bea6ab
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contracts/Autopay.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
pragma solidity 0.8.20;

//TODO fix import paths
import {UsingFetchUpgradeReady} from "usingfetch/contracts/UsingFetchUpgradeReady.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/QueryDataStorage.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
pragma solidity 0.8.20;

/**
@author Fetch Inc.
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
pragma solidity 0.8.20;

interface IERC20 {
function transfer(address _to, uint256 _amount) external returns(bool);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IQueryDataStorage.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma solidity 0.8.20;

interface IQueryDataStorage {
function storeData(bytes memory _queryData) external;
Expand Down
2 changes: 1 addition & 1 deletion contracts/testing/AutopayMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
pragma solidity 0.8.20;

import "../Autopay.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/testing/FetchPlayground.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma solidity 0.8.20;

contract FetchPlayground {
// Events
Expand Down
2 changes: 1 addition & 1 deletion contracts/testing/TestToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/testing/TipAndReport.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
pragma solidity 0.8.20;

import "../Autopay.sol";
import "./FetchPlayground.sol";
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require("dotenv").config();
solidity: {
compilers: [
{
version: "0.8.3",
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
Expand Down
10 changes: 9 additions & 1 deletion test/functionTests-FetchAutopay.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ describe("Autopay - function tests", () => {
assert.include(result.message, "must be sending an amount");
// require(IERC20(_feed.fetch).transferFrom(msg.sender,address(this),_amount),"ERC20: transfer amount exceeds balance");
result = await h.expectThrowMessage(autopay.fundFeed(bytesId, ETH_QUERY_ID, h.toWei("1000300")));
assert.include(result.message, "Arithmetic operation underflowed or overflowed outside of an unchecked block") // real message returned

const acceptableMessages = [
"Arithmetic operation underflowed or overflowed outside of an unchecked block",
"Arithmetic operation overflowed outside of an unchecked block",
"Arithmetic operation underflowed outside of an unchecked block"
];

const isAcceptableMessage = acceptableMessages.some(message => result.message.includes(message));
assert.isTrue(isAcceptableMessage, 'Expected one of the acceptable messages');
//VARIABLE UPDATES
// _feed.balance += _amount;
dataFeedDetails = await autopay.getDataFeed(bytesId);
Expand Down

0 comments on commit 3bea6ab

Please sign in to comment.