From 622475ca8e52c20b22ecb3a3d3325057490c747d Mon Sep 17 00:00:00 2001 From: 0xAustinWang Date: Mon, 10 Jul 2023 15:19:43 +0200 Subject: [PATCH] compilation errors from porting --- .../src/v0.8/functions/dev/0_0_0/FunctionsOracle.sol | 1 + .../src/v0.8/functions/dev/1_0_0/FunctionsBilling.sol | 4 ++-- .../src/v0.8/functions/dev/1_0_0/FunctionsCoordinator.sol | 8 ++++---- contracts/src/v0.8/functions/dev/1_0_0/RouterBase.sol | 2 +- .../src/v0.8/functions/tests/0_0_0/FunctionsOracle.t.sol | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/contracts/src/v0.8/functions/dev/0_0_0/FunctionsOracle.sol b/contracts/src/v0.8/functions/dev/0_0_0/FunctionsOracle.sol index b321aff841e..c20e1ac9898 100644 --- a/contracts/src/v0.8/functions/dev/0_0_0/FunctionsOracle.sol +++ b/contracts/src/v0.8/functions/dev/0_0_0/FunctionsOracle.sol @@ -24,6 +24,7 @@ contract FunctionsOracle is Initializable, IFunctionsOracle, OCR2BaseUpgradeable event UserCallbackError(bytes32 indexed requestId, string reason); event UserCallbackRawError(bytes32 indexed requestId, bytes lowLevelData); event InvalidRequestID(bytes32 indexed requestId); + event ResponseTransmitted(bytes32 indexed requestId, address transmitter); error EmptyRequestData(); error InconsistentReportData(); diff --git a/contracts/src/v0.8/functions/dev/1_0_0/FunctionsBilling.sol b/contracts/src/v0.8/functions/dev/1_0_0/FunctionsBilling.sol index 4d759e3d098..183126f8106 100644 --- a/contracts/src/v0.8/functions/dev/1_0_0/FunctionsBilling.sol +++ b/contracts/src/v0.8/functions/dev/1_0_0/FunctionsBilling.sol @@ -216,13 +216,13 @@ abstract contract FunctionsBilling is Route, IFunctionsBilling { // | Cost Estimation Methods | // ================================================================ /** - * @inheritdoc IFunctionsBilling + * @notice Uses current fees from DON and admin to estimate a cost */ function estimateCost( bytes calldata data, uint32 callbackGasLimit, uint256 gasPrice - ) external view override returns (uint96) { + ) external view returns (uint96) { RequestBilling memory billing = RequestBilling( 0, /*Use mock subscriptionId */ msg.sender, diff --git a/contracts/src/v0.8/functions/dev/1_0_0/FunctionsCoordinator.sol b/contracts/src/v0.8/functions/dev/1_0_0/FunctionsCoordinator.sol index ad9a4b2c6da..9c9ffd73e38 100644 --- a/contracts/src/v0.8/functions/dev/1_0_0/FunctionsCoordinator.sol +++ b/contracts/src/v0.8/functions/dev/1_0_0/FunctionsCoordinator.sol @@ -14,7 +14,7 @@ import {IFunctionsSubscriptions} from "./interfaces/IFunctionsSubscriptions.sol" * @notice Contract that nodes of a Decentralized Oracle Network (DON) interact with * @dev THIS CONTRACT HAS NOT GONE THROUGH ANY SECURITY REVIEW. DO NOT USE IN PROD. */ -contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilling { +abstract contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilling { uint16 constant REQUEST_DATA_VERSION = Functions.REQUEST_DATA_VERSION; event OracleRequest( @@ -56,16 +56,16 @@ contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilli } /** - * @inheritdoc IFunctionsOracle + * @inheritdoc IFunctionsCoordinator */ function getThresholdPublicKey() external view override returns (bytes memory) { return s_thresholdPublicKey; } /** - * @inheritdoc IFunctionsOracle + * @inheritdoc IFunctionsCoordinator */ - function setThresholdPublicKey(bytes calldata thresholdPublicKey) external override onlyOwner { + function setThresholdPublicKey(bytes calldata thresholdPublicKey) external override onlyRouterOwner { if (thresholdPublicKey.length == 0) { revert EmptyPublicKey(); } diff --git a/contracts/src/v0.8/functions/dev/1_0_0/RouterBase.sol b/contracts/src/v0.8/functions/dev/1_0_0/RouterBase.sol index 487a979d8d2..ffedd3d5725 100644 --- a/contracts/src/v0.8/functions/dev/1_0_0/RouterBase.sol +++ b/contracts/src/v0.8/functions/dev/1_0_0/RouterBase.sol @@ -287,7 +287,7 @@ abstract contract RouterBase is IRouterBase, Pausable, ITypeAndVersion, Confirme address implAddr = s_route[id]; bytes32 currentConfigHash; if (implAddr == address(this)) { - currentConfigHash = getConfigHash(); + currentConfigHash = s_config_hash; } else { currentConfigHash = IConfigurable(implAddr).getConfigHash(); } diff --git a/contracts/src/v0.8/functions/tests/0_0_0/FunctionsOracle.t.sol b/contracts/src/v0.8/functions/tests/0_0_0/FunctionsOracle.t.sol index 58848b0fce6..f5d368b1974 100644 --- a/contracts/src/v0.8/functions/tests/0_0_0/FunctionsOracle.t.sol +++ b/contracts/src/v0.8/functions/tests/0_0_0/FunctionsOracle.t.sol @@ -1,8 +1,8 @@ pragma solidity ^0.8.6; import {BaseTest} from "../BaseTest.t.sol"; -import {FunctionsOracle, FunctionsOracleWithInit} from "../testhelpers/FunctionsOracleWithInit.sol"; -import {FunctionsBillingRegistryWithInit} from "../testhelpers/FunctionsBillingRegistryWithInit.sol"; +import {FunctionsOracle, FunctionsOracleWithInit} from "./testhelpers/FunctionsOracleWithInit.sol"; +import {FunctionsBillingRegistryWithInit} from "./testhelpers/FunctionsBillingRegistryWithInit.sol"; import {ConfirmedOwnerUpgradeable} from "../../dev/0_0_0/accessControl/ConfirmedOwnerUpgradeable.sol"; // import {LinkToken} from "../../../../src/v0.4/LinkToken.sol";