From e1e95e35a7a3a12154d574f29bde4efeedb11aa1 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Sat, 9 Sep 2023 04:06:50 -0700 Subject: [PATCH 01/12] Flip fee tokens in report decoding --- contracts/src/v0.8/llo-feeds/dev/FeeManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol index 2e5d060dca6..c770ad02109 100644 --- a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol @@ -259,7 +259,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { uint256 linkQuantity; uint256 nativeQuantity; uint256 expiresAt; - (, , , linkQuantity, nativeQuantity, expiresAt) = abi.decode( + (, , , nativeQuantity, linkQuantity, expiresAt) = abi.decode( report, (bytes32, uint32, uint32, uint192, uint192, uint32) ); From f6548d9e59ed3ca9a5c5072e5bd3a2c30bc5f255 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Tue, 12 Sep 2023 08:34:12 -0700 Subject: [PATCH 02/12] Use array of quotePayload --- .../src/v0.8/llo-feeds/VerifierProxy.sol | 8 ++--- .../src/v0.8/llo-feeds/dev/FeeManager.sol | 31 +++++++++---------- .../llo-feeds/dev/interfaces/IFeeManager.sol | 4 +-- .../dev/interfaces/IVerifierFeeManager.sol | 10 +++--- .../llo-feeds/interfaces/IVerifierProxy.sol | 10 +++--- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol index 4df6691b6ac..fc902484057 100644 --- a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol @@ -121,24 +121,24 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac } /// @inheritdoc IVerifierProxy - function verify(bytes calldata payload) external payable checkAccess returns (bytes memory) { + function verify(bytes calldata payload, bytes calldata quotePayload) external payable checkAccess returns (bytes memory) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier if (address(feeManager) != address(0)) { - feeManager.processFee{value: msg.value}(payload, msg.sender); + feeManager.processFee{value: msg.value}(payload, quotePayload, msg.sender); } return _verify(payload); } /// @inheritdoc IVerifierProxy - function verifyBulk(bytes[] calldata payloads) external payable checkAccess returns (bytes[] memory verifiedReports) { + function verifyBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads) external payable checkAccess returns (bytes[] memory verifiedReports) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier if (address(feeManager) != address(0)) { - feeManager.processFeeBulk{value: msg.value}(payloads, msg.sender); + feeManager.processFeeBulk{value: msg.value}(payloads, quotePayloads, msg.sender); } //verify the reports diff --git a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol index c770ad02109..beeb512485c 100644 --- a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol @@ -169,8 +169,8 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } /// @inheritdoc IVerifierFeeManager - function processFee(bytes calldata payload, address subscriber) external payable override onlyProxy { - (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(payload, subscriber); + function processFee(bytes calldata payload, bytes calldata quotePayload, address subscriber) external payable override onlyProxy { + (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(payload, quotePayload, subscriber); if (fee.amount == 0) { _tryReturnChange(subscriber, msg.value); @@ -188,17 +188,22 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } /// @inheritdoc IVerifierFeeManager - function processFeeBulk(bytes[] calldata payloads, address subscriber) external payable override onlyProxy { + function processFeeBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads, address subscriber) external payable override onlyProxy { FeeAndReward[] memory feesAndRewards = new IFeeManager.FeeAndReward[](payloads.length); //keep track of the number of fees to prevent over initialising the FeePayment array within _convertToLinkAndNativeFees uint256 numberOfLinkFees; uint256 numberOfNativeFees; + bool separateQuotePayloads = quotePayloads.length > 1; + uint256 feesAndRewardsIndex; for (uint256 i; i < payloads.length; ++i) { + bytes calldata quotePayload = separateQuotePayloads ? quotePayloads[i] : quotePayloads[0]; + (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee( payloads[i], + quotePayload, subscriber ); @@ -232,7 +237,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { function getFeeAndReward( address subscriber, bytes memory report, - Quote memory quote + address quoteAddress ) public view returns (Common.Asset memory, Common.Asset memory, uint256) { Common.Asset memory fee; Common.Asset memory reward; @@ -251,7 +256,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } //verify the quote payload is a supported token - if (quote.quoteAddress != i_nativeAddress && quote.quoteAddress != i_linkAddress) { + if (quoteAddress != i_nativeAddress && quoteAddress != i_linkAddress) { revert InvalidQuote(); } @@ -270,14 +275,14 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } //get the discount being applied - uint256 discount = s_subscriberDiscounts[subscriber][feedId][quote.quoteAddress]; + uint256 discount = s_subscriberDiscounts[subscriber][feedId][quoteAddress]; //the reward is always set in LINK reward.assetAddress = i_linkAddress; reward.amount = Math.ceilDiv(linkQuantity * (PERCENTAGE_SCALAR - discount), PERCENTAGE_SCALAR); //calculate either the LINK fee or native fee if it's within the report - if (quote.quoteAddress == i_linkAddress) { + if (quoteAddress == i_linkAddress) { fee.assetAddress = i_linkAddress; fee.amount = reward.amount; } else { @@ -358,6 +363,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { function _processFee( bytes calldata payload, + bytes calldata quotePayload, address subscriber ) internal view returns (Common.Asset memory, Common.Asset memory, uint256) { if (subscriber == address(this)) revert InvalidAddress(); @@ -369,17 +375,10 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { bytes32 feedId = bytes32(report); //v1 doesn't need a quote payload, so skip the decoding - Quote memory quote; + address quote; if (_getReportVersion(feedId) != REPORT_V1) { - //all reports greater than v1 should have a quote payload - (, , , , , bytes memory quoteBytes) = abi.decode( - payload, - // reportContext, report, rs, ss, raw, quote - (bytes32[3], bytes, bytes32[], bytes32[], bytes32, bytes) - ); - //decode the quote from the bytes - (quote) = abi.decode(quoteBytes, (Quote)); + (quote) = abi.decode(quotePayload, (address)); } //decode the fee, it will always be native or LINK diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IFeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IFeeManager.sol index 49fd7f95587..dc5bffd159d 100644 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/interfaces/IFeeManager.sol @@ -10,13 +10,13 @@ interface IFeeManager is IERC165, IVerifierFeeManager { * @notice Calculate the applied fee and the reward from a report. If the sender is a subscriber, they will receive a discount. * @param subscriber address trying to verify * @param report report to calculate the fee for - * @param quote any metadata required to fetch the fee + * @param quoteAddress address of the quote payment token * @return (fee, reward, totalDiscount) fee and the reward data with the discount applied */ function getFeeAndReward( address subscriber, bytes memory report, - Quote memory quote + address quoteAddress ) external returns (Common.Asset memory, Common.Asset memory, uint256); /** diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol index c9b1a821746..99ff1e6fe12 100644 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol @@ -7,17 +7,19 @@ import {Common} from "../../../libraries/Common.sol"; interface IVerifierFeeManager is IERC165 { /** * @notice Handles fees for a report from the subscriber and manages rewards - * @param payload report and quote to process the fee for + * @param payload report to process the fee for + * @param quotePayload quote payload * @param subscriber address of the fee will be applied */ - function processFee(bytes calldata payload, address subscriber) external payable; + function processFee(bytes calldata payload, bytes calldata quotePayload, address subscriber) external payable; /** * @notice Processes the fees for each report in the payload, billing the subscriber and paying the reward manager - * @param payloads reports and quotes to process + * @param payloads reports to process + * @param quotePayloads quote payloads for each payload or 1 for all * @param subscriber address of the user to process fee for */ - function processFeeBulk(bytes[] calldata payloads, address subscriber) external payable; + function processFeeBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads, address subscriber) external payable; /** * @notice Sets the fee recipients according to the fee manager diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol index 82ac492f5c3..75475f2672d 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol @@ -10,19 +10,21 @@ interface IVerifierProxy { * @notice Verifies that the data encoded has been signed * correctly by routing to the correct verifier, and bills the user if applicable. * @param payload The encoded data to be verified, including the signed - * report and any metadata for billing. + * report. + * @param quotePayload quote metadata for billing * @return verifierResponse The encoded report from the verifier. */ - function verify(bytes calldata payload) external payable returns (bytes memory verifierResponse); + function verify(bytes calldata payload, bytes calldata quotePayload) external payable returns (bytes memory verifierResponse); /** * @notice Bulk verifies that the data encoded has been signed * correctly by routing to the correct verifier, and bills the user if applicable. * @param payloads The encoded payloads to be verified, including the signed - * report and any metadata for billing. + * report. + * @param quotePayloads quote metadata for billing * @return verifiedReports The encoded reports from the verifier. */ - function verifyBulk(bytes[] calldata payloads) external payable returns (bytes[] memory verifiedReports); + function verifyBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads) external payable returns (bytes[] memory verifiedReports); /** * @notice Sets the verifier address initially, allowing `setVerifier` to be set by this Verifier in the future From e2df7e131e9486a9324a35c47a14c2f303dcb162 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Wed, 13 Sep 2023 11:25:11 -0700 Subject: [PATCH 03/12] Update interface to single quote payload --- contracts/src/v0.8/llo-feeds/VerifierProxy.sol | 8 ++++---- contracts/src/v0.8/llo-feeds/dev/FeeManager.sol | 12 ++++-------- .../llo-feeds/dev/interfaces/IVerifierFeeManager.sol | 8 ++++---- .../src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol | 8 ++++---- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol index fc902484057..a8ff8eced6b 100644 --- a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol @@ -121,24 +121,24 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac } /// @inheritdoc IVerifierProxy - function verify(bytes calldata payload, bytes calldata quotePayload) external payable checkAccess returns (bytes memory) { + function verify(bytes calldata payload, bytes calldata feePayload) external payable checkAccess returns (bytes memory) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier if (address(feeManager) != address(0)) { - feeManager.processFee{value: msg.value}(payload, quotePayload, msg.sender); + feeManager.processFee{value: msg.value}(payload, feePayload, msg.sender); } return _verify(payload); } /// @inheritdoc IVerifierProxy - function verifyBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads) external payable checkAccess returns (bytes[] memory verifiedReports) { + function verifyBulk(bytes[] calldata payloads, bytes calldata feePayload) external payable checkAccess returns (bytes[] memory verifiedReports) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier if (address(feeManager) != address(0)) { - feeManager.processFeeBulk{value: msg.value}(payloads, quotePayloads, msg.sender); + feeManager.processFeeBulk{value: msg.value}(payloads, feePayload, msg.sender); } //verify the reports diff --git a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol index beeb512485c..0b7c3f4bf4c 100644 --- a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol @@ -169,8 +169,8 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } /// @inheritdoc IVerifierFeeManager - function processFee(bytes calldata payload, bytes calldata quotePayload, address subscriber) external payable override onlyProxy { - (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(payload, quotePayload, subscriber); + function processFee(bytes calldata payload, bytes calldata feePayload, address subscriber) external payable override onlyProxy { + (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(payload, feePayload, subscriber); if (fee.amount == 0) { _tryReturnChange(subscriber, msg.value); @@ -188,22 +188,18 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } /// @inheritdoc IVerifierFeeManager - function processFeeBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads, address subscriber) external payable override onlyProxy { + function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload, address subscriber) external payable override onlyProxy { FeeAndReward[] memory feesAndRewards = new IFeeManager.FeeAndReward[](payloads.length); //keep track of the number of fees to prevent over initialising the FeePayment array within _convertToLinkAndNativeFees uint256 numberOfLinkFees; uint256 numberOfNativeFees; - bool separateQuotePayloads = quotePayloads.length > 1; - uint256 feesAndRewardsIndex; for (uint256 i; i < payloads.length; ++i) { - bytes calldata quotePayload = separateQuotePayloads ? quotePayloads[i] : quotePayloads[0]; - (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee( payloads[i], - quotePayload, + feePayload, subscriber ); diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol index 99ff1e6fe12..46dba4e8a20 100644 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol @@ -8,18 +8,18 @@ interface IVerifierFeeManager is IERC165 { /** * @notice Handles fees for a report from the subscriber and manages rewards * @param payload report to process the fee for - * @param quotePayload quote payload + * @param feePayload fee payload * @param subscriber address of the fee will be applied */ - function processFee(bytes calldata payload, bytes calldata quotePayload, address subscriber) external payable; + function processFee(bytes calldata payload, bytes calldata feePayload, address subscriber) external payable; /** * @notice Processes the fees for each report in the payload, billing the subscriber and paying the reward manager * @param payloads reports to process - * @param quotePayloads quote payloads for each payload or 1 for all + * @param feePayload fee payload * @param subscriber address of the user to process fee for */ - function processFeeBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads, address subscriber) external payable; + function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload, address subscriber) external payable; /** * @notice Sets the fee recipients according to the fee manager diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol index 75475f2672d..3eabbdd5ed6 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol @@ -11,20 +11,20 @@ interface IVerifierProxy { * correctly by routing to the correct verifier, and bills the user if applicable. * @param payload The encoded data to be verified, including the signed * report. - * @param quotePayload quote metadata for billing + * @param feePayload fee metadata for billing * @return verifierResponse The encoded report from the verifier. */ - function verify(bytes calldata payload, bytes calldata quotePayload) external payable returns (bytes memory verifierResponse); + function verify(bytes calldata payload, bytes calldata feePayload) external payable returns (bytes memory verifierResponse); /** * @notice Bulk verifies that the data encoded has been signed * correctly by routing to the correct verifier, and bills the user if applicable. * @param payloads The encoded payloads to be verified, including the signed * report. - * @param quotePayloads quote metadata for billing + * @param feePayload fee metadata for billing * @return verifiedReports The encoded reports from the verifier. */ - function verifyBulk(bytes[] calldata payloads, bytes[] calldata quotePayloads) external payable returns (bytes[] memory verifiedReports); + function verifyBulk(bytes[] calldata payloads, bytes calldata feePayload) external payable returns (bytes[] memory verifiedReports); /** * @notice Sets the verifier address initially, allowing `setVerifier` to be set by this Verifier in the future From 838e0723fa34d2ab2a933fa0205b0050d7a43ef6 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Wed, 13 Sep 2023 15:07:27 -0700 Subject: [PATCH 04/12] Passing tests --- .../test/fee-manager/BaseFeeManager.t.sol | 46 ++-- .../test/fee-manager/FeeManager.general.t.sol | 26 +-- .../FeeManager.getFeeAndReward.t.sol | 62 +++--- .../fee-manager/FeeManager.processFee.t.sol | 120 +++++------ .../FeeManager.processFeeBulk.t.sol | 136 ++++-------- .../llo-feeds/test/gas/Gas_VerifierTest.t.sol | 36 ++-- .../llo-feeds/test/mocks/FeeManagerProxy.sol | 8 +- .../test/verifier/BaseVerifierTest.t.sol | 22 +- .../verifier/VerifierActivateConfigTest.t.sol | 2 +- .../verifier/VerifierDeactivateFeedTest.t.sol | 8 +- .../verifier/VerifierTestBillingReport.t.sol | 199 ++++-------------- .../test/verifier/VerifierVerifyTest.t.sol | 42 ++-- 12 files changed, 250 insertions(+), 457 deletions(-) diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol index bcc5aa7031a..a0d38cc9943 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol @@ -98,8 +98,8 @@ contract BaseFeeManagerTest is Test { native = new WERC20Mock(); feeManagerProxy = new FeeManagerProxy(); - rewardManager = new RewardManager(getLinkAddress()); - feeManager = new FeeManager(getLinkAddress(), getNativeAddress(), address(feeManagerProxy), address(rewardManager)); + rewardManager = new RewardManager(address(link)); + feeManager = new FeeManager(address(link), address(native), address(feeManagerProxy), address(rewardManager)); //link the feeManager to the proxy feeManagerProxy.setFeeManager(feeManager); @@ -156,7 +156,7 @@ contract BaseFeeManagerTest is Test { // solium-disable-next-line no-unused-vars function getFee( bytes memory report, - IFeeManager.Quote memory quote, + address quote, address subscriber ) public view returns (Common.Asset memory) { //get the fee @@ -167,7 +167,7 @@ contract BaseFeeManagerTest is Test { function getReward( bytes memory report, - IFeeManager.Quote memory quote, + address quote, address subscriber ) public view returns (Common.Asset memory) { //get the reward @@ -178,7 +178,7 @@ contract BaseFeeManagerTest is Test { function getAppliedDiscount( bytes memory report, - IFeeManager.Quote memory quote, + address quote, address subscriber ) public view returns (uint256) { //get the reward @@ -239,12 +239,12 @@ contract BaseFeeManagerTest is Test { ); } - function getLinkQuote() public view returns (IFeeManager.Quote memory) { - return IFeeManager.Quote(getLinkAddress()); + function getLinkQuote() public view returns (address) { + return address(link); } - function getNativeQuote() public view returns (IFeeManager.Quote memory) { - return IFeeManager.Quote(getNativeAddress()); + function getNativeQuote() public view returns (address) { + return address(native); } function withdraw(address assetAddress, address recipient, uint256 amount, address sender) public { @@ -302,6 +302,7 @@ contract BaseFeeManagerTest is Test { function ProcessFeeAsUser( bytes memory payload, address subscriber, + address tokenAddress, uint256 wrappedNativeValue, address sender ) public { @@ -310,52 +311,47 @@ contract BaseFeeManagerTest is Test { changePrank(sender); //process the fee - feeManager.processFee{value: wrappedNativeValue}(payload, subscriber); + feeManager.processFee{value: wrappedNativeValue}(payload, abi.encode(tokenAddress), subscriber); //change ProcessFeeAsUserback to the original address changePrank(originalAddr); } - function processFee(bytes memory payload, address subscriber, uint256 wrappedNativeValue) public { + function processFee(bytes memory payload, address subscriber, address feeAddress, uint256 wrappedNativeValue) public { //record the current address and switch to the recipient address originalAddr = msg.sender; changePrank(subscriber); //process the fee - feeManagerProxy.processFee{value: wrappedNativeValue}(payload); + feeManagerProxy.processFee{value: wrappedNativeValue}(payload, abi.encode(feeAddress)); //change back to the original address changePrank(originalAddr); } - function processFee(bytes[] memory payloads, address subscriber, uint256 wrappedNativeValue) public { + function processFee(bytes[] memory payloads, address subscriber, address feeAddress, uint256 wrappedNativeValue) public { //record the current address and switch to the recipient address originalAddr = msg.sender; changePrank(subscriber); //process the fee - feeManagerProxy.processFeeBulk{value: wrappedNativeValue}(payloads); + feeManagerProxy.processFeeBulk{value: wrappedNativeValue}(payloads, abi.encode(feeAddress)); //change back to the original address changePrank(originalAddr); } - function getPayload(bytes memory reportPayload, bytes memory quotePayload) public pure returns (bytes memory) { + function getPayload(bytes memory reportPayload) public pure returns (bytes memory) { return abi.encode( [DEFAULT_CONFIG_DIGEST, 0, 0], reportPayload, new bytes32[](1), new bytes32[](1), - bytes32(""), - quotePayload + bytes32("") ); } - function getQuotePayload(address quoteAddress) public pure returns (bytes memory) { - return abi.encode(quoteAddress); - } - function approveLink(address spender, uint256 quantity, address sender) public { //record the current address and switch to the recipient address originalAddr = msg.sender; @@ -380,14 +376,6 @@ contract BaseFeeManagerTest is Test { changePrank(originalAddr); } - function getLinkAddress() public view returns (address) { - return address(link); - } - - function getNativeAddress() public view returns (address) { - return address(native); - } - function payLinkDeficit(bytes32 configDigest, address sender) public { //record the current address and switch to the recipient address originalAddr = msg.sender; diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol index d776c54eb36..5277f3b6873 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol @@ -28,7 +28,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { uint256 withdrawAmount = contractBalance / 2; //withdraw some balance - withdraw(getLinkAddress(), ADMIN, withdrawAmount, ADMIN); + withdraw(address(link), ADMIN, withdrawAmount, ADMIN); //check the balance has been reduced uint256 newContractBalance = getLinkBalance(address(feeManager)); @@ -76,7 +76,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); //withdraw some balance - withdraw(getLinkAddress(), ADMIN, DEFAULT_LINK_MINT_QUANTITY, USER); + withdraw(address(link), ADMIN, DEFAULT_LINK_MINT_QUANTITY, USER); } function test_eventIsEmittedAfterSurchargeIsSet() public { @@ -101,10 +101,10 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectEmit(); //emit the event that is expected to be emitted - emit SubscriberDiscountUpdated(USER, DEFAULT_FEED_1_V3, getNativeAddress(), discount); + emit SubscriberDiscountUpdated(USER, DEFAULT_FEED_1_V3, address(native), discount); //set the surcharge - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), discount, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), discount, ADMIN); } function test_eventIsEmittedUponWithdraw() public { @@ -118,10 +118,10 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectEmit(); //the event to be emitted - emit Withdraw(ADMIN, ADMIN, getLinkAddress(), withdrawAmount); + emit Withdraw(ADMIN, ADMIN, address(link), withdrawAmount); //withdraw some balance - withdraw(getLinkAddress(), ADMIN, withdrawAmount, ADMIN); + withdraw(address(link), ADMIN, withdrawAmount, ADMIN); } function test_linkAvailableForPaymentReturnsLinkBalance() public { @@ -137,7 +137,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_payLinkDeficit() public { //get the default payload - bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3)); approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); @@ -150,7 +150,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { emit InsufficientLink(contractFees); //process the fee - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); //double check the rewardManager balance is 0 assertEq(getLinkBalance(address(rewardManager)), 0); @@ -170,7 +170,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_payLinkDeficitTwice() public { //get the default payload - bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3)); approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); @@ -184,7 +184,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { emit InsufficientLink(contractFees); //process the fee - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); //double check the rewardManager balance is 0 assertEq(getLinkBalance(address(rewardManager)), 0); @@ -209,14 +209,14 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_payLinkDeficitPaysAllFeesProcessed() public { //get the default payload - bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3)); //approve the native to be transferred from the user approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 2, USER); //processing the fee will transfer the native from the user to the feeManager - processFee(payload, USER, 0); - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); + processFee(payload, USER, address(native), 0); //check the deficit has been increased twice assertEq(getLinkDeficit(DEFAULT_CONFIG_DIGEST), DEFAULT_REPORT_LINK_FEE * 2); diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol index f31c06bd41e..03b8da04046 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol @@ -31,7 +31,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_discountAIsNotAppliedWhenSetForOtherUsers() public { //set the subscriber discount for another user - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), INVALID_ADDRESS); @@ -50,7 +50,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_discountIsAppliedForLink() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -61,7 +61,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_DiscountIsAppliedForNative() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -72,7 +72,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_discountIsNoLongerAppliedAfterRemoving() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -81,7 +81,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(fee.amount, DEFAULT_REPORT_LINK_FEE / 2); //remove the discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), 0, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), 0, ADMIN); //get the fee required by the feeManager fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -181,7 +181,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { uint256 nativeSurcharge = FEE_SCALAR / 5; //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //set the surcharge setNativeSurcharge(nativeSurcharge, ADMIN); @@ -204,7 +204,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectRevert(INVALID_QUOTE_ERROR); //get the fee required by the feeManager - getFee(getV3Report(DEFAULT_FEED_1_V3), IFeeManager.Quote(address(0)), USER); + getFee(getV3Report(DEFAULT_FEED_1_V3), address(0), USER); } function test_nativeSurcharge100Percent() public { @@ -239,7 +239,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_discountIsAppliedWith100PercentSurcharge() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //set the surcharge setNativeSurcharge(FEE_SCALAR, ADMIN); @@ -256,7 +256,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_feeIsZeroWith100PercentDiscount() public { //set the subscriber discount to 100% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -267,7 +267,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_feeIsUpdatedAfterDiscountIsRemoved() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -279,7 +279,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); //remove the discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), 0, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), 0, ADMIN); //get the fee required by the feeManager fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -290,7 +290,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_feeIsUpdatedAfterNewDiscountIsApplied() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -302,7 +302,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); //change the discount to 25% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 4, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 4, ADMIN); //get the fee required by the feeManager fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -319,7 +319,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectRevert(INVALID_DISCOUNT_ERROR); //set the subscriber discount to over 100% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR + 1, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR + 1, ADMIN); } function test_surchargeIsNotAppliedWith100PercentDiscount() public { @@ -327,7 +327,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { uint256 nativeSurcharge = FEE_SCALAR / 5; //set the subscriber discount to 100% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR, ADMIN); //set the surcharge setNativeSurcharge(nativeSurcharge, ADMIN); @@ -344,7 +344,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR, USER); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR, USER); } function test_surchargeFeeRoundsUpWhenUneven() public { @@ -369,7 +369,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { uint256 discount = FEE_SCALAR / 3; //set the subscriber discount to 33.333% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), discount, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), discount, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -391,8 +391,8 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_correctDiscountIsAppliedWhenBothTokensAreDiscounted() public { //set the subscriber and native discounts - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 4, ADMIN); - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 4, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager for both tokens Common.Asset memory linkFee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -409,7 +409,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_discountIsNotAppliedToOtherFeeds() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_2_V3), getNativeQuote(), USER); @@ -420,7 +420,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_noFeeIsAppliedWhenReportHasZeroFee() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee( @@ -435,7 +435,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_noFeeIsAppliedWhenReportHasZeroFeeAndDiscountAndSurchargeIsSet() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //set the surcharge setNativeSurcharge(FEE_SCALAR / 2, ADMIN); @@ -475,7 +475,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_getRewardWithLinkQuoteAndLinkDiscount() public { //set the link discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -505,7 +505,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_getRewardWithLinkDiscount() public { //set the link discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); //get the fee required by the feeManager Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -516,7 +516,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_getLinkFeeIsRoundedUp() public { //set the link discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 3, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 3, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -527,14 +527,14 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_getLinkRewardIsSameAsFee() public { //set the link discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 3, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 3, ADMIN); //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); //check the reward is in link - assertEq(fee.assetAddress, getLinkAddress()); + assertEq(fee.assetAddress, address(link)); //the reward should equal .66% of the base fee due to a 33% discount rounded down assertEq(reward.amount, fee.amount); @@ -545,7 +545,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { setNativeSurcharge(FEE_SCALAR / 2, ADMIN); //set the link discount - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 3, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 3, ADMIN); //get the fee required by the feeManager Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -573,7 +573,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_discountIsReturnedForLink() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getLinkAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); //get the fee applied uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -584,7 +584,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_DiscountIsReturnedForNative() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //get the discount applied uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -595,7 +595,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_DiscountIsReturnedForNativeWithSurcharge() public { //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //set the surcharge setNativeSurcharge(FEE_SCALAR / 5, ADMIN); diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol index aa0ca063d85..6522cc15a8d 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol @@ -19,24 +19,24 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_nonAdminProxyUserCannotProcessFee() public { //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //should revert as the user is not the owner vm.expectRevert(UNAUTHORIZED_ERROR); //process the fee - ProcessFeeAsUser(payload, USER, 0, USER); + ProcessFeeAsUser(payload, USER, address(link), 0, USER); } function test_processFeeAsProxy() public { //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //approve the link to be transferred from the from the subscriber to the rewardManager approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); //check the link has been transferred assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); @@ -47,35 +47,35 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_processFeeIfSubscriberIsSelf() public { //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //expect a revert due to the feeManager being the subscriber vm.expectRevert(INVALID_ADDRESS_ERROR); //process the fee will fail due to assertion - processFee(payload, address(feeManager), 0); + processFee(payload, address(feeManager), address(native), 0); } function test_processFeeWithWithEmptyQuotePayload() public { //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), bytes("")); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //expect a revert as the quote is invalid vm.expectRevert(); //processing the fee will transfer the link by default - processFee(payload, USER, 0); + processFee(payload, USER, address(0), 0); } function test_processFeeWithWithZeroQuotePayload() public { //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(INVALID_ADDRESS)); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //expect a revert as the quote is invalid vm.expectRevert(INVALID_QUOTE_ERROR); //processing the fee will transfer the link by default - processFee(payload, USER, 0); + processFee(payload, USER, INVALID_ADDRESS, 0); } function test_processFeeWithWithCorruptQuotePayload() public { @@ -92,23 +92,23 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { vm.expectRevert(); //processing the fee will not withdraw anything as there is no fee to collect - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); } function test_processFeeDefaultReportsStillVerifiesWithEmptyQuote() public { //get the default payload - bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1), bytes("")); + bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(0), 0); } function test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() public { //get the default payload - bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); //processing the fee will not withdraw anything as there is no fee to collect - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); } function test_processFeeNative() public { @@ -116,13 +116,13 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //approve the native to be transferred from the user approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); //processing the fee will transfer the native from the user to the feeManager - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); //check the native has been transferred assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); @@ -142,7 +142,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE / 2); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //approve the native to be transferred from the user approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); @@ -157,7 +157,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { emit InsufficientLink(contractFees); //processing the fee will transfer the native from the user to the feeManager - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); //check the native has been transferred assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); @@ -175,10 +175,10 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //only the proxy or admin can call processFee, they will pass in the native value on the users behalf - processFee(payload, USER, DEFAULT_REPORT_NATIVE_FEE); + processFee(payload, USER, address(native), DEFAULT_REPORT_NATIVE_FEE); //check the native has been transferred and converted to wrapped native assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); @@ -199,13 +199,13 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //expect a revert as not enough funds vm.expectRevert(INVALID_DEPOSIT_ERROR); //only the proxy or admin can call processFee, they will pass in the native value on the users behalf - processFee(payload, USER, DEFAULT_REPORT_NATIVE_FEE - 1); + processFee(payload, USER, address(native), DEFAULT_REPORT_NATIVE_FEE - 1); } function test_processFeeWithUnwrappedNativeLinkAddress() public { @@ -213,13 +213,13 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //expect a revert as not enough funds vm.expectRevert(INSUFFICIENT_ALLOWANCE_ERROR); //the change will be returned and the user will attempted to be billed in LINK - processFee(payload, USER, DEFAULT_REPORT_NATIVE_FEE - 1); + processFee(payload, USER, address(link), DEFAULT_REPORT_NATIVE_FEE - 1); } function test_processFeeWithUnwrappedNativeLinkAddressExcessiveFee() public { @@ -227,10 +227,10 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, PROXY); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //call processFee from the proxy to test whether the funds are returned to the subscriber. In reality, the funds would be returned to the caller of the proxy. - processFee(payload, PROXY, DEFAULT_REPORT_NATIVE_FEE); + processFee(payload, PROXY, address(link), DEFAULT_REPORT_NATIVE_FEE); //check the native unwrapped is no longer in the account assertEq(getNativeBalance(address(feeManager)), 0); @@ -251,10 +251,10 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //call processFee from the proxy to test whether the funds are returned to the subscriber. In reality, the funds would be returned to the caller of the proxy. - processFee(payload, PROXY, DEFAULT_REPORT_NATIVE_FEE * 2); + processFee(payload, PROXY, address(native), DEFAULT_REPORT_NATIVE_FEE * 2); //check the native has been transferred and converted to wrapped native assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); @@ -272,13 +272,13 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_processFeeUsesCorrectDigest() public { //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //approve the link to be transferred from the from the subscriber to the rewardManager approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); //check the link has been transferred assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); @@ -301,18 +301,18 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { ); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(0), 0); } function test_V2PayloadVerifies() public { //get the default payload - bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2)); //approve the link to be transferred from the from the subscriber to the rewardManager approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); //check the link has been transferred assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); @@ -323,62 +323,60 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_V2PayloadWithoutQuoteFails() public { //get the default payload - bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2), bytes("")); + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2)); //expect a revert as the quote is invalid vm.expectRevert(); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(0), 0); } function test_V2PayloadWithoutZeroFee() public { //get the default payload - bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2)); //expect a revert as the quote is invalid vm.expectRevert(); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); } function test_processFeeWithInvalidReportVersionFailsToDecode() public { bytes memory data = abi.encode(0x0000100000000000000000000000000000000000000000000000000000000000); //get the default payload - bytes memory payload = getPayload(data, getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(data); //serialization will fail as there is no report to decode vm.expectRevert(); //processing the fee will not withdraw anything as there is no fee to collect - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); } function test_processFeeWithZeroNativeNonZeroLinkWithNativeQuote() public { //get the default payload bytes memory payload = getPayload( - getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, DEFAULT_REPORT_LINK_FEE, 0), - getQuotePayload(getNativeAddress()) + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, DEFAULT_REPORT_LINK_FEE, 0) ); //call processFee should not revert as the fee is 0 - processFee(payload, PROXY, 0); + processFee(payload, PROXY, address(native), 0); } function test_processFeeWithZeroNativeNonZeroLinkWithLinkQuote() public { //get the default payload bytes memory payload = getPayload( - getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, DEFAULT_REPORT_LINK_FEE, 0), - getQuotePayload(getLinkAddress()) + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, DEFAULT_REPORT_LINK_FEE, 0) ); //approve the link to be transferred from the from the subscriber to the rewardManager approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); //processing the fee will transfer the link to the rewardManager from the user - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); //check the link has been transferred assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); @@ -393,15 +391,14 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { //get the default payload bytes memory payload = getPayload( - getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE), - getQuotePayload(getNativeAddress()) + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE) ); //approve the native to be transferred from the user approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); //processing the fee will transfer the native from the user to the feeManager - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); //check the native has been transferred assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); @@ -419,23 +416,21 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_processFeeWithZeroLinkNonZeroNativeWithLinkQuote() public { //get the default payload bytes memory payload = getPayload( - getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE), - getQuotePayload(getLinkAddress()) + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE) ); //call processFee should not revert as the fee is 0 - processFee(payload, USER, 0); + processFee(payload, USER, address(link), 0); } function test_processFeeWithZeroNativeNonZeroLinkReturnsChange() public { //get the default payload bytes memory payload = getPayload( - getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE), - getQuotePayload(getLinkAddress()) + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE) ); //call processFee should not revert as the fee is 0 - processFee(payload, USER, DEFAULT_REPORT_NATIVE_FEE); + processFee(payload, USER, address(link), DEFAULT_REPORT_NATIVE_FEE); //check the change has been returned assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); @@ -443,10 +438,9 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_V1PayloadVerifiesAndReturnsChange() public { //emulate a V1 payload with no quote - bytes memory quotePayload; - bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1), quotePayload); + bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); - processFee(payload, USER, DEFAULT_REPORT_NATIVE_FEE); + processFee(payload, USER, address(0), DEFAULT_REPORT_NATIVE_FEE); //Fee manager should not contain any native assertEq(address(feeManager).balance, 0); @@ -461,13 +455,13 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); //set the subscriber discount to 50% - setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, getNativeAddress(), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); //approve the native to be transferred from the user approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE / 2, USER); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -478,7 +472,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { emit DiscountApplied(DEFAULT_CONFIG_DIGEST, USER, fee, reward, appliedDiscount); //call processFee should not revert as the fee is 0 - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); } function test_processFeeWithNoDiscountDoesNotEmitEvent() public { @@ -489,10 +483,10 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); //get the default payload - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); //call processFee should not revert as the fee is 0 - processFee(payload, USER, 0); + processFee(payload, USER, address(native), 0); //no logs should have been emitted assertEq(vm.getRecordedLogs().length, 0); diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol index ba415598b7c..d2df2548208 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol @@ -20,7 +20,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { } function test_processMultipleLinkReports() public { - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { @@ -29,7 +29,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS, USER); - processFee(payloads, USER, DEFAULT_NATIVE_MINT_QUANTITY); + processFee(payloads, USER, address(link), DEFAULT_NATIVE_MINT_QUANTITY); assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); assertEq(getLinkBalance(address(feeManager)), 0); @@ -43,7 +43,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_processMultipleWrappedNativeReports() public { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS + 1); - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); for (uint256 i; i < NUMBER_OF_REPORTS; ++i) { @@ -52,7 +52,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS, USER); - processFee(payloads, USER, 0); + processFee(payloads, USER, address(native), 0); assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); @@ -63,14 +63,14 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { function test_processMultipleUnwrappedNativeReports() public { mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS + 1); - bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); for (uint256 i; i < NUMBER_OF_REPORTS; ++i) { payloads[i] = payload; } - processFee(payloads, USER, DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS * 2); + processFee(payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS * 2); assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); @@ -80,59 +80,8 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); } - function test_processMultipleLinkAndNativeWrappedReports() public { - mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 2 + 1); - - bytes memory nativePayload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); - bytes memory linkPayload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); - - bytes[] memory payloads = new bytes[](5); - payloads[0] = linkPayload; - payloads[1] = linkPayload; - payloads[2] = linkPayload; - payloads[3] = nativePayload; - payloads[4] = nativePayload; - - approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 2, USER); - approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 3, USER); - - processFee(payloads, USER, 0); - - assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 5); - assertEq(getLinkBalance(address(feeManager)), 1); - assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 3); - } - - function test_processMultipleLinkAndNativeUnwrappedReports() public { - mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 2 + 1); - - bytes memory nativePayload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); - bytes memory linkPayload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); - - bytes[] memory payloads = new bytes[](5); - payloads[0] = linkPayload; - payloads[1] = linkPayload; - payloads[2] = linkPayload; - payloads[3] = nativePayload; - payloads[4] = nativePayload; - - approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 3, USER); - - processFee(payloads, USER, DEFAULT_REPORT_NATIVE_FEE * 4); - - assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 5); - assertEq(getLinkBalance(address(feeManager)), 1); - - assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); - assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 3); - } - function test_processV1V2V3Reports() public { - mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 2 + 1); + mintLink(address(feeManager), 1); bytes memory payloadV1 = abi.encode( [DEFAULT_CONFIG_DIGEST, 0, 0], @@ -142,34 +91,30 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { bytes32("") ); - bytes memory nativePayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2), getQuotePayload(getNativeAddress())); - bytes memory linkPayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2), getQuotePayload(getLinkAddress())); - - bytes memory nativePayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); - bytes memory linkPayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory linkPayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + bytes memory linkPayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3)); bytes[] memory payloads = new bytes[](5); payloads[0] = payloadV1; - payloads[1] = nativePayloadV2; + payloads[1] = linkPayloadV2; payloads[2] = linkPayloadV2; - payloads[3] = nativePayloadV3; + payloads[3] = linkPayloadV3; payloads[4] = linkPayloadV3; - approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 2, USER); - approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 2, USER); + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 4, USER); - processFee(payloads, USER, 0); + processFee(payloads, USER, address(link), 0); - assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 2); + assertEq(getNativeBalance(address(feeManager)), 0); assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 4); assertEq(getLinkBalance(address(feeManager)), 1); - assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 2); - assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 4); + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - 0); } function test_processV1V2V3ReportsWithUnwrapped() public { - mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 2 + 1); + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 4 + 1); bytes memory payloadV1 = abi.encode( [DEFAULT_CONFIG_DIGEST, 0, 0], @@ -179,29 +124,23 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { bytes32("") ); - bytes memory nativePayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2), getQuotePayload(getNativeAddress())); - bytes memory linkPayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2), getQuotePayload(getLinkAddress())); - - bytes memory nativePayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); - bytes memory linkPayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory nativePayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + bytes memory nativePayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3)); bytes[] memory payloads = new bytes[](5); payloads[0] = payloadV1; payloads[1] = nativePayloadV2; - payloads[2] = linkPayloadV2; + payloads[2] = nativePayloadV2; payloads[3] = nativePayloadV3; - payloads[4] = linkPayloadV3; - - approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 2, USER); + payloads[4] = nativePayloadV3; - processFee(payloads, USER, DEFAULT_REPORT_NATIVE_FEE * 4); + processFee(payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * 4); - assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 2); + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 4); assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 4); assertEq(getLinkBalance(address(feeManager)), 1); - assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 2); - assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 4); assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); } @@ -219,38 +158,39 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { payloads[i] = payload; } - processFee(payloads, USER, DEFAULT_REPORT_NATIVE_FEE * 5); + processFee(payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * 5); assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); } function test_eventIsEmittedIfNotEnoughLink() public { - bytes memory nativePayload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getNativeAddress())); - bytes memory linkPayload = getPayload(getV3Report(DEFAULT_FEED_1_V3), getQuotePayload(getLinkAddress())); + bytes memory nativePayload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); bytes[] memory payloads = new bytes[](5); - payloads[0] = linkPayload; - payloads[1] = linkPayload; - payloads[2] = linkPayload; + payloads[0] = nativePayload; + payloads[1] = nativePayload; + payloads[2] = nativePayload; payloads[3] = nativePayload; payloads[4] = nativePayload; - approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 2, USER); - approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 3, USER); + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 5, USER); - IRewardManager.FeePayment[] memory payments = new IRewardManager.FeePayment[](2); + IRewardManager.FeePayment[] memory payments = new IRewardManager.FeePayment[](5); payments[0] = IRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); payments[1] = IRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[2] = IRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[3] = IRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[4] = IRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); vm.expectEmit(); emit InsufficientLink(payments); - processFee(payloads, USER, 0); + processFee(payloads, USER, address(native), 0); - assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 3); + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 5); + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 5); + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY); } } diff --git a/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol index d5c26fcd13e..9b10a2430f9 100644 --- a/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol @@ -69,25 +69,23 @@ contract Verifier_verifyWithFee is BaseTestWithConfiguredVerifierAndFeeManager { } function testVerifyProxyWithLinkFeeSuccess_gas() public { - bytes memory signedLinkPayload = _generateEncodedBlobWithQuote( + bytes memory signedLinkPayload = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) + _getSigners(FAULT_TOLERANCE + 1) ); - s_verifierProxy.verify(signedLinkPayload); + s_verifierProxy.verify(signedLinkPayload, abi.encode(link)); } function testVerifyProxyWithNativeFeeSuccess_gas() public { - bytes memory signedNativePayload = _generateEncodedBlobWithQuote( + bytes memory signedNativePayload = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); - s_verifierProxy.verify(signedNativePayload); + s_verifierProxy.verify(signedNativePayload, abi.encode(native)); } } @@ -130,11 +128,10 @@ contract Verifier_bulkVerifyWithFee is BaseTestWithConfiguredVerifierAndFeeManag } function testBulkVerifyProxyWithLinkFeeSuccess_gas() public { - bytes memory signedLinkPayload = _generateEncodedBlobWithQuote( + bytes memory signedLinkPayload = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedLinkPayloads = new bytes[](NUMBER_OF_REPORTS_TO_VERIFY); @@ -142,15 +139,14 @@ contract Verifier_bulkVerifyWithFee is BaseTestWithConfiguredVerifierAndFeeManag signedLinkPayloads[i] = signedLinkPayload; } - s_verifierProxy.verifyBulk(signedLinkPayloads); + s_verifierProxy.verifyBulk(signedLinkPayloads, abi.encode(link)); } function testBulkVerifyProxyWithNativeFeeSuccess_gas() public { - bytes memory signedNativePayload = _generateEncodedBlobWithQuote( + bytes memory signedNativePayload = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedNativePayloads = new bytes[](NUMBER_OF_REPORTS_TO_VERIFY); @@ -158,7 +154,7 @@ contract Verifier_bulkVerifyWithFee is BaseTestWithConfiguredVerifierAndFeeManag signedNativePayloads[i] = signedNativePayload; } - s_verifierProxy.verifyBulk(signedNativePayloads); + s_verifierProxy.verifyBulk(signedNativePayloads, abi.encode(native)); } } @@ -183,7 +179,7 @@ contract Verifier_verify is BaseTestWithConfiguredVerifierAndFeeManager { bytes32[3] memory reportContext; reportContext[0] = s_configDigest; reportContext[1] = bytes32(abi.encode(uint32(5), uint8(1))); - s_signedReport = _generateEncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); + s_signedReport = _generateV1EncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); } function testVerifySuccess_gas() public { @@ -193,7 +189,7 @@ contract Verifier_verify is BaseTestWithConfiguredVerifierAndFeeManager { } function testVerifyProxySuccess_gas() public { - s_verifierProxy.verify(s_signedReport); + s_verifierProxy.verify(s_signedReport, abi.encode(native)); } } @@ -222,7 +218,7 @@ contract Verifier_accessControlledVerify is BaseTestWithConfiguredVerifierAndFee bytes32[3] memory reportContext; reportContext[0] = s_configDigest; reportContext[1] = bytes32(abi.encode(uint32(5), uint8(1))); - s_signedReport = _generateEncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); + s_signedReport = _generateV1EncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); s_accessController = new SimpleWriteAccessController(); s_verifierProxy.setAccessController(s_accessController); s_accessController.addAccess(CLIENT); @@ -230,6 +226,6 @@ contract Verifier_accessControlledVerify is BaseTestWithConfiguredVerifierAndFee function testVerifyWithAccessControl_gas() public { changePrank(CLIENT); - s_verifierProxy.verify(s_signedReport); + s_verifierProxy.verify(s_signedReport, abi.encode(native)); } } diff --git a/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol b/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol index 4e4a8d00e6f..6873a05a601 100644 --- a/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol +++ b/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol @@ -6,12 +6,12 @@ import "../../dev/interfaces/IFeeManager.sol"; contract FeeManagerProxy { IFeeManager internal i_feeManager; - function processFee(bytes calldata payload) public payable { - i_feeManager.processFee{value: msg.value}(payload, msg.sender); + function processFee(bytes calldata payload, bytes calldata feePayload) public payable { + i_feeManager.processFee{value: msg.value}(payload, feePayload, msg.sender); } - function processFeeBulk(bytes[] calldata payloads) public payable { - i_feeManager.processFeeBulk{value: msg.value}(payloads, msg.sender); + function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload) public payable { + i_feeManager.processFeeBulk{value: msg.value}(payloads, feePayload, msg.sender); } function setFeeManager(IFeeManager feeManager) public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol index 0525e3ed14a..ab84703fc61 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol @@ -163,7 +163,7 @@ contract BaseTest is Test { ); } - function _generateEncodedBlob( + function _generateV1EncodedBlob( V1Report memory report, bytes32[3] memory reportContext, Signer[] memory signers @@ -336,11 +336,10 @@ contract BaseTestWithConfiguredVerifierAndFeeManager is BaseTest { ); } - function _generateEncodedBlobWithQuote( + function _generateV3EncodedBlob( V3Report memory report, bytes32[3] memory reportContext, - Signer[] memory signers, - bytes memory quote + Signer[] memory signers ) internal pure returns (bytes memory) { bytes memory reportBytes = _encodeReport(report); (bytes32[] memory rs, bytes32[] memory ss, bytes32 rawVs) = _generateSignerSignatures( @@ -348,12 +347,7 @@ contract BaseTestWithConfiguredVerifierAndFeeManager is BaseTest { reportContext, signers ); - - return abi.encode(reportContext, reportBytes, rs, ss, rawVs, quote); - } - - function _generateQuote(address billingAddress) internal pure returns (bytes memory) { - return abi.encode(billingAddress); + return abi.encode(reportContext, reportBytes, rs, ss, rawVs); } function _generateV1Report() internal view returns (V1Report memory) { @@ -409,20 +403,20 @@ contract BaseTestWithConfiguredVerifierAndFeeManager is BaseTest { changePrank(originalAddr); } - function _verify(bytes memory payload, uint256 wrappedNativeValue, address sender) internal { + function _verify(bytes memory payload, address feeAddress, uint256 wrappedNativeValue, address sender) internal { address originalAddr = msg.sender; changePrank(sender); - s_verifierProxy.verify{value: wrappedNativeValue}(payload); + s_verifierProxy.verify{value: wrappedNativeValue}(payload, abi.encode(feeAddress)); changePrank(originalAddr); } - function _verifyBulk(bytes[] memory payload, uint256 wrappedNativeValue, address sender) internal { + function _verifyBulk(bytes[] memory payload, address feeAddress, uint256 wrappedNativeValue, address sender) internal { address originalAddr = msg.sender; changePrank(sender); - s_verifierProxy.verifyBulk{value: wrappedNativeValue}(payload); + s_verifierProxy.verifyBulk{value: wrappedNativeValue}(payload, abi.encode(feeAddress)); changePrank(originalAddr); } diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol index 1905d28da9f..641d2772595 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol @@ -54,7 +54,7 @@ contract VerifierActivateConfigWithDeactivatedConfigTest is BaseTestWithMultiple s_verifier.activateConfig(FEED_ID, s_configDigestTwo); changePrank(address(s_verifierProxy)); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE_TWO + 1) diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol index 985283fe223..fc6814d3bfe 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol @@ -59,7 +59,7 @@ contract VerifierDeactivateFeedWithVerifyTest is BaseTestWithMultipleConfiguredD s_verifier.activateFeed(FEED_ID); changePrank(address(s_verifierProxy)); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -72,7 +72,7 @@ contract VerifierDeactivateFeedWithVerifyTest is BaseTestWithMultipleConfiguredD changePrank(address(s_verifierProxy)); s_reportContext[0] = s_configDigestTwo; - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE_TWO + 1) @@ -83,7 +83,7 @@ contract VerifierDeactivateFeedWithVerifyTest is BaseTestWithMultipleConfiguredD function test_currentReportFailsVerification() public { changePrank(address(s_verifierProxy)); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -97,7 +97,7 @@ contract VerifierDeactivateFeedWithVerifyTest is BaseTestWithMultipleConfiguredD changePrank(address(s_verifierProxy)); s_reportContext[0] = s_configDigestTwo; - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE_TWO + 1) diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol index c6533747614..daa264d4bdb 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol @@ -25,59 +25,55 @@ contract VerifierTestWithConfiguredVerifierAndFeeManager is BaseTestWithConfigur contract VerifierTestBillingReport is VerifierTestWithConfiguredVerifierAndFeeManager { function test_verifyWithLink() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) + _getSigners(FAULT_TOLERANCE + 1) ); _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); - _verify(signedReport, 0, USER); + _verify(signedReport, address(link), 0, USER); assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); } function test_verifyWithNative() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); - _verify(signedReport, 0, USER); + _verify(signedReport, address(native), 0, USER); assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); } function test_verifyWithNativeUnwrapped() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); - _verify(signedReport, DEFAULT_REPORT_NATIVE_FEE, USER); + _verify(signedReport, address(native), DEFAULT_REPORT_NATIVE_FEE, USER); assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); assertEq(address(feeManager).balance, 0); } function test_verifyWithNativeUnwrappedReturnsChange() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); - _verify(signedReport, DEFAULT_REPORT_NATIVE_FEE * 2, USER); + _verify(signedReport, address(native), DEFAULT_REPORT_NATIVE_FEE * 2, USER); assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); assertEq(address(feeManager).balance, 0); @@ -88,11 +84,10 @@ contract VerifierBulkVerifyBillingReport is VerifierTestWithConfiguredVerifierAn uint256 internal constant NUMBERS_OF_REPORTS = 5; function test_verifyWithBulkLink() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); @@ -102,18 +97,17 @@ contract VerifierBulkVerifyBillingReport is VerifierTestWithConfiguredVerifierAn _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * NUMBERS_OF_REPORTS, USER); - _verifyBulk(signedReports, 0, USER); + _verifyBulk(signedReports, address(link), 0, USER); assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * NUMBERS_OF_REPORTS); assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBERS_OF_REPORTS); } function test_verifyWithBulkNative() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); @@ -123,17 +117,16 @@ contract VerifierBulkVerifyBillingReport is VerifierTestWithConfiguredVerifierAn _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS, USER); - _verifyBulk(signedReports, 0, USER); + _verifyBulk(signedReports, address(native), 0, USER); assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS); } function test_verifyWithBulkNativeUnwrapped() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); @@ -141,18 +134,17 @@ contract VerifierBulkVerifyBillingReport is VerifierTestWithConfiguredVerifierAn signedReports[i] = signedReport; } - _verifyBulk(signedReports, DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS, USER); + _verifyBulk(signedReports, address(native), DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS, USER); assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 5); assertEq(address(feeManager).balance, 0); } function test_verifyWithBulkNativeUnwrappedReturnsChange() public { - bytes memory signedReport = _generateEncodedBlobWithQuote( + bytes memory signedReport = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); @@ -160,176 +152,65 @@ contract VerifierBulkVerifyBillingReport is VerifierTestWithConfiguredVerifierAn signedReports[i] = signedReport; } - _verifyBulk(signedReports, DEFAULT_REPORT_NATIVE_FEE * (NUMBERS_OF_REPORTS * 2), USER); + _verifyBulk(signedReports, address(native), DEFAULT_REPORT_NATIVE_FEE * (NUMBERS_OF_REPORTS * 2), USER); assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS); assertEq(address(feeManager).balance, 0); } - function test_verifyBulkWithLinkAndWrappedNative() public { - bytes memory linkReport = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) - ); - - bytes memory nativeReport = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) - ); - - bytes[] memory signedReports = new bytes[](5); - - signedReports[0] = linkReport; - signedReports[1] = linkReport; - signedReports[2] = linkReport; - signedReports[3] = nativeReport; - signedReports[4] = nativeReport; - - _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 3, USER); - _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 2, USER); - - _verifyBulk(signedReports, 0, USER); - - assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 3); - assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 3); - } - - function test_verifyBulkWithLinkAndUnwrappedNative() public { - bytes memory linkReport = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) - ); - - bytes memory nativeReport = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) - ); - - bytes[] memory signedReports = new bytes[](5); - - signedReports[0] = linkReport; - signedReports[1] = linkReport; - signedReports[2] = linkReport; - signedReports[3] = nativeReport; - signedReports[4] = nativeReport; - - _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 3, USER); - - _verifyBulk(signedReports, DEFAULT_REPORT_NATIVE_FEE * 40, USER); - - //user should have some link returned as twice the amount was passed into msg.value - assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(native.balanceOf(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 3); - assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 3); - } - - function test_verifyBulkReportWithUnwrappedAndWrappedNativeDefaultsToUnwrapped() public { - bytes memory nativeReport1 = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) - ); - - bytes memory nativeReport2 = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) - ); - - bytes[] memory signedReports = new bytes[](2); - - signedReports[0] = nativeReport1; - signedReports[1] = nativeReport2; - - _verifyBulk(signedReports, DEFAULT_REPORT_NATIVE_FEE * 2, USER); - - assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 2); - assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY); - } - function test_verifyMultiVersions() public { - bytes memory signedReportV1 = _generateEncodedBlob( + bytes memory signedReportV1 = _generateV1EncodedBlob( _generateV1Report(), _generateReportContext(v1ConfigDigest), _getSigners(FAULT_TOLERANCE + 1) ); - bytes memory signedReportV3Link = _generateEncodedBlobWithQuote( + bytes memory signedReportV3 = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) - ); - - bytes memory signedReportV3Native = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedReports = new bytes[](3); signedReports[0] = signedReportV1; - signedReports[1] = signedReportV3Link; - signedReports[2] = signedReportV3Native; + signedReports[1] = signedReportV3; + signedReports[2] = signedReportV3; - _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); - _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + _approveLink(address(rewardManager), 2* DEFAULT_REPORT_LINK_FEE, USER); - _verifyBulk(signedReports, 0, USER); + _verifyBulk(signedReports, address(link), 0, USER); - assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); - assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - 2 * DEFAULT_REPORT_LINK_FEE); + assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY); assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 2); } function test_verifyMultiVersionsReturnsVerifiedReports() public { - bytes memory signedReportV1 = _generateEncodedBlob( + bytes memory signedReportV1 = _generateV1EncodedBlob( _generateV1Report(), _generateReportContext(v1ConfigDigest), _getSigners(FAULT_TOLERANCE + 1) ); - bytes memory signedReportV3Link = _generateEncodedBlobWithQuote( - _generateV3Report(), - _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(link)) - ); - - bytes memory signedReportV3Native = _generateEncodedBlobWithQuote( + bytes memory signedReportV3 = _generateV3EncodedBlob( _generateV3Report(), _generateReportContext(v3ConfigDigest), - _getSigners(FAULT_TOLERANCE + 1), - _generateQuote(address(native)) + _getSigners(FAULT_TOLERANCE + 1) ); bytes[] memory signedReports = new bytes[](3); signedReports[0] = signedReportV1; - signedReports[1] = signedReportV3Link; - signedReports[2] = signedReportV3Native; + signedReports[1] = signedReportV3; + signedReports[2] = signedReportV3; - _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); - _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + _approveLink(address(rewardManager), 2 * DEFAULT_REPORT_LINK_FEE, USER); address originalAddr = msg.sender; changePrank(USER); - bytes[] memory verifierReports = s_verifierProxy.verifyBulk{value: 0}(signedReports); + bytes[] memory verifierReports = s_verifierProxy.verifyBulk{value: 0}(signedReports, abi.encode(link)); changePrank(originalAddr); diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol index 149ac71feb8..8d770163e00 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol @@ -57,23 +57,23 @@ contract VerifierVerifyTest is BaseTestWithConfiguredVerifierAndFeeManager { contract VerifierProxyVerifyTest is VerifierVerifyTest { function test_revertsIfNoVerifierConfigured() public { s_reportContext[0] = bytes32("corrupt-digest"); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) ); vm.expectRevert(abi.encodeWithSelector(VerifierProxy.VerifierNotFound.selector, bytes32("corrupt-digest"))); - s_verifierProxy.verify(signedReport); + s_verifierProxy.verify(signedReport, bytes("")); } function test_proxiesToTheCorrectVerifier() public { - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) ); - bytes memory response = s_verifierProxy.verify(signedReport); + bytes memory response = s_verifierProxy.verify(signedReport, abi.encode(native)); assertReportsEqual(response, s_testReportOne); } } @@ -92,7 +92,7 @@ contract VerifierProxyAccessControlledVerificationTest is VerifierVerifyTest { abi.encodeWithSelector(AccessControllerInterface.hasAccess.selector, USER), abi.encode(false) ); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -100,7 +100,7 @@ contract VerifierProxyAccessControlledVerificationTest is VerifierVerifyTest { vm.expectRevert(abi.encodeWithSelector(VerifierProxy.AccessForbidden.selector)); changePrank(USER); - s_verifierProxy.verify(signedReport); + s_verifierProxy.verify(signedReport, abi.encode(native)); } function test_proxiesToTheVerifierIfHasAccess() public { @@ -110,21 +110,21 @@ contract VerifierProxyAccessControlledVerificationTest is VerifierVerifyTest { abi.encode(true) ); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) ); changePrank(USER); - bytes memory response = s_verifierProxy.verify(signedReport); + bytes memory response = s_verifierProxy.verify(signedReport, bytes("")); assertReportsEqual(response, s_testReportOne); } } contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { function test_revertsIfVerifiedByNonProxy() public { - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -136,7 +136,7 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { function test_revertsIfVerifiedWithIncorrectAddresses() public { Signer[] memory signers = _getSigners(FAULT_TOLERANCE + 1); signers[10].mockPrivateKey = 1234; - bytes memory signedReport = _generateEncodedBlob(s_testReportOne, s_reportContext, signers); + bytes memory signedReport = _generateV1EncodedBlob(s_testReportOne, s_reportContext, signers); changePrank(address(s_verifierProxy)); vm.expectRevert(abi.encodeWithSelector(Verifier.BadVerification.selector)); s_verifier.verify(signedReport, msg.sender); @@ -155,7 +155,7 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { function test_revertsIfConfigDigestNotSet() public { bytes32[3] memory reportContext = s_reportContext; reportContext[0] = bytes32("wrong-context-digest"); - bytes memory signedReport = _generateEncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); + bytes memory signedReport = _generateV1EncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); vm.expectRevert(abi.encodeWithSelector(Verifier.DigestInactive.selector, FEED_ID, reportContext[0])); changePrank(address(s_verifierProxy)); s_verifier.verify(signedReport, msg.sender); @@ -173,14 +173,14 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { BLOCKNUMBER_LOWER_BOUND, uint32(block.timestamp) ); - bytes memory signedReport = _generateEncodedBlob(report, s_reportContext, _getSigners(FAULT_TOLERANCE + 1)); + bytes memory signedReport = _generateV1EncodedBlob(report, s_reportContext, _getSigners(FAULT_TOLERANCE + 1)); vm.expectRevert(abi.encodeWithSelector(Verifier.DigestInactive.selector, FEED_ID_2, s_reportContext[0])); changePrank(address(s_verifierProxy)); s_verifier.verify(signedReport, msg.sender); } function test_revertsIfWrongNumberOfSigners() public { - bytes memory signedReport = _generateEncodedBlob(s_testReportOne, s_reportContext, _getSigners(10)); + bytes memory signedReport = _generateV1EncodedBlob(s_testReportOne, s_reportContext, _getSigners(10)); vm.expectRevert(abi.encodeWithSelector(Verifier.IncorrectSignatureCount.selector, 10, FAULT_TOLERANCE + 1)); changePrank(address(s_verifierProxy)); s_verifier.verify(signedReport, msg.sender); @@ -190,14 +190,14 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { Signer[] memory signers = _getSigners(FAULT_TOLERANCE + 1); // Duplicate signer at index 1 signers[0] = signers[1]; - bytes memory signedReport = _generateEncodedBlob(s_testReportOne, s_reportContext, signers); + bytes memory signedReport = _generateV1EncodedBlob(s_testReportOne, s_reportContext, signers); vm.expectRevert(abi.encodeWithSelector(Verifier.BadVerification.selector)); changePrank(address(s_verifierProxy)); s_verifier.verify(signedReport, msg.sender); } function test_returnsThePriceAndBlockNumIfReportVerified() public { - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -210,7 +210,7 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { function test_setsTheCorrectEpoch() public { s_reportContext[1] = bytes32(uint256(5 << 8)); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -223,7 +223,7 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { } function test_emitsAnEventIfReportVerified() public { - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -260,7 +260,7 @@ contract VerifierVerifyMultipleConfigDigestTest is VerifierVerifyTest { function test_revertsIfVerifyingWithAnUnsetDigest() public { s_verifier.deactivateConfig(FEED_ID, (s_oldConfigDigest)); - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -271,7 +271,7 @@ contract VerifierVerifyMultipleConfigDigestTest is VerifierVerifyTest { } function test_canVerifyOlderReportsWithOlderConfigs() public { - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE + 1) @@ -283,7 +283,7 @@ contract VerifierVerifyMultipleConfigDigestTest is VerifierVerifyTest { function test_canVerifyNewerReportsWithNewerConfigs() public { s_reportContext[0] = s_newConfigDigest; - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE_TWO + 1) @@ -296,7 +296,7 @@ contract VerifierVerifyMultipleConfigDigestTest is VerifierVerifyTest { function test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() public { // Try sending the older digest signed with the new set of signers s_reportContext[0] = s_oldConfigDigest; - bytes memory signedReport = _generateEncodedBlob( + bytes memory signedReport = _generateV1EncodedBlob( s_testReportOne, s_reportContext, _getSigners(FAULT_TOLERANCE_TWO + 1) From 3e57be025d8a2e6def98d3f4904fb772a31473f9 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Wed, 13 Sep 2023 15:09:12 -0700 Subject: [PATCH 05/12] Gas snapshot update --- .../gas-snapshots/llo-feeds.gas-snapshot | 263 +++++++++--------- 1 file changed, 129 insertions(+), 134 deletions(-) diff --git a/contracts/gas-snapshots/llo-feeds.gas-snapshot b/contracts/gas-snapshots/llo-feeds.gas-snapshot index 3d388678ac5..cbad9688cfd 100644 --- a/contracts/gas-snapshots/llo-feeds.gas-snapshot +++ b/contracts/gas-snapshots/llo-feeds.gas-snapshot @@ -1,95 +1,93 @@ -FeeManagerProcessFeeTest:test_DiscountIsAppliedForNative() (gas: 52634) -FeeManagerProcessFeeTest:test_DiscountIsReturnedForNative() (gas: 52566) -FeeManagerProcessFeeTest:test_DiscountIsReturnedForNativeWithSurcharge() (gas: 78747) -FeeManagerProcessFeeTest:test_V1PayloadVerifies() (gas: 25961) -FeeManagerProcessFeeTest:test_V1PayloadVerifiesAndReturnsChange() (gas: 57252) -FeeManagerProcessFeeTest:test_V2PayloadVerifies() (gas: 118212) -FeeManagerProcessFeeTest:test_V2PayloadWithoutQuoteFails() (gas: 28568) -FeeManagerProcessFeeTest:test_V2PayloadWithoutZeroFee() (gas: 72524) -FeeManagerProcessFeeTest:test_WithdrawERC20() (gas: 71648) -FeeManagerProcessFeeTest:test_WithdrawNonAdminAddr() (gas: 56270) +FeeManagerProcessFeeTest:test_DiscountIsAppliedForNative() (gas: 52282) +FeeManagerProcessFeeTest:test_DiscountIsReturnedForNative() (gas: 52235) +FeeManagerProcessFeeTest:test_DiscountIsReturnedForNativeWithSurcharge() (gas: 78440) +FeeManagerProcessFeeTest:test_V1PayloadVerifies() (gas: 26980) +FeeManagerProcessFeeTest:test_V1PayloadVerifiesAndReturnsChange() (gas: 57895) +FeeManagerProcessFeeTest:test_V2PayloadVerifies() (gas: 116092) +FeeManagerProcessFeeTest:test_V2PayloadWithoutQuoteFails() (gas: 27395) +FeeManagerProcessFeeTest:test_V2PayloadWithoutZeroFee() (gas: 70368) +FeeManagerProcessFeeTest:test_WithdrawERC20() (gas: 71617) +FeeManagerProcessFeeTest:test_WithdrawNonAdminAddr() (gas: 56261) FeeManagerProcessFeeTest:test_WithdrawUnwrappedNative() (gas: 25322) -FeeManagerProcessFeeTest:test_baseFeeIsAppliedForLink() (gas: 14623) -FeeManagerProcessFeeTest:test_baseFeeIsAppliedForNative() (gas: 17581) -FeeManagerProcessFeeTest:test_correctDiscountIsAppliedWhenBothTokensAreDiscounted() (gas: 90945) -FeeManagerProcessFeeTest:test_discountAIsNotAppliedWhenSetForOtherUsers() (gas: 56524) -FeeManagerProcessFeeTest:test_discountFeeRoundsDownWhenUneven() (gas: 52803) -FeeManagerProcessFeeTest:test_discountIsAppliedForLink() (gas: 49627) -FeeManagerProcessFeeTest:test_discountIsAppliedWith100PercentSurcharge() (gas: 78795) -FeeManagerProcessFeeTest:test_discountIsNoLongerAppliedAfterRemoving() (gas: 46428) -FeeManagerProcessFeeTest:test_discountIsNotAppliedForInvalidTokenAddress() (gas: 17568) -FeeManagerProcessFeeTest:test_discountIsNotAppliedToOtherFeeds() (gas: 54571) -FeeManagerProcessFeeTest:test_discountIsReturnedForLink() (gas: 49581) -FeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 12392) -FeeManagerProcessFeeTest:test_eventIsEmittedAfterSurchargeIsSet() (gas: 41390) -FeeManagerProcessFeeTest:test_eventIsEmittedIfNotEnoughLink() (gas: 259493) -FeeManagerProcessFeeTest:test_eventIsEmittedUponWithdraw() (gas: 68996) -FeeManagerProcessFeeTest:test_feeIsUpdatedAfterDiscountIsRemoved() (gas: 49706) -FeeManagerProcessFeeTest:test_feeIsUpdatedAfterNewDiscountIsApplied() (gas: 67635) -FeeManagerProcessFeeTest:test_feeIsUpdatedAfterNewSurchargeIsApplied() (gas: 64188) -FeeManagerProcessFeeTest:test_feeIsZeroWith100PercentDiscount() (gas: 52012) -FeeManagerProcessFeeTest:test_getBaseRewardWithLinkQuote() (gas: 14621) -FeeManagerProcessFeeTest:test_getLinkFeeIsRoundedUp() (gas: 49774) -FeeManagerProcessFeeTest:test_getLinkRewardIsSameAsFee() (gas: 55561) -FeeManagerProcessFeeTest:test_getLinkRewardWithNativeQuoteAndSurchargeWithLinkDiscount() (gas: 82680) -FeeManagerProcessFeeTest:test_getRewardWithLinkDiscount() (gas: 49602) -FeeManagerProcessFeeTest:test_getRewardWithLinkQuoteAndLinkDiscount() (gas: 49604) -FeeManagerProcessFeeTest:test_getRewardWithNativeQuote() (gas: 17601) -FeeManagerProcessFeeTest:test_getRewardWithNativeQuoteAndSurcharge() (gas: 50804) -FeeManagerProcessFeeTest:test_linkAvailableForPaymentReturnsLinkBalance() (gas: 52375) -FeeManagerProcessFeeTest:test_nativeSurcharge0Percent() (gas: 30792) -FeeManagerProcessFeeTest:test_nativeSurcharge100Percent() (gas: 50805) -FeeManagerProcessFeeTest:test_nativeSurchargeCannotExceed100Percent() (gas: 17144) -FeeManagerProcessFeeTest:test_nativeSurchargeEventIsEmittedOnUpdate() (gas: 41348) -FeeManagerProcessFeeTest:test_noFeeIsAppliedWhenReportHasZeroFee() (gas: 51879) -FeeManagerProcessFeeTest:test_noFeeIsAppliedWhenReportHasZeroFeeAndDiscountAndSurchargeIsSet() (gas: 78040) -FeeManagerProcessFeeTest:test_nonAdminProxyUserCannotProcessFee() (gas: 21892) -FeeManagerProcessFeeTest:test_nonAdminUserCanNotSetDiscount() (gas: 19836) -FeeManagerProcessFeeTest:test_payLinkDeficit() (gas: 195540) -FeeManagerProcessFeeTest:test_payLinkDeficitOnlyCallableByAdmin() (gas: 17360) -FeeManagerProcessFeeTest:test_payLinkDeficitPaysAllFeesProcessed() (gas: 216745) -FeeManagerProcessFeeTest:test_payLinkDeficitTwice() (gas: 199838) -FeeManagerProcessFeeTest:test_processFeeAsProxy() (gas: 118584) -FeeManagerProcessFeeTest:test_processFeeDefaultReportsStillVerifiesWithEmptyQuote() (gas: 26811) -FeeManagerProcessFeeTest:test_processFeeEmitsEventIfNotEnoughLink() (gas: 163961) -FeeManagerProcessFeeTest:test_processFeeIfSubscriberIsSelf() (gas: 27362) -FeeManagerProcessFeeTest:test_processFeeNative() (gas: 174582) -FeeManagerProcessFeeTest:test_processFeeUsesCorrectDigest() (gas: 119544) -FeeManagerProcessFeeTest:test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() (gas: 29175) -FeeManagerProcessFeeTest:test_processFeeWithDiscountEmitsEvent() (gas: 244325) -FeeManagerProcessFeeTest:test_processFeeWithInvalidReportVersionFailsToDecode() (gas: 30610) -FeeManagerProcessFeeTest:test_processFeeWithNoDiscountDoesNotEmitEvent() (gas: 168499) -FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNative() (gas: 182134) -FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeLinkAddress() (gas: 133630) -FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeLinkAddressExcessiveFee() (gas: 157517) -FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeShortFunds() (gas: 94743) -FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeWithExcessiveFee() (gas: 189072) -FeeManagerProcessFeeTest:test_processFeeWithWithCorruptQuotePayload() (gas: 28473) -FeeManagerProcessFeeTest:test_processFeeWithWithEmptyQuotePayload() (gas: 28919) -FeeManagerProcessFeeTest:test_processFeeWithWithZeroQuotePayload() (gas: 29914) -FeeManagerProcessFeeTest:test_processFeeWithZeroLinkNonZeroNativeWithLinkQuote() (gas: 35154) -FeeManagerProcessFeeTest:test_processFeeWithZeroLinkNonZeroNativeWithNativeQuote() (gas: 154471) -FeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkReturnsChange() (gas: 55617) -FeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkWithLinkQuote() (gas: 118485) -FeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkWithNativeQuote() (gas: 37856) -FeeManagerProcessFeeTest:test_processMultipleLinkAndNativeUnwrappedReports() (gas: 295090) -FeeManagerProcessFeeTest:test_processMultipleLinkAndNativeWrappedReports() (gas: 278332) -FeeManagerProcessFeeTest:test_processMultipleLinkReports() (gas: 235123) -FeeManagerProcessFeeTest:test_processMultipleUnwrappedNativeReports() (gas: 268893) -FeeManagerProcessFeeTest:test_processMultipleV1Reports() (gas: 71442) -FeeManagerProcessFeeTest:test_processMultipleWrappedNativeReports() (gas: 252024) -FeeManagerProcessFeeTest:test_processV1V2V3Reports() (gas: 282386) -FeeManagerProcessFeeTest:test_processV1V2V3ReportsWithUnwrapped() (gas: 299112) -FeeManagerProcessFeeTest:test_reportWithNoExpiryOrFeeReturnsZero() (gas: 11038) +FeeManagerProcessFeeTest:test_baseFeeIsAppliedForLink() (gas: 14345) +FeeManagerProcessFeeTest:test_baseFeeIsAppliedForNative() (gas: 17279) +FeeManagerProcessFeeTest:test_correctDiscountIsAppliedWhenBothTokensAreDiscounted() (gas: 90285) +FeeManagerProcessFeeTest:test_discountAIsNotAppliedWhenSetForOtherUsers() (gas: 56171) +FeeManagerProcessFeeTest:test_discountFeeRoundsDownWhenUneven() (gas: 52482) +FeeManagerProcessFeeTest:test_discountIsAppliedForLink() (gas: 49277) +FeeManagerProcessFeeTest:test_discountIsAppliedWith100PercentSurcharge() (gas: 78530) +FeeManagerProcessFeeTest:test_discountIsNoLongerAppliedAfterRemoving() (gas: 45936) +FeeManagerProcessFeeTest:test_discountIsNotAppliedForInvalidTokenAddress() (gas: 17546) +FeeManagerProcessFeeTest:test_discountIsNotAppliedToOtherFeeds() (gas: 54241) +FeeManagerProcessFeeTest:test_discountIsReturnedForLink() (gas: 49252) +FeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 12152) +FeeManagerProcessFeeTest:test_eventIsEmittedAfterSurchargeIsSet() (gas: 41348) +FeeManagerProcessFeeTest:test_eventIsEmittedIfNotEnoughLink() (gas: 172711) +FeeManagerProcessFeeTest:test_eventIsEmittedUponWithdraw() (gas: 68984) +FeeManagerProcessFeeTest:test_feeIsUpdatedAfterDiscountIsRemoved() (gas: 49176) +FeeManagerProcessFeeTest:test_feeIsUpdatedAfterNewDiscountIsApplied() (gas: 66973) +FeeManagerProcessFeeTest:test_feeIsUpdatedAfterNewSurchargeIsApplied() (gas: 63650) +FeeManagerProcessFeeTest:test_feeIsZeroWith100PercentDiscount() (gas: 51682) +FeeManagerProcessFeeTest:test_getBaseRewardWithLinkQuote() (gas: 14362) +FeeManagerProcessFeeTest:test_getLinkFeeIsRoundedUp() (gas: 49468) +FeeManagerProcessFeeTest:test_getLinkRewardIsSameAsFee() (gas: 54932) +FeeManagerProcessFeeTest:test_getLinkRewardWithNativeQuoteAndSurchargeWithLinkDiscount() (gas: 82394) +FeeManagerProcessFeeTest:test_getRewardWithLinkDiscount() (gas: 49295) +FeeManagerProcessFeeTest:test_getRewardWithLinkQuoteAndLinkDiscount() (gas: 49298) +FeeManagerProcessFeeTest:test_getRewardWithNativeQuote() (gas: 17299) +FeeManagerProcessFeeTest:test_getRewardWithNativeQuoteAndSurcharge() (gas: 50481) +FeeManagerProcessFeeTest:test_linkAvailableForPaymentReturnsLinkBalance() (gas: 52419) +FeeManagerProcessFeeTest:test_nativeSurcharge0Percent() (gas: 30491) +FeeManagerProcessFeeTest:test_nativeSurcharge100Percent() (gas: 50504) +FeeManagerProcessFeeTest:test_nativeSurchargeCannotExceed100Percent() (gas: 17167) +FeeManagerProcessFeeTest:test_nativeSurchargeEventIsEmittedOnUpdate() (gas: 41394) +FeeManagerProcessFeeTest:test_noFeeIsAppliedWhenReportHasZeroFee() (gas: 51505) +FeeManagerProcessFeeTest:test_noFeeIsAppliedWhenReportHasZeroFeeAndDiscountAndSurchargeIsSet() (gas: 77733) +FeeManagerProcessFeeTest:test_nonAdminProxyUserCannotProcessFee() (gas: 21881) +FeeManagerProcessFeeTest:test_nonAdminUserCanNotSetDiscount() (gas: 19835) +FeeManagerProcessFeeTest:test_payLinkDeficit() (gas: 193856) +FeeManagerProcessFeeTest:test_payLinkDeficitOnlyCallableByAdmin() (gas: 17405) +FeeManagerProcessFeeTest:test_payLinkDeficitPaysAllFeesProcessed() (gas: 213891) +FeeManagerProcessFeeTest:test_payLinkDeficitTwice() (gas: 198224) +FeeManagerProcessFeeTest:test_processFeeAsProxy() (gas: 116430) +FeeManagerProcessFeeTest:test_processFeeDefaultReportsStillVerifiesWithEmptyQuote() (gas: 27468) +FeeManagerProcessFeeTest:test_processFeeEmitsEventIfNotEnoughLink() (gas: 161837) +FeeManagerProcessFeeTest:test_processFeeIfSubscriberIsSelf() (gas: 27822) +FeeManagerProcessFeeTest:test_processFeeNative() (gas: 172458) +FeeManagerProcessFeeTest:test_processFeeUsesCorrectDigest() (gas: 117390) +FeeManagerProcessFeeTest:test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() (gas: 29542) +FeeManagerProcessFeeTest:test_processFeeWithDiscountEmitsEvent() (gas: 241269) +FeeManagerProcessFeeTest:test_processFeeWithInvalidReportVersionFailsToDecode() (gas: 28517) +FeeManagerProcessFeeTest:test_processFeeWithNoDiscountDoesNotEmitEvent() (gas: 166400) +FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNative() (gas: 179992) +FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeLinkAddress() (gas: 131459) +FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeLinkAddressExcessiveFee() (gas: 155388) +FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeShortFunds() (gas: 92624) +FeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeWithExcessiveFee() (gas: 186953) +FeeManagerProcessFeeTest:test_processFeeWithWithCorruptQuotePayload() (gas: 70679) +FeeManagerProcessFeeTest:test_processFeeWithWithEmptyQuotePayload() (gas: 27733) +FeeManagerProcessFeeTest:test_processFeeWithWithZeroQuotePayload() (gas: 27783) +FeeManagerProcessFeeTest:test_processFeeWithZeroLinkNonZeroNativeWithLinkQuote() (gas: 32971) +FeeManagerProcessFeeTest:test_processFeeWithZeroLinkNonZeroNativeWithNativeQuote() (gas: 152357) +FeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkReturnsChange() (gas: 53468) +FeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkWithLinkQuote() (gas: 116341) +FeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkWithNativeQuote() (gas: 35738) +FeeManagerProcessFeeTest:test_processMultipleLinkReports() (gas: 221457) +FeeManagerProcessFeeTest:test_processMultipleUnwrappedNativeReports() (gas: 255272) +FeeManagerProcessFeeTest:test_processMultipleV1Reports() (gas: 74135) +FeeManagerProcessFeeTest:test_processMultipleWrappedNativeReports() (gas: 238399) +FeeManagerProcessFeeTest:test_processV1V2V3Reports() (gas: 206219) +FeeManagerProcessFeeTest:test_processV1V2V3ReportsWithUnwrapped() (gas: 247873) +FeeManagerProcessFeeTest:test_reportWithNoExpiryOrFeeReturnsZero() (gas: 10770) FeeManagerProcessFeeTest:test_setDiscountOver100Percent() (gas: 19548) -FeeManagerProcessFeeTest:test_subscriberDiscountEventIsEmittedOnUpdate() (gas: 46281) -FeeManagerProcessFeeTest:test_surchargeFeeRoundsUpWhenUneven() (gas: 51135) -FeeManagerProcessFeeTest:test_surchargeIsApplied() (gas: 51060) -FeeManagerProcessFeeTest:test_surchargeIsAppliedForNativeFeeWithDiscount() (gas: 79214) -FeeManagerProcessFeeTest:test_surchargeIsNoLongerAppliedAfterRemoving() (gas: 46968) -FeeManagerProcessFeeTest:test_surchargeIsNotAppliedForLinkFee() (gas: 49840) -FeeManagerProcessFeeTest:test_surchargeIsNotAppliedWith100PercentDiscount() (gas: 78211) -FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 15251) +FeeManagerProcessFeeTest:test_subscriberDiscountEventIsEmittedOnUpdate() (gas: 46259) +FeeManagerProcessFeeTest:test_surchargeFeeRoundsUpWhenUneven() (gas: 50856) +FeeManagerProcessFeeTest:test_surchargeIsApplied() (gas: 50737) +FeeManagerProcessFeeTest:test_surchargeIsAppliedForNativeFeeWithDiscount() (gas: 78892) +FeeManagerProcessFeeTest:test_surchargeIsNoLongerAppliedAfterRemoving() (gas: 46503) +FeeManagerProcessFeeTest:test_surchargeIsNotAppliedForLinkFee() (gas: 49585) +FeeManagerProcessFeeTest:test_surchargeIsNotAppliedWith100PercentDiscount() (gas: 77890) +FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14908) RewardManagerClaimTest:test_claimAllRecipients() (gas: 275763) RewardManagerClaimTest:test_claimMultipleRecipients() (gas: 153306) RewardManagerClaimTest:test_claimRewardsWithDuplicatePoolIdsDoesNotPayoutTwice() (gas: 328345) @@ -182,65 +180,62 @@ VerifierActivateFeedTest:test_revertsIfNoFeedExistsActivate() (gas: 13179) VerifierActivateFeedTest:test_revertsIfNoFeedExistsDeactivate() (gas: 13157) VerifierActivateFeedTest:test_revertsIfNotOwnerActivateFeed() (gas: 17098) VerifierActivateFeedTest:test_revertsIfNotOwnerDeactivateFeed() (gas: 17153) -VerifierBulkVerifyBillingReport:test_verifyBulkReportWithUnwrappedAndWrappedNativeDefaultsToUnwrapped() (gas: 391401) -VerifierBulkVerifyBillingReport:test_verifyBulkWithLinkAndUnwrappedNative() (gas: 701002) -VerifierBulkVerifyBillingReport:test_verifyBulkWithLinkAndWrappedNative() (gas: 685582) -VerifierBulkVerifyBillingReport:test_verifyMultiVersions() (gas: 568438) -VerifierBulkVerifyBillingReport:test_verifyMultiVersionsReturnsVerifiedReports() (gas: 781249) -VerifierBulkVerifyBillingReport:test_verifyWithBulkLink() (gas: 578193) -VerifierBulkVerifyBillingReport:test_verifyWithBulkNative() (gas: 581776) -VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrapped() (gas: 589250) -VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange() (gas: 596277) +VerifierBulkVerifyBillingReport:test_verifyMultiVersions() (gas: 475575) +VerifierBulkVerifyBillingReport:test_verifyMultiVersionsReturnsVerifiedReports() (gas: 681851) +VerifierBulkVerifyBillingReport:test_verifyWithBulkLink() (gas: 556847) +VerifierBulkVerifyBillingReport:test_verifyWithBulkNative() (gas: 560426) +VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrapped() (gas: 567917) +VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange() (gas: 574921) VerifierConstructorTest:test_revertsIfInitializedWithEmptyVerifierProxy() (gas: 59939) VerifierConstructorTest:test_setsTheCorrectProperties() (gas: 1788491) VerifierDeactivateFeedWithVerifyTest:test_currentReportAllowsVerification() (gas: 192062) VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 113377) VerifierDeactivateFeedWithVerifyTest:test_previousReportAllowsVerification() (gas: 99613) VerifierDeactivateFeedWithVerifyTest:test_previousReportFailsVerification() (gas: 69932) -VerifierProxyAccessControlledVerificationTest:test_proxiesToTheVerifierIfHasAccess() (gas: 204836) -VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 109546) -VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1439877) -VerifierProxyConstructorTest:test_correctlySetsTheOwner() (gas: 1419891) +VerifierProxyAccessControlledVerificationTest:test_proxiesToTheVerifierIfHasAccess() (gas: 205796) +VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 112334) +VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1482522) +VerifierProxyConstructorTest:test_correctlySetsTheOwner() (gas: 1462646) VerifierProxyConstructorTest:test_correctlySetsVersion() (gas: 6873) -VerifierProxyInitializeVerifierTest:test_revertsIfDigestAlreadySet() (gas: 54085) -VerifierProxyInitializeVerifierTest:test_revertsIfNotCorrectVerifier() (gas: 13572) -VerifierProxyInitializeVerifierTest:test_revertsIfNotOwner() (gas: 17179) -VerifierProxyInitializeVerifierTest:test_revertsIfVerifierAlreadyInitialized() (gas: 42069) -VerifierProxyInitializeVerifierTest:test_revertsIfZeroAddress() (gas: 10970) +VerifierProxyInitializeVerifierTest:test_revertsIfDigestAlreadySet() (gas: 54086) +VerifierProxyInitializeVerifierTest:test_revertsIfNotCorrectVerifier() (gas: 13595) +VerifierProxyInitializeVerifierTest:test_revertsIfNotOwner() (gas: 17157) +VerifierProxyInitializeVerifierTest:test_revertsIfVerifierAlreadyInitialized() (gas: 42025) +VerifierProxyInitializeVerifierTest:test_revertsIfZeroAddress() (gas: 10948) VerifierProxyInitializeVerifierTest:test_setFeeManagerWhichDoesntHonourIERC165Interface() (gas: 13815) VerifierProxyInitializeVerifierTest:test_setFeeManagerWhichDoesntHonourInterface() (gas: 16301) VerifierProxyInitializeVerifierTest:test_setFeeManagerZeroAddress() (gas: 10947) -VerifierProxyInitializeVerifierTest:test_updatesVerifierIfVerifier() (gas: 53315) -VerifierProxySetAccessControllerTest:test_emitsTheCorrectEvent() (gas: 35384) -VerifierProxySetAccessControllerTest:test_revertsIfCalledByNonOwner() (gas: 15105) -VerifierProxySetAccessControllerTest:test_successfullySetsNewAccessController() (gas: 32120) -VerifierProxySetAccessControllerTest:test_successfullySetsNewAccessControllerIsEmpty() (gas: 12219) +VerifierProxyInitializeVerifierTest:test_updatesVerifierIfVerifier() (gas: 53384) +VerifierProxySetAccessControllerTest:test_emitsTheCorrectEvent() (gas: 35340) +VerifierProxySetAccessControllerTest:test_revertsIfCalledByNonOwner() (gas: 15061) +VerifierProxySetAccessControllerTest:test_successfullySetsNewAccessController() (gas: 32032) +VerifierProxySetAccessControllerTest:test_successfullySetsNewAccessControllerIsEmpty() (gas: 12131) VerifierProxyUnsetVerifierTest:test_revertsIfDigestDoesNotExist() (gas: 13141) VerifierProxyUnsetVerifierTest:test_revertsIfNotAdmin() (gas: 14965) -VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVerifier() (gas: 12697) +VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVerifier() (gas: 12720) VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_emitsAnEventAfterUnsettingVerifier() (gas: 17965) -VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 198420) -VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 116319) -VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538582) -VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964048) -VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520140) +VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 201609) +VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 117256) +VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538605) +VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964140) +VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520186) VerifierSetConfigFromSourceTest:test_revertsIfCalledByNonOwner() (gas: 183115) -VerifierSetConfigTest:test_correctlyUpdatesTheConfig() (gas: 1057669) +VerifierSetConfigTest:test_correctlyUpdatesTheConfig() (gas: 1057670) VerifierSetConfigTest:test_revertsIfCalledByNonOwner() (gas: 182962) VerifierSetConfigTest:test_revertsIfDuplicateSigners() (gas: 251529) VerifierSetConfigTest:test_revertsIfFaultToleranceIsZero() (gas: 176521) VerifierSetConfigTest:test_revertsIfNotEnoughSigners() (gas: 15813) VerifierSetConfigTest:test_revertsIfSetWithTooManySigners() (gas: 22191) VerifierSetConfigTest:test_revertsIfSignerContainsZeroAddress() (gas: 228002) -VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538369) -VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 963617) -VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 519921) +VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538392) +VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 963709) +VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 519967) VerifierSupportsInterfaceTest:test_falseIfIsNotCorrectInterface() (gas: 5590) VerifierSupportsInterfaceTest:test_trueIfIsCorrectInterface() (gas: 5633) -VerifierTestBillingReport:test_verifyWithLink() (gas: 278565) -VerifierTestBillingReport:test_verifyWithNative() (gas: 319255) -VerifierTestBillingReport:test_verifyWithNativeUnwrapped() (gas: 321498) -VerifierTestBillingReport:test_verifyWithNativeUnwrappedReturnsChange() (gas: 328564) +VerifierTestBillingReport:test_verifyWithLink() (gas: 274946) +VerifierTestBillingReport:test_verifyWithNative() (gas: 315644) +VerifierTestBillingReport:test_verifyWithNativeUnwrapped() (gas: 317892) +VerifierTestBillingReport:test_verifyWithNativeUnwrappedReturnsChange() (gas: 324958) VerifierVerifyMultipleConfigDigestTest:test_canVerifyNewerReportsWithNewerConfigs() (gas: 131228) VerifierVerifyMultipleConfigDigestTest:test_canVerifyOlderReportsWithOlderConfigs() (gas: 187132) VerifierVerifyMultipleConfigDigestTest:test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() (gas: 88205) @@ -255,11 +250,11 @@ VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedByNonProxy() (gas: 10 VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedWithIncorrectAddresses() (gas: 184066) VerifierVerifySingleConfigDigestTest:test_revertsIfWrongNumberOfSigners() (gas: 110031) VerifierVerifySingleConfigDigestTest:test_setsTheCorrectEpoch() (gas: 194270) -Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 208853) -Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 540715) -Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithNativeFeeSuccess_gas() (gas: 564087) -Verifier_setConfig:testSetConfigSuccess_gas() (gas: 922428) -Verifier_verify:testVerifyProxySuccess_gas() (gas: 195542) +Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 212066) +Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 519368) +Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithNativeFeeSuccess_gas() (gas: 542767) +Verifier_setConfig:testSetConfigSuccess_gas() (gas: 922451) +Verifier_verify:testVerifyProxySuccess_gas() (gas: 198731) Verifier_verify:testVerifySuccess_gas() (gas: 186725) -Verifier_verifyWithFee:testVerifyProxyWithLinkFeeSuccess_gas() (gas: 242514) -Verifier_verifyWithFee:testVerifyProxyWithNativeFeeSuccess_gas() (gas: 260991) \ No newline at end of file +Verifier_verifyWithFee:testVerifyProxyWithLinkFeeSuccess_gas() (gas: 238886) +Verifier_verifyWithFee:testVerifyProxyWithNativeFeeSuccess_gas() (gas: 257382) \ No newline at end of file From d2259516ceb31fdd3fbeeb0634267a5a85713296 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Wed, 13 Sep 2023 15:22:10 -0700 Subject: [PATCH 06/12] Update go gen files --- .../generated/fee_manager/fee_manager.go | 50 +++++++++---------- .../verifier_proxy/verifier_proxy.go | 32 ++++++------ ...rapper-dependency-versions-do-not-edit.txt | 4 +- 3 files changed, 41 insertions(+), 45 deletions(-) diff --git a/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go b/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go index 43f2844adc7..b8cb33c2d4c 100644 --- a/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go +++ b/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go @@ -40,18 +40,14 @@ type CommonAsset struct { Amount *big.Int } -type IFeeManagerQuote struct { - QuoteAddress common.Address -} - type IRewardManagerFeePayment struct { PoolId [32]byte Amount *big.Int } var FeeManagerMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_linkAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_nativeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_rewardManagerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ExpiredReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDiscount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQuote\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReceivingAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSurcharge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroDeficit\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"fee\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"reward\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"appliedDiscount\",\"type\":\"uint256\"}],\"name\":\"DiscountApplied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"indexed\":false,\"internalType\":\"structIRewardManager.FeePayment[]\",\"name\":\"rewards\",\"type\":\"tuple[]\"}],\"name\":\"InsufficientLink\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"linkQuantity\",\"type\":\"uint256\"}],\"name\":\"LinkDeficitCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSurcharge\",\"type\":\"uint64\"}],\"name\":\"NativeSurchargeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"SubscriberDiscountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"quoteAddress\",\"type\":\"address\"}],\"internalType\":\"structIFeeManager.Quote\",\"name\":\"quote\",\"type\":\"tuple\"}],\"name\":\"getFeeAndReward\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_nativeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_proxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_rewardManager\",\"outputs\":[{\"internalType\":\"contractIRewardManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"payLinkDeficit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFeeBulk\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_linkDeficit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nativeSurcharge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_subscriberDiscounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"rewardRecipientAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"surcharge\",\"type\":\"uint64\"}],\"name\":\"setNativeSurcharge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"updateSubscriberDiscount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101006040523480156200001257600080fd5b506040516200363b3803806200363b833981016040819052620000359162000288565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001c0565b5050506001600160a01b0384161580620000e057506001600160a01b038316155b80620000f357506001600160a01b038216155b806200010657506001600160a01b038116155b15620001255760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03848116608081905284821660a05283821660c05290821660e081905260405163095ea7b360e01b81526004810191909152600019602482015263095ea7b3906044016020604051808303816000875af11580156200018f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b59190620002e5565b505050505062000310565b336001600160a01b038216036200021a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200028357600080fd5b919050565b600080600080608085870312156200029f57600080fd5b620002aa856200026b565b9350620002ba602086016200026b565b9250620002ca604086016200026b565b9150620002da606086016200026b565b905092959194509250565b600060208284031215620002f857600080fd5b815180151581146200030957600080fd5b9392505050565b60805160a05160c05160e051613249620003f260003960008181610275015281816112cc015281816115ed01528181611e290152612077015260008181610335015281816107610152818161138c015261153301526000818161030101528181610bc101528181610c1801528181610ecf01528181610fde01528181611d4f0152611df80152600081816104a7015281816108da01528181610be601528181610c7301528181610dbd01528181610e2c01528181610e6b01528181610f870152818161111e01528181611496015281816119ca0152611eea01526132496000f3fe60806040526004361061016a5760003560e01c806379ba5097116100cb578063d09dc3391161007f578063f1387e1611610059578063f1387e16146104c9578063f2fde38b146104dc578063f65df962146104fc57600080fd5b8063d09dc33914610460578063e389d9a414610475578063ea4b861b1461049557600080fd5b80638da5cb5b116100b05780638da5cb5b146103aa578063c541cbde146103d5578063ce7817d11461044057600080fd5b806379ba50971461035757806387d6d8431461036c57600080fd5b80633aa5ac0711610122578063505380941161010757806350538094146102cf57806363878668146102ef5780636d1342cb1461032357600080fd5b80633aa5ac071461026357806340d7f78e146102bc57600080fd5b8063181f5a7711610153578063181f5a77146101df5780631d4d84a21461022b57806332f5f7461461024d57600080fd5b8063013f542b1461016f57806301ffc9a7146101af575b600080fd5b34801561017b57600080fd5b5061019c61018a366004612679565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101bb57600080fd5b506101cf6101ca366004612692565b61051c565b60405190151581526020016101a6565b3480156101eb57600080fd5b50604080518082018252601081527f4665654d616e6167657220312e302e3000000000000000000000000000000000602082015290516101a691906126f8565b34801561023757600080fd5b5061024b610246366004612791565b6105b5565b005b34801561025957600080fd5b5061019c60045481565b34801561026f57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a6565b61024b6102ca3660046127dc565b610749565b3480156102db57600080fd5b5061024b6102ea366004612874565b61098c565b3480156102fb57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b34801561032f57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b34801561036357600080fd5b5061024b610a26565b34801561037857600080fd5b5061019c61038736600461288f565b600260209081526000938452604080852082529284528284209052825290205481565b3480156103b657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610297565b3480156103e157600080fd5b506103f56103f03660046129fb565b610b28565b60408051845173ffffffffffffffffffffffffffffffffffffffff9081168252602095860151868301528451169181019190915292909101516060830152608082015260a0016101a6565b34801561044c57600080fd5b5061024b61045b366004612a9c565b610f31565b34801561046c57600080fd5b5061019c6110ed565b34801561048157600080fd5b5061024b610490366004612679565b6111a3565b3480156104a157600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b61024b6104d7366004612aed565b611374565b3480156104e857600080fd5b5061024b6104f7366004612b4f565b611507565b34801561050857600080fd5b5061024b610517366004612b6c565b61151b565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167ff1387e160000000000000000000000000000000000000000000000000000000014806105af57507fffffffff0000000000000000000000000000000000000000000000000000000082167f40d7f78e00000000000000000000000000000000000000000000000000000000145b92915050565b6105bd611654565b73ffffffffffffffffffffffffffffffffffffffff83166106925760008273ffffffffffffffffffffffffffffffffffffffff168277ffffffffffffffffffffffffffffffffffffffffffffffff1660405160006040518083038185875af1925050503d806000811461064c576040519150601f19603f3d011682016040523d82523d6000602084013e610651565b606091505b505090508061068c576040517fef2af20100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6106cd73ffffffffffffffffffffffffffffffffffffffff84168377ffffffffffffffffffffffffffffffffffffffffffffffff84166116d7565b6040805133815273ffffffffffffffffffffffffffffffffffffffff848116602083015285168183015277ffffffffffffffffffffffffffffffffffffffffffffffff8316606082015290517f7ff78a71698bdb18dcca96f52ab25e0a1b146fb6a49adf8e6845299e49021f299181900360800190a15b505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107b8576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008267ffffffffffffffff8111156107d3576107d36128c6565b60405190808252806020026020018201604052801561080c57816020015b6107f96125ec565b8152602001906001900390816107f15790505b5090506000806000805b868110156109555760008060006108508b8b8681811061083857610838612beb565b905060200281019061084a9190612c1a565b8b6117ab565b92509250925082602001516000146109415760405180608001604052808c8c8781811061087f5761087f612beb565b90506020028101906108919190612c1a565b61089a91612c86565b8152602001848152602001838152602001828152508886806108bb90612cf1565b9750815181106108cd576108cd612beb565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff160361093a57866001019650610941565b8560010195505b5050508061094e90612cf1565b9050610816565b508215158061096357508115155b1561097957610974858585856118e5565b610983565b61098385346120f9565b50505050505050565b610994611654565b670de0b6b3a764000067ffffffffffffffff821611156109e0576040517f05e8ac2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660048190556040519081527f08f7c0d17932ddb8523bc06754d42ff19ebc77d76a8b9bfde02c28ab1ed3d6399060200160405180910390a150565b60015473ffffffffffffffffffffffffffffffffffffffff163314610aac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6040805180820182526000808252602080830182905283518085018552828152808201839052845180860186528381528083018490528551808701909652838652918501839052929382610b7b88612d29565b90507fffff000000000000000000000000000000000000000000000000000000000000808216908101610c1657505073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811683527f0000000000000000000000000000000000000000000000000000000000000000168152909350915060009050610f28565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16886000015173ffffffffffffffffffffffffffffffffffffffff1614158015610cc657507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16886000015173ffffffffffffffffffffffffffffffffffffffff1614155b15610cfd576040517ff861803000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008b806020019051810190610d169190612d82565b77ffffffffffffffffffffffffffffffffffffffffffffffff91821698509116955063ffffffff1693505050428210159050610d7e576040517fb6c405f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808e16600090815260026020908152604080832089845282528083208f51851684529091529020547f00000000000000000000000000000000000000000000000000000000000000009091168752610e0e610df682670de0b6b3a7640000612df4565b610e009086612e07565b670de0b6b3a7640000612146565b60208801528b5173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116911603610e9c5773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016885260208088015190890152610f19565b600454600090610eb890610df690670de0b6b3a7640000612e44565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168a529050610f12610f0883670de0b6b3a7640000612df4565b610e009083612e07565b60208a0152505b96995094975094955050505050505b93509350939050565b610f39611654565b670de0b6b3a764000067ffffffffffffffff82161115610f85576040517f997ea36000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561102d57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611064576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff848116600081815260026020908152604080832088845282528083209487168084529482529182902067ffffffffffffffff86169081905582519485529084015285927f5eba5a8afa39780f0f99b6cbeb95f3da6a7040ca00abd46bdc91a0a060134139910160405180910390a350505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561117a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119e9190612e57565b905090565b6111ab611654565b600081815260036020526040812054908190036111f4576040517f03aad31200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600360205260408082208290558051600180825281830190925290816020015b604080518082019091526000808252602082015281526020019060019003908161121957905050905060405180604001604052808481526020018377ffffffffffffffffffffffffffffffffffffffffffffffff168152508160008151811061128457611284612beb565b60209081029190910101526040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b0d9fa19906113039084903090600401612ed0565b600060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b50505050827f843f0b103e50b42b08f9d30f12f961845a6d02623730872e24644899c0dd98958360405161136791815260200190565b60405180910390a2505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146113e3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060006113f38686866117ab565b92509250925082602001516000036114175761140f84346120f9565b505050505050565b604080516001808252818301909252600091816020015b6114366125ec565b81526020019060019003908161142e575050604080516080810190915290915080611461888a612c86565b8152602001858152602001848152602001838152508160008151811061148957611489612beb565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff16036114f9576109748582600160006118e5565b6109838582600060016118e5565b61150f611654565b6115188161217e565b50565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801590611579575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156115b0576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f14060f2300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906314060f239061162690869086908690600401612f08565b600060405180830381600087803b15801561164057600080fd5b505af1158015610983573d6000803e3d6000fd5b60005473ffffffffffffffffffffffffffffffffffffffff1633146116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610aa3565b565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526107449084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612273565b6040805180820190915260008082526020820152604080518082019091526000808252602082015260003073ffffffffffffffffffffffffffffffffffffffff851603611824576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061183286880188612ff6565b91505060008161184190612d29565b6040805160208101909152600081529091507e010000000000000000000000000000000000000000000000000000000000007fffff0000000000000000000000000000000000000000000000000000000000008316146118c85760006118a9898b018b6130ba565b95505050505050808060200190518101906118c49190613182565b9150505b6118d3878483610b28565b95509550955050505093509350939050565b60008267ffffffffffffffff811115611900576119006128c6565b60405190808252806020026020018201604052801561194557816020015b604080518082019091526000808252602082015281526020019060019003908161191e5790505b50905060008267ffffffffffffffff811115611963576119636128c6565b6040519080825280602002602001820160405280156119a857816020015b60408051808201909152600080825260208201528152602001906001900390816119815790505b5090506000808080806119bb888a612e44565b905060005b81811015611d0a577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168b8281518110611a1157611a11612beb565b6020026020010151602001516000015173ffffffffffffffffffffffffffffffffffffffff1603611ad75760405180604001604052808c8381518110611a5957611a59612beb565b60200260200101516000015181526020018c8381518110611a7c57611a7c612beb565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250888580611ab590612cf1565b965081518110611ac757611ac7612beb565b6020026020010181905250611bcc565b60405180604001604052808c8381518110611af457611af4612beb565b60200260200101516000015181526020018c8381518110611b1757611b17612beb565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250878480611b5090612cf1565b955081518110611b6257611b62612beb565b60200260200101819052508a8181518110611b7f57611b7f612beb565b6020026020010151602001516020015186611b9a9190612e44565b95508a8181518110611bae57611bae612beb565b6020026020010151604001516020015185611bc99190612e44565b94505b8a8181518110611bde57611bde612beb565b602002602001015160600151600014611cfa578b73ffffffffffffffffffffffffffffffffffffffff168b8281518110611c1a57611c1a612beb565b6020026020010151600001517f88b15eb682210089cddf967648e2cb2a4535aeadc8f8f36050922e33c04e71258d8481518110611c5957611c59612beb565b6020026020010151602001518e8581518110611c7757611c77612beb565b6020026020010151604001518f8681518110611c9557611c95612beb565b602002602001015160600151604051611cf193929190835173ffffffffffffffffffffffffffffffffffffffff908116825260209485015185830152835116604082015291909201516060820152608081019190915260a00190565b60405180910390a35b611d0381612cf1565b90506119c0565b5060003415611dd85734861115611d4d576040517fb2e532de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0876040518263ffffffff1660e01b81526004016000604051808303818588803b158015611db557600080fd5b505af1158015611dc9573d6000803e3d6000fd5b50505050508534039050611e20565b8515611e2057611e2073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168d308961237f565b875115611eb5577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b0d9fa19898e6040518363ffffffff1660e01b8152600401611e82929190612ed0565b600060405180830381600087803b158015611e9c57600080fd5b505af1158015611eb0573d6000803e3d6000fd5b505050505b8651156120e1576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611f46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f6a9190612e57565b85111561203a5760005b8751811015611ffd57878181518110611f8f57611f8f612beb565b60200260200101516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16600360008a8481518110611fcb57611fcb612beb565b60209081029190910181015151825281019190915260400160002080549091019055611ff681612cf1565b9050611f74565b507ff52e5907b69d97c33392936c12d78b494463b78c5b72df50b4c497eee5720b678760405161202d91906131b0565b60405180910390a16120e1565b6040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b0d9fa19906120ae908a903090600401612ed0565b600060405180830381600087803b1580156120c857600080fd5b505af11580156120dc573d6000803e3d6000fd5b505050505b6120eb8c826120f9565b505050505050505050505050565b80156121425760405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610744573d6000803e3d6000fd5b5050565b60008215612174578161215a600185612df4565b61216491906131c3565b61216f906001612e44565b612177565b60005b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036121fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610aa3565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006122d5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123dd9092919063ffffffff16565b80519091501561074457808060200190518101906122f391906131fe565b610744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610aa3565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261068c9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611729565b60606123ec84846000856123f4565b949350505050565b606082471015612486576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610aa3565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516124af9190613220565b60006040518083038185875af1925050503d80600081146124ec576040519150601f19603f3d011682016040523d82523d6000602084013e6124f1565b606091505b50915091506125028783838761250d565b979650505050505050565b606083156125a357825160000361259c5773ffffffffffffffffffffffffffffffffffffffff85163b61259c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aa3565b50816123ec565b6123ec83838151156125b85781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa391906126f8565b6040518060800160405280600080191681526020016126346040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b815260200161266c6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b8152602001600081525090565b60006020828403121561268b57600080fd5b5035919050565b6000602082840312156126a457600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461217757600080fd5b60005b838110156126ef5781810151838201526020016126d7565b50506000910152565b60208152600082518060208401526127178160408501602087016126d4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461151857600080fd5b77ffffffffffffffffffffffffffffffffffffffffffffffff8116811461151857600080fd5b6000806000606084860312156127a657600080fd5b83356127b181612749565b925060208401356127c181612749565b915060408401356127d18161276b565b809150509250925092565b6000806000604084860312156127f157600080fd5b833567ffffffffffffffff8082111561280957600080fd5b818601915086601f83011261281d57600080fd5b81358181111561282c57600080fd5b8760208260051b850101111561284157600080fd5b602092830195509350508401356127d181612749565b803567ffffffffffffffff8116811461286f57600080fd5b919050565b60006020828403121561288657600080fd5b61217782612857565b6000806000606084860312156128a457600080fd5b83356128af81612749565b92506020840135915060408401356127d181612749565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516020810167ffffffffffffffff81118282101715612918576129186128c6565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612965576129656128c6565b604052919050565b600082601f83011261297e57600080fd5b813567ffffffffffffffff811115612998576129986128c6565b6129c960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161291e565b8181528460208386010111156129de57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008385036060811215612a1157600080fd5b8435612a1c81612749565b9350602085013567ffffffffffffffff811115612a3857600080fd5b612a448782880161296d565b93505060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215612a7757600080fd5b50612a806128f5565b6040850135612a8e81612749565b815292959194509192509050565b60008060008060808587031215612ab257600080fd5b8435612abd81612749565b9350602085013592506040850135612ad481612749565b9150612ae260608601612857565b905092959194509250565b600080600060408486031215612b0257600080fd5b833567ffffffffffffffff80821115612b1a57600080fd5b818601915086601f830112612b2e57600080fd5b813581811115612b3d57600080fd5b87602082850101111561284157600080fd5b600060208284031215612b6157600080fd5b813561217781612749565b600080600060408486031215612b8157600080fd5b83359250602084013567ffffffffffffffff80821115612ba057600080fd5b818601915086601f830112612bb457600080fd5b813581811115612bc357600080fd5b8760208260061b8501011115612bd857600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c4f57600080fd5b83018035915067ffffffffffffffff821115612c6a57600080fd5b602001915036819003821315612c7f57600080fd5b9250929050565b803560208310156105af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d2257612d22612cc2565b5060010190565b80516020808301519190811015612d68577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b805163ffffffff8116811461286f57600080fd5b60008060008060008060c08789031215612d9b57600080fd5b86519550612dab60208801612d6e565b9450612db960408801612d6e565b93506060870151612dc98161276b565b6080880151909350612dda8161276b565b9150612de860a08801612d6e565b90509295509295509295565b818103818111156105af576105af612cc2565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e3f57612e3f612cc2565b500290565b808201808211156105af576105af612cc2565b600060208284031215612e6957600080fd5b5051919050565b600081518084526020808501945080840160005b83811015612ec55781518051885283015177ffffffffffffffffffffffffffffffffffffffffffffffff168388015260409096019590820190600101612e84565b509495945050505050565b604081526000612ee36040830185612e70565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b8381526040602080830182905282820184905260009190859060608501845b87811015612f7b578335612f3a81612749565b73ffffffffffffffffffffffffffffffffffffffff16825267ffffffffffffffff612f66858501612857565b16828401529284019290840190600101612f27565b5098975050505050505050565b600082601f830112612f9957600080fd5b6040516060810181811067ffffffffffffffff82111715612fbc57612fbc6128c6565b604052806060840185811115612fd157600080fd5b845b81811015612feb578035835260209283019201612fd3565b509195945050505050565b6000806080838503121561300957600080fd5b6130138484612f88565b9150606083013567ffffffffffffffff81111561302f57600080fd5b61303b8582860161296d565b9150509250929050565b600082601f83011261305657600080fd5b8135602067ffffffffffffffff821115613072576130726128c6565b8160051b61308182820161291e565b928352848101820192828101908785111561309b57600080fd5b83870192505b84831015612502578235825291830191908301906130a1565b60008060008060008061010087890312156130d457600080fd5b6130de8888612f88565b9550606087013567ffffffffffffffff808211156130fb57600080fd5b6131078a838b0161296d565b9650608089013591508082111561311d57600080fd5b6131298a838b01613045565b955060a089013591508082111561313f57600080fd5b61314b8a838b01613045565b945060c0890135935060e089013591508082111561316857600080fd5b5061317589828a0161296d565b9150509295509295509295565b60006020828403121561319457600080fd5b61319c6128f5565b82516131a781612749565b81529392505050565b6020815260006121776020830184612e70565b6000826131f9577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561321057600080fd5b8151801515811461217757600080fd5b600082516132328184602087016126d4565b919091019291505056fea164736f6c6343000810000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_linkAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_nativeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_rewardManagerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ExpiredReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDiscount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQuote\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReceivingAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSurcharge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroDeficit\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"fee\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"reward\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"appliedDiscount\",\"type\":\"uint256\"}],\"name\":\"DiscountApplied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"indexed\":false,\"internalType\":\"structIRewardManager.FeePayment[]\",\"name\":\"rewards\",\"type\":\"tuple[]\"}],\"name\":\"InsufficientLink\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"linkQuantity\",\"type\":\"uint256\"}],\"name\":\"LinkDeficitCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSurcharge\",\"type\":\"uint64\"}],\"name\":\"NativeSurchargeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"SubscriberDiscountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"quoteAddress\",\"type\":\"address\"}],\"name\":\"getFeeAndReward\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_nativeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_proxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_rewardManager\",\"outputs\":[{\"internalType\":\"contractIRewardManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"payLinkDeficit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFeeBulk\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_linkDeficit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nativeSurcharge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_subscriberDiscounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"rewardRecipientAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"surcharge\",\"type\":\"uint64\"}],\"name\":\"setNativeSurcharge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"updateSubscriberDiscount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b506040516200349938038062003499833981016040819052620000359162000288565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001c0565b5050506001600160a01b0384161580620000e057506001600160a01b038316155b80620000f357506001600160a01b038216155b806200010657506001600160a01b038116155b15620001255760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03848116608081905284821660a05283821660c05290821660e081905260405163095ea7b360e01b81526004810191909152600019602482015263095ea7b3906044016020604051808303816000875af11580156200018f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b59190620002e5565b505050505062000310565b336001600160a01b038216036200021a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200028357600080fd5b919050565b600080600080608085870312156200029f57600080fd5b620002aa856200026b565b9350620002ba602086016200026b565b9250620002ca604086016200026b565b9150620002da606086016200026b565b905092959194509250565b600060208284031215620002f857600080fd5b815180151581146200030957600080fd5b9392505050565b60805160a05160c05160e0516130a7620003f26000396000818161027501528181611462015281816115f001528181611e0b0152612059015260008181610335015281816107fb01528181610db601526115360152600081816102ee01528181610bd901528181610fd30152818161102a015281816112d701528181611d310152611dda0152600081816104ba0152818161097601528181610b8201528181610d1901528181610ec201528181610ff801528181611081015281816111c60152818161123301528181611273015281816119ac0152611ecc01526130a76000f3fe60806040526004361061016a5760003560e01c806379ba5097116100cb578063dba45fe01161007f578063ea4b861b11610059578063ea4b861b146104a8578063f2fde38b146104dc578063f65df962146104fc57600080fd5b8063dba45fe01461040a578063e03dab1a1461041d578063e389d9a41461048857600080fd5b80638da5cb5b116100b05780638da5cb5b146103aa578063ce7817d1146103d5578063d09dc339146103f557600080fd5b806379ba50971461035757806387d6d8431461036c57600080fd5b80633aa5ac0711610122578063638786681161010757806363878668146102dc5780636c2f1a17146103105780636d1342cb1461032357600080fd5b80633aa5ac071461026357806350538094146102bc57600080fd5b8063181f5a7711610153578063181f5a77146101df5780631d4d84a21461022b57806332f5f7461461024d57600080fd5b8063013f542b1461016f57806301ffc9a7146101af575b600080fd5b34801561017b57600080fd5b5061019c61018a36600461265b565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101bb57600080fd5b506101cf6101ca366004612674565b61051c565b60405190151581526020016101a6565b3480156101eb57600080fd5b50604080518082018252601081527f4665654d616e6167657220312e302e3000000000000000000000000000000000602082015290516101a691906126da565b34801561023757600080fd5b5061024b610246366004612783565b6105b5565b005b34801561025957600080fd5b5061019c60045481565b34801561026f57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a6565b3480156102c857600080fd5b5061024b6102d73660046127e6565b610749565b3480156102e857600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b61024b61031e36600461284a565b6107e3565b34801561032f57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b34801561036357600080fd5b5061024b610a2a565b34801561037857600080fd5b5061019c6103873660046128f9565b600260209081526000938452604080852082529284528284209052825290205481565b3480156103b657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610297565b3480156103e157600080fd5b5061024b6103f0366004612930565b610b2c565b34801561040157600080fd5b5061019c610ce8565b61024b610418366004612981565b610d9e565b34801561042957600080fd5b5061043d610438366004612adf565b610f3a565b60408051845173ffffffffffffffffffffffffffffffffffffffff9081168252602095860151868301528451169181019190915292909101516060830152608082015260a0016101a6565b34801561049457600080fd5b5061024b6104a336600461265b565b611339565b3480156104b457600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e857600080fd5b5061024b6104f7366004612b38565b61150a565b34801561050857600080fd5b5061024b610517366004612b55565b61151e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fdba45fe00000000000000000000000000000000000000000000000000000000014806105af57507fffffffff0000000000000000000000000000000000000000000000000000000082167f6c2f1a1700000000000000000000000000000000000000000000000000000000145b92915050565b6105bd611660565b73ffffffffffffffffffffffffffffffffffffffff83166106925760008273ffffffffffffffffffffffffffffffffffffffff168277ffffffffffffffffffffffffffffffffffffffffffffffff1660405160006040518083038185875af1925050503d806000811461064c576040519150601f19603f3d011682016040523d82523d6000602084013e610651565b606091505b505090508061068c576040517fef2af20100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6106cd73ffffffffffffffffffffffffffffffffffffffff84168377ffffffffffffffffffffffffffffffffffffffffffffffff84166116e3565b6040805133815273ffffffffffffffffffffffffffffffffffffffff848116602083015285168183015277ffffffffffffffffffffffffffffffffffffffffffffffff8316606082015290517f7ff78a71698bdb18dcca96f52ab25e0a1b146fb6a49adf8e6845299e49021f299181900360800190a15b505050565b610751611660565b670de0b6b3a764000067ffffffffffffffff8216111561079d576040517f05e8ac2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660048190556040519081527f08f7c0d17932ddb8523bc06754d42ff19ebc77d76a8b9bfde02c28ab1ed3d6399060200160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610852576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008467ffffffffffffffff81111561086d5761086d612a05565b6040519080825280602002602001820160405280156108a657816020015b6108936125ce565b81526020019060019003908161088b5790505b5090506000806000805b888110156109f15760008060006108ec8d8d868181106108d2576108d2612bd4565b90506020028101906108e49190612c03565b8d8d8d6117b7565b92509250925082602001516000146109dd5760405180608001604052808e8e8781811061091b5761091b612bd4565b905060200281019061092d9190612c03565b61093691612c68565b81526020018481526020018381526020018281525088868061095790612cd3565b97508151811061096957610969612bd4565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff16036109d6578660010196506109dd565b8560010195505b505050806109ea90612cd3565b90506108b0565b50821515806109ff57508115155b15610a1557610a10858585856118c7565b610a1f565b610a1f85346120db565b505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ab0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b34611660565b670de0b6b3a764000067ffffffffffffffff82161115610b80576040517f997ea36000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015610c2857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15610c5f576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff848116600081815260026020908152604080832088845282528083209487168084529482529182902067ffffffffffffffff86169081905582519485529084015285927f5eba5a8afa39780f0f99b6cbeb95f3da6a7040ca00abd46bdc91a0a060134139910160405180910390a350505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190612d0b565b905090565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610e0d576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000610e1f88888888886117b7565b9250925092508260200151600003610e4357610e3b84346120db565b505050610f33565b604080516001808252818301909252600091816020015b610e626125ce565b815260200190600190039081610e5a575050604080516080810190915290915080610e8d8a8c612c68565b81526020018581526020018481526020018381525081600081518110610eb557610eb5612bd4565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff1603610f2557610a108582600160006118c7565b610a1f8582600060016118c7565b5050505050565b6040805180820182526000808252602080830182905283518085018552828152808201839052845180860186528381528083018490528551808701909652838652918501839052929382610f8d88612d24565b90507fffff00000000000000000000000000000000000000000000000000000000000080821690810161102857505073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811683527f0000000000000000000000000000000000000000000000000000000000000000168152909350915060009050611330565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141580156110d057507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614155b15611107576040517ff861803000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008b8060200190518101906111209190612d7d565b77ffffffffffffffffffffffffffffffffffffffffffffffff91821698509116955063ffffffff1693505050428210159050611188576040517fb6c405f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808e16600090815260026020908152604080832089845282528083208f851684529091529020547f000000000000000000000000000000000000000000000000000000000000000090911687526112176111ff82670de0b6b3a7640000612def565b6112099086612e02565b670de0b6b3a7640000612128565b602088015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116908d16036112a45773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016885260208088015190890152611321565b6004546000906112c0906111ff90670de0b6b3a7640000612e3f565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168a52905061131a61131083670de0b6b3a7640000612def565b6112099083612e02565b60208a0152505b96995094975094955050505050505b93509350939050565b611341611660565b6000818152600360205260408120549081900361138a576040517f03aad31200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600360205260408082208290558051600180825281830190925290816020015b60408051808201909152600080825260208201528152602001906001900390816113af57905050905060405180604001604052808481526020018377ffffffffffffffffffffffffffffffffffffffffffffffff168152508160008151811061141a5761141a612bd4565b60209081029190910101526040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b0d9fa19906114999084903090600401612eb2565b600060405180830381600087803b1580156114b357600080fd5b505af11580156114c7573d6000803e3d6000fd5b50505050827f843f0b103e50b42b08f9d30f12f961845a6d02623730872e24644899c0dd9895836040516114fd91815260200190565b60405180910390a2505050565b611512611660565b61151b81612160565b50565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480159061157c575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156115b3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f14060f2300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906314060f239061162990869086908690600401612eea565b600060405180830381600087803b15801561164357600080fd5b505af1158015611657573d6000803e3d6000fd5b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610aa7565b565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526107449084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612255565b6040805180820190915260008082526020820152604080518082019091526000808252602082015260003073ffffffffffffffffffffffffffffffffffffffff851603611830576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061183e888a018a612f6a565b91505060008161184d90612d24565b905060007e010000000000000000000000000000000000000000000000000000000000007fffff0000000000000000000000000000000000000000000000000000000000008316146118a8576118a5888a018a612b38565b90505b6118b3878483610f3a565b955095509550505050955095509592505050565b60008267ffffffffffffffff8111156118e2576118e2612a05565b60405190808252806020026020018201604052801561192757816020015b60408051808201909152600080825260208201528152602001906001900390816119005790505b50905060008267ffffffffffffffff81111561194557611945612a05565b60405190808252806020026020018201604052801561198a57816020015b60408051808201909152600080825260208201528152602001906001900390816119635790505b50905060008080808061199d888a612e3f565b905060005b81811015611cec577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168b82815181106119f3576119f3612bd4565b6020026020010151602001516000015173ffffffffffffffffffffffffffffffffffffffff1603611ab95760405180604001604052808c8381518110611a3b57611a3b612bd4565b60200260200101516000015181526020018c8381518110611a5e57611a5e612bd4565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250888580611a9790612cd3565b965081518110611aa957611aa9612bd4565b6020026020010181905250611bae565b60405180604001604052808c8381518110611ad657611ad6612bd4565b60200260200101516000015181526020018c8381518110611af957611af9612bd4565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250878480611b3290612cd3565b955081518110611b4457611b44612bd4565b60200260200101819052508a8181518110611b6157611b61612bd4565b6020026020010151602001516020015186611b7c9190612e3f565b95508a8181518110611b9057611b90612bd4565b6020026020010151604001516020015185611bab9190612e3f565b94505b8a8181518110611bc057611bc0612bd4565b602002602001015160600151600014611cdc578b73ffffffffffffffffffffffffffffffffffffffff168b8281518110611bfc57611bfc612bd4565b6020026020010151600001517f88b15eb682210089cddf967648e2cb2a4535aeadc8f8f36050922e33c04e71258d8481518110611c3b57611c3b612bd4565b6020026020010151602001518e8581518110611c5957611c59612bd4565b6020026020010151604001518f8681518110611c7757611c77612bd4565b602002602001015160600151604051611cd393929190835173ffffffffffffffffffffffffffffffffffffffff908116825260209485015185830152835116604082015291909201516060820152608081019190915260a00190565b60405180910390a35b611ce581612cd3565b90506119a2565b5060003415611dba5734861115611d2f576040517fb2e532de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0876040518263ffffffff1660e01b81526004016000604051808303818588803b158015611d9757600080fd5b505af1158015611dab573d6000803e3d6000fd5b50505050508534039050611e02565b8515611e0257611e0273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168d3089612361565b875115611e97577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b0d9fa19898e6040518363ffffffff1660e01b8152600401611e64929190612eb2565b600060405180830381600087803b158015611e7e57600080fd5b505af1158015611e92573d6000803e3d6000fd5b505050505b8651156120c3576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4c9190612d0b565b85111561201c5760005b8751811015611fdf57878181518110611f7157611f71612bd4565b60200260200101516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16600360008a8481518110611fad57611fad612bd4565b60209081029190910181015151825281019190915260400160002080549091019055611fd881612cd3565b9050611f56565b507ff52e5907b69d97c33392936c12d78b494463b78c5b72df50b4c497eee5720b678760405161200f919061300e565b60405180910390a16120c3565b6040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b0d9fa1990612090908a903090600401612eb2565b600060405180830381600087803b1580156120aa57600080fd5b505af11580156120be573d6000803e3d6000fd5b505050505b6120cd8c826120db565b505050505050505050505050565b80156121245760405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610744573d6000803e3d6000fd5b5050565b60008215612156578161213c600185612def565b6121469190613021565b612151906001612e3f565b612159565b60005b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036121df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610aa7565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006122b7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123bf9092919063ffffffff16565b80519091501561074457808060200190518101906122d5919061305c565b610744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610aa7565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261068c9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611735565b60606123ce84846000856123d6565b949350505050565b606082471015612468576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610aa7565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612491919061307e565b60006040518083038185875af1925050503d80600081146124ce576040519150601f19603f3d011682016040523d82523d6000602084013e6124d3565b606091505b50915091506124e4878383876124ef565b979650505050505050565b6060831561258557825160000361257e5773ffffffffffffffffffffffffffffffffffffffff85163b61257e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aa7565b50816123ce565b6123ce838381511561259a5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa791906126da565b6040518060800160405280600080191681526020016126166040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b815260200161264e6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b8152602001600081525090565b60006020828403121561266d57600080fd5b5035919050565b60006020828403121561268657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461215957600080fd5b60005b838110156126d15781810151838201526020016126b9565b50506000910152565b60208152600082518060208401526126f98160408501602087016126b6565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461151b57600080fd5b80356127588161272b565b919050565b77ffffffffffffffffffffffffffffffffffffffffffffffff8116811461151b57600080fd5b60008060006060848603121561279857600080fd5b83356127a38161272b565b925060208401356127b38161272b565b915060408401356127c38161275d565b809150509250925092565b803567ffffffffffffffff8116811461275857600080fd5b6000602082840312156127f857600080fd5b612159826127ce565b60008083601f84011261281357600080fd5b50813567ffffffffffffffff81111561282b57600080fd5b60208301915083602082850101111561284357600080fd5b9250929050565b60008060008060006060868803121561286257600080fd5b853567ffffffffffffffff8082111561287a57600080fd5b818801915088601f83011261288e57600080fd5b81358181111561289d57600080fd5b8960208260051b85010111156128b257600080fd5b6020928301975095509087013590808211156128cd57600080fd5b506128da88828901612801565b90945092506128ed90506040870161274d565b90509295509295909350565b60008060006060848603121561290e57600080fd5b83356129198161272b565b92506020840135915060408401356127c38161272b565b6000806000806080858703121561294657600080fd5b84356129518161272b565b93506020850135925060408501356129688161272b565b9150612976606086016127ce565b905092959194509250565b60008060008060006060868803121561299957600080fd5b853567ffffffffffffffff808211156129b157600080fd5b6129bd89838a01612801565b909750955060208801359150808211156129d657600080fd5b506129e388828901612801565b90945092505060408601356129f78161272b565b809150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112612a4557600080fd5b813567ffffffffffffffff80821115612a6057612a60612a05565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715612aa657612aa6612a05565b81604052838152866020858801011115612abf57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215612af457600080fd5b8335612aff8161272b565b9250602084013567ffffffffffffffff811115612b1b57600080fd5b612b2786828701612a34565b92505060408401356127c38161272b565b600060208284031215612b4a57600080fd5b81356121598161272b565b600080600060408486031215612b6a57600080fd5b83359250602084013567ffffffffffffffff80821115612b8957600080fd5b818601915086601f830112612b9d57600080fd5b813581811115612bac57600080fd5b8760208260061b8501011115612bc157600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c3857600080fd5b83018035915067ffffffffffffffff821115612c5357600080fd5b60200191503681900382131561284357600080fd5b803560208310156105af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d0457612d04612ca4565b5060010190565b600060208284031215612d1d57600080fd5b5051919050565b80516020808301519190811015612d63577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b805163ffffffff8116811461275857600080fd5b60008060008060008060c08789031215612d9657600080fd5b86519550612da660208801612d69565b9450612db460408801612d69565b93506060870151612dc48161275d565b6080880151909350612dd58161275d565b9150612de360a08801612d69565b90509295509295509295565b818103818111156105af576105af612ca4565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e3a57612e3a612ca4565b500290565b808201808211156105af576105af612ca4565b600081518084526020808501945080840160005b83811015612ea75781518051885283015177ffffffffffffffffffffffffffffffffffffffffffffffff168388015260409096019590820190600101612e66565b509495945050505050565b604081526000612ec56040830185612e52565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b8381526040602080830182905282820184905260009190859060608501845b87811015612f5d578335612f1c8161272b565b73ffffffffffffffffffffffffffffffffffffffff16825267ffffffffffffffff612f488585016127ce565b16828401529284019290840190600101612f09565b5098975050505050505050565b60008060808385031215612f7d57600080fd5b83601f840112612f8c57600080fd5b6040516060810167ffffffffffffffff8282108183111715612fb057612fb0612a05565b816040528291506060860187811115612fc857600080fd5b865b81811015612fe2578035845260209384019301612fca565b5092945091359180831115612ff657600080fd5b505061300485828601612a34565b9150509250929050565b6020815260006121596020830184612e52565b600082613057577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561306e57600080fd5b8151801515811461215957600080fd5b600082516130908184602087016126b6565b919091019291505056fea164736f6c6343000810000a", } var FeeManagerABI = FeeManagerMetaData.ABI @@ -190,9 +186,9 @@ func (_FeeManager *FeeManagerTransactorRaw) Transact(opts *bind.TransactOpts, me return _FeeManager.Contract.contract.Transact(opts, method, params...) } -func (_FeeManager *FeeManagerCaller) GetFeeAndReward(opts *bind.CallOpts, subscriber common.Address, report []byte, quote IFeeManagerQuote) (CommonAsset, CommonAsset, *big.Int, error) { +func (_FeeManager *FeeManagerCaller) GetFeeAndReward(opts *bind.CallOpts, subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) { var out []interface{} - err := _FeeManager.contract.Call(opts, &out, "getFeeAndReward", subscriber, report, quote) + err := _FeeManager.contract.Call(opts, &out, "getFeeAndReward", subscriber, report, quoteAddress) if err != nil { return *new(CommonAsset), *new(CommonAsset), *new(*big.Int), err @@ -206,12 +202,12 @@ func (_FeeManager *FeeManagerCaller) GetFeeAndReward(opts *bind.CallOpts, subscr } -func (_FeeManager *FeeManagerSession) GetFeeAndReward(subscriber common.Address, report []byte, quote IFeeManagerQuote) (CommonAsset, CommonAsset, *big.Int, error) { - return _FeeManager.Contract.GetFeeAndReward(&_FeeManager.CallOpts, subscriber, report, quote) +func (_FeeManager *FeeManagerSession) GetFeeAndReward(subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) { + return _FeeManager.Contract.GetFeeAndReward(&_FeeManager.CallOpts, subscriber, report, quoteAddress) } -func (_FeeManager *FeeManagerCallerSession) GetFeeAndReward(subscriber common.Address, report []byte, quote IFeeManagerQuote) (CommonAsset, CommonAsset, *big.Int, error) { - return _FeeManager.Contract.GetFeeAndReward(&_FeeManager.CallOpts, subscriber, report, quote) +func (_FeeManager *FeeManagerCallerSession) GetFeeAndReward(subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) { + return _FeeManager.Contract.GetFeeAndReward(&_FeeManager.CallOpts, subscriber, report, quoteAddress) } func (_FeeManager *FeeManagerCaller) ILinkAddress(opts *bind.CallOpts) (common.Address, error) { @@ -480,28 +476,28 @@ func (_FeeManager *FeeManagerTransactorSession) PayLinkDeficit(configDigest [32] return _FeeManager.Contract.PayLinkDeficit(&_FeeManager.TransactOpts, configDigest) } -func (_FeeManager *FeeManagerTransactor) ProcessFee(opts *bind.TransactOpts, payload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.contract.Transact(opts, "processFee", payload, subscriber) +func (_FeeManager *FeeManagerTransactor) ProcessFee(opts *bind.TransactOpts, payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.contract.Transact(opts, "processFee", payload, feePayload, subscriber) } -func (_FeeManager *FeeManagerSession) ProcessFee(payload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, subscriber) +func (_FeeManager *FeeManagerSession) ProcessFee(payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, feePayload, subscriber) } -func (_FeeManager *FeeManagerTransactorSession) ProcessFee(payload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, subscriber) +func (_FeeManager *FeeManagerTransactorSession) ProcessFee(payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, feePayload, subscriber) } -func (_FeeManager *FeeManagerTransactor) ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.contract.Transact(opts, "processFeeBulk", payloads, subscriber) +func (_FeeManager *FeeManagerTransactor) ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.contract.Transact(opts, "processFeeBulk", payloads, feePayload, subscriber) } -func (_FeeManager *FeeManagerSession) ProcessFeeBulk(payloads [][]byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, subscriber) +func (_FeeManager *FeeManagerSession) ProcessFeeBulk(payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, feePayload, subscriber) } -func (_FeeManager *FeeManagerTransactorSession) ProcessFeeBulk(payloads [][]byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, subscriber) +func (_FeeManager *FeeManagerTransactorSession) ProcessFeeBulk(payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, feePayload, subscriber) } func (_FeeManager *FeeManagerTransactor) SetFeeRecipients(opts *bind.TransactOpts, configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { @@ -1656,7 +1652,7 @@ func (_FeeManager *FeeManager) Address() common.Address { } type FeeManagerInterface interface { - GetFeeAndReward(opts *bind.CallOpts, subscriber common.Address, report []byte, quote IFeeManagerQuote) (CommonAsset, CommonAsset, *big.Int, error) + GetFeeAndReward(opts *bind.CallOpts, subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) ILinkAddress(opts *bind.CallOpts) (common.Address, error) @@ -1684,9 +1680,9 @@ type FeeManagerInterface interface { PayLinkDeficit(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) - ProcessFee(opts *bind.TransactOpts, payload []byte, subscriber common.Address) (*types.Transaction, error) + ProcessFee(opts *bind.TransactOpts, payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) - ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, subscriber common.Address) (*types.Transaction, error) + ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) SetFeeRecipients(opts *bind.TransactOpts, configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) diff --git a/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go b/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go index 12e5e28948e..a63447a1484 100644 --- a/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go +++ b/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go @@ -36,8 +36,8 @@ type CommonAddressAndWeight struct { } var VerifierProxyMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadVerification\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"ConfigDigestAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeManagerInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"VerifierAlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VerifierInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"VerifierNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessController\",\"type\":\"address\"}],\"name\":\"AccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeManager\",\"type\":\"address\"}],\"name\":\"FeeManagerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierUnset\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"initializeVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_accessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeManager\",\"outputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"name\":\"setAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"feeManager\",\"type\":\"address\"}],\"name\":\"setFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"currentConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"addressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"unsetVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"}],\"name\":\"verifyBulk\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"verifiedReports\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b5060405162001c6138038062001c61833981016040819052620000349162000193565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050600480546001600160a01b0319166001600160a01b03939093169290921790915550620001c5565b336001600160a01b03821603620001425760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001a657600080fd5b81516001600160a01b0381168114620001be57600080fd5b9392505050565b611a8c80620001d56000396000f3fe6080604052600436106100dd5760003560e01c80638da5cb5b1161007f578063b011b24711610059578063b011b2471461028e578063eeb7b248146102ae578063f08391d8146102f1578063f2fde38b1461031157600080fd5b80638da5cb5b146102235780638e760afe1461024e57806394ba28461461026157600080fd5b80636e914094116100bb5780636e914094146101ae57806379ba5097146101ce57806383490cd7146101e35780638c2a4d531461020357600080fd5b8063181f5a77146100e257806338416b5b1461013a578063472d35b91461018c575b600080fd5b3480156100ee57600080fd5b5060408051808201909152601381527f566572696669657250726f787920312e312e300000000000000000000000000060208201525b60405161013191906113b2565b60405180910390f35b34801561014657600080fd5b506005546101679073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610131565b34801561019857600080fd5b506101ac6101a73660046113ee565b610331565b005b3480156101ba57600080fd5b506101ac6101c936600461140b565b6105a9565b3480156101da57600080fd5b506101ac61069a565b6101f66101f1366004611424565b610797565b6040516101319190611499565b34801561020f57600080fd5b506101ac61021e3660046113ee565b6109f5565b34801561022f57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610167565b61012461025c366004611519565b610c26565b34801561026d57600080fd5b506004546101679073ffffffffffffffffffffffffffffffffffffffff1681565b34801561029a57600080fd5b506101ac6102a9366004611579565b610dda565b3480156102ba57600080fd5b506101676102c936600461140b565b60009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b3480156102fd57600080fd5b506101ac61030c3660046113ee565b611000565b34801561031d57600080fd5b506101ac61032c3660046113ee565b611087565b61033961109b565b73ffffffffffffffffffffffffffffffffffffffff8116610386576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527ff1387e1600000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015610410573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043491906115fc565b15806104eb57506040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f40d7f78e00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa1580156104c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e991906115fc565b155b15610522576040517f8238941900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f04628abcaa6b1674651352125cb94b65b289145bc2bc4d67720bb7d966372f0391015b60405180910390a15050565b6105b161109b565b60008181526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610615576040517fb151802b000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b6000828152600360205260409081902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055517f11dc15c4b8ac2b183166cc8427e5385a5ece8308217a4217338c6a7614845c4c9061059d908490849091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60015473ffffffffffffffffffffffffffffffffffffffff16331461071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161060c565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60045460609073ffffffffffffffffffffffffffffffffffffffff16801580159061085757506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf8906108149033906000903690600401611667565b602060405180830381865afa158015610831573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085591906115fc565b155b1561088e576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055473ffffffffffffffffffffffffffffffffffffffff168015610938576040517f40d7f78e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216906340d7f78e90349061090590899089903390600401611697565b6000604051808303818588803b15801561091e57600080fd5b505af1158015610932573d6000803e3d6000fd5b50505050505b8367ffffffffffffffff8111156109515761095161178c565b60405190808252806020026020018201604052801561098457816020015b606081526020019060019003908161096f5790505b50925060005b848110156109ec576109be8686838181106109a7576109a76117bb565b90506020028101906109b991906117ea565b61111e565b8482815181106109d0576109d06117bb565b6020026020010181905250806109e590611856565b905061098a565b50505092915050565b6109fd61109b565b8073ffffffffffffffffffffffffffffffffffffffff8116610a4b576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f3d3ac1b500000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015610ad5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af991906115fc565b610b2f576040517f75b0527a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff1615610ba7576040517f4e01ccfd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015260240161060c565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f1f2cd7c97f4d801b5efe26cc409617c1fd6c5ef786e79aacb90af40923e4e8e9910161059d565b60045460609073ffffffffffffffffffffffffffffffffffffffff168015801590610ce657506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf890610ca39033906000903690600401611667565b602060405180830381865afa158015610cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce491906115fc565b155b15610d1d576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055473ffffffffffffffffffffffffffffffffffffffff168015610dc7576040517ff1387e1600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063f1387e16903490610d94908990899033906004016118b5565b6000604051808303818588803b158015610dad57600080fd5b505af1158015610dc1573d6000803e3d6000fd5b50505050505b610dd1858561111e565b95945050505050565b600083815260036020526040902054839073ffffffffffffffffffffffffffffffffffffffff168015610e58576040517f375d1fe60000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff8216602482015260440161060c565b3360009081526002602052604090205460ff16610ea1576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260036020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790558215610fb95760055473ffffffffffffffffffffffffffffffffffffffff16610f2c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546040517ff65df96200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063f65df96290610f86908890889088906004016118ef565b600060405180830381600087803b158015610fa057600080fd5b505af1158015610fb4573d6000803e3d6000fd5b505050505b6040805187815260208101879052338183015290517fbeb513e532542a562ac35699e7cd9ae7d198dcd3eee15bada6c857d28ceaddcf9181900360600190a1505050505050565b61100861109b565b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f953e92b1a6442e9c3242531154a3f6f6eb00b4e9c719ba8118fa6235e4ce89b6910161059d565b61108f61109b565b6110988161124f565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461111c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161060c565b565b6060600061112c8385611978565b60008181526003602052604090205490915073ffffffffffffffffffffffffffffffffffffffff168061118e576040517fb151802b0000000000000000000000000000000000000000000000000000000081526004810183905260240161060c565b6040517f3d3ac1b500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690633d3ac1b5906111e4908890889033906004016118b5565b6000604051808303816000875af1158015611203573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610dd191908101906119b4565b92915050565b3373ffffffffffffffffffffffffffffffffffffffff8216036112ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161060c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005b8381101561135f578181015183820152602001611347565b50506000910152565b60008151808452611380816020860160208601611344565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006113c56020830184611368565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461109857600080fd5b60006020828403121561140057600080fd5b81356113c5816113cc565b60006020828403121561141d57600080fd5b5035919050565b6000806020838503121561143757600080fd5b823567ffffffffffffffff8082111561144f57600080fd5b818501915085601f83011261146357600080fd5b81358181111561147257600080fd5b8660208260051b850101111561148757600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561150c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526114fa858351611368565b945092850192908501906001016114c0565b5092979650505050505050565b6000806020838503121561152c57600080fd5b823567ffffffffffffffff8082111561154457600080fd5b818501915085601f83011261155857600080fd5b81358181111561156757600080fd5b86602082850101111561148757600080fd5b6000806000806060858703121561158f57600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156115b557600080fd5b818701915087601f8301126115c957600080fd5b8135818111156115d857600080fd5b8860208260061b85010111156115ed57600080fd5b95989497505060200194505050565b60006020828403121561160e57600080fd5b815180151581146113c557600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff84168152604060208201526000610dd160408301848661161e565b6040808252810183905260006060600585901b8301810190830186835b87811015611763577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086850301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18a360301811261171557600080fd5b8901602081810191359067ffffffffffffffff82111561173457600080fd5b81360383131561174357600080fd5b61174e87838561161e565b965094850194939093019250506001016116b4565b50505073ffffffffffffffffffffffffffffffffffffffff841660208401529050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261181f57600080fd5b83018035915067ffffffffffffffff82111561183a57600080fd5b60200191503681900382131561184f57600080fd5b9250929050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036118ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6040815260006118c960408301858761161e565b905073ffffffffffffffffffffffffffffffffffffffff83166020830152949350505050565b838152604060208083018290528282018490526000919085906060850184805b88811015611969578435611922816113cc565b73ffffffffffffffffffffffffffffffffffffffff1683528484013567ffffffffffffffff8116808214611954578384fd5b8486015250938501939185019160010161190f565b50909998505050505050505050565b80356020831015611249577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b6000602082840312156119c657600080fd5b815167ffffffffffffffff808211156119de57600080fd5b818401915084601f8301126119f257600080fd5b815181811115611a0457611a0461178c565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611a4a57611a4a61178c565b81604052828152876020848701011115611a6357600080fd5b611a74836020830160208801611344565b97965050505050505056fea164736f6c6343000810000a", + ABI: "[{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadVerification\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"ConfigDigestAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeManagerInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"VerifierAlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VerifierInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"VerifierNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessController\",\"type\":\"address\"}],\"name\":\"AccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeManager\",\"type\":\"address\"}],\"name\":\"FeeManagerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierUnset\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"initializeVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_accessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeManager\",\"outputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"name\":\"setAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"feeManager\",\"type\":\"address\"}],\"name\":\"setFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"currentConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"addressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"unsetVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"}],\"name\":\"verifyBulk\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"verifiedReports\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b5060405162001d3638038062001d36833981016040819052620000349162000193565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050600480546001600160a01b0319166001600160a01b03939093169290921790915550620001c5565b336001600160a01b03821603620001425760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001a657600080fd5b81516001600160a01b0381168114620001be57600080fd5b9392505050565b611b6180620001d56000396000f3fe6080604052600436106100dd5760003560e01c806394ba28461161007f578063f08391d811610059578063f08391d8146102be578063f2fde38b146102de578063f7e83aee146102fe578063f873a61c1461031157600080fd5b806394ba28461461022e578063b011b2471461025b578063eeb7b2481461027b57600080fd5b80636e914094116100bb5780636e914094146101ae57806379ba5097146101ce5780638c2a4d53146101e35780638da5cb5b1461020357600080fd5b8063181f5a77146100e257806338416b5b1461013a578063472d35b91461018c575b600080fd5b3480156100ee57600080fd5b5060408051808201909152601381527f566572696669657250726f787920312e312e300000000000000000000000000060208201525b60405161013191906113c3565b60405180910390f35b34801561014657600080fd5b506005546101679073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610131565b34801561019857600080fd5b506101ac6101a73660046113ff565b610331565b005b3480156101ba57600080fd5b506101ac6101c936600461141c565b6105a9565b3480156101da57600080fd5b506101ac61069a565b3480156101ef57600080fd5b506101ac6101fe3660046113ff565b610797565b34801561020f57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610167565b34801561023a57600080fd5b506004546101679073ffffffffffffffffffffffffffffffffffffffff1681565b34801561026757600080fd5b506101ac610276366004611435565b6109c8565b34801561028757600080fd5b5061016761029636600461141c565b60009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b3480156102ca57600080fd5b506101ac6102d93660046113ff565b610bee565b3480156102ea57600080fd5b506101ac6102f93660046113ff565b610c75565b61012461030c366004611501565b610c89565b61032461031f36600461156d565b610e43565b60405161013191906115ee565b6103396110a7565b73ffffffffffffffffffffffffffffffffffffffff8116610386576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527fdba45fe000000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015610410573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610434919061166e565b15806104eb57506040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f6c2f1a1700000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa1580156104c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e9919061166e565b155b15610522576040517f8238941900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f04628abcaa6b1674651352125cb94b65b289145bc2bc4d67720bb7d966372f0391015b60405180910390a15050565b6105b16110a7565b60008181526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610615576040517fb151802b000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b6000828152600360205260409081902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055517f11dc15c4b8ac2b183166cc8427e5385a5ece8308217a4217338c6a7614845c4c9061059d908490849091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60015473ffffffffffffffffffffffffffffffffffffffff16331461071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161060c565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b61079f6110a7565b8073ffffffffffffffffffffffffffffffffffffffff81166107ed576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f3d3ac1b500000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b919061166e565b6108d1576040517f75b0527a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff1615610949576040517f4e01ccfd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015260240161060c565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f1f2cd7c97f4d801b5efe26cc409617c1fd6c5ef786e79aacb90af40923e4e8e9910161059d565b600083815260036020526040902054839073ffffffffffffffffffffffffffffffffffffffff168015610a46576040517f375d1fe60000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff8216602482015260440161060c565b3360009081526002602052604090205460ff16610a8f576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260036020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790558215610ba75760055473ffffffffffffffffffffffffffffffffffffffff16610b1a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546040517ff65df96200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063f65df96290610b7490889088908890600401611690565b600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b505050505b6040805187815260208101879052338183015290517fbeb513e532542a562ac35699e7cd9ae7d198dcd3eee15bada6c857d28ceaddcf9181900360600190a1505050505050565b610bf66110a7565b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f953e92b1a6442e9c3242531154a3f6f6eb00b4e9c719ba8118fa6235e4ce89b6910161059d565b610c7d6110a7565b610c868161112a565b50565b60045460609073ffffffffffffffffffffffffffffffffffffffff168015801590610d4957506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf890610d069033906000903690600401611762565b602060405180830381865afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d47919061166e565b155b15610d80576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055473ffffffffffffffffffffffffffffffffffffffff168015610e2e576040517fdba45fe000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063dba45fe0903490610dfb908b908b908b908b90339060040161179b565b6000604051808303818588803b158015610e1457600080fd5b505af1158015610e28573d6000803e3d6000fd5b50505050505b610e38878761121f565b979650505050505050565b60045460609073ffffffffffffffffffffffffffffffffffffffff168015801590610f0357506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf890610ec09033906000903690600401611762565b602060405180830381865afa158015610edd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f01919061166e565b155b15610f3a576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055473ffffffffffffffffffffffffffffffffffffffff168015610fe8576040517f6c2f1a1700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636c2f1a17903490610fb5908b908b908b908b9033906004016117eb565b6000604051808303818588803b158015610fce57600080fd5b505af1158015610fe2573d6000803e3d6000fd5b50505050505b8567ffffffffffffffff811115611001576110016118fc565b60405190808252806020026020018201604052801561103457816020015b606081526020019060019003908161101f5790505b50925060005b8681101561109c5761106e8888838181106110575761105761192b565b9050602002810190611069919061195a565b61121f565b8482815181106110805761108061192b565b602002602001018190525080611095906119bf565b905061103a565b505050949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161060c565b565b3373ffffffffffffffffffffffffffffffffffffffff8216036111a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161060c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6060600061122d8385611a1e565b60008181526003602052604090205490915073ffffffffffffffffffffffffffffffffffffffff168061128f576040517fb151802b0000000000000000000000000000000000000000000000000000000081526004810183905260240161060c565b6040517f3d3ac1b500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690633d3ac1b5906112e590889088903390600401611a5a565b6000604051808303816000875af1158015611304573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261134a9190810190611a94565b925050505b92915050565b60005b83811015611370578181015183820152602001611358565b50506000910152565b60008151808452611391816020860160208601611355565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006113d66020830184611379565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c8657600080fd5b60006020828403121561141157600080fd5b81356113d6816113dd565b60006020828403121561142e57600080fd5b5035919050565b6000806000806060858703121561144b57600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561147157600080fd5b818701915087601f83011261148557600080fd5b81358181111561149457600080fd5b8860208260061b85010111156114a957600080fd5b95989497505060200194505050565b60008083601f8401126114ca57600080fd5b50813567ffffffffffffffff8111156114e257600080fd5b6020830191508360208285010111156114fa57600080fd5b9250929050565b6000806000806040858703121561151757600080fd5b843567ffffffffffffffff8082111561152f57600080fd5b61153b888389016114b8565b9096509450602087013591508082111561155457600080fd5b50611561878288016114b8565b95989497509550505050565b6000806000806040858703121561158357600080fd5b843567ffffffffffffffff8082111561159b57600080fd5b818701915087601f8301126115af57600080fd5b8135818111156115be57600080fd5b8860208260051b85010111156115d357600080fd5b60209283019650945090860135908082111561155457600080fd5b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611661577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088860301845261164f858351611379565b94509285019290850190600101611615565b5092979650505050505050565b60006020828403121561168057600080fd5b815180151581146113d657600080fd5b838152604060208083018290528282018490526000919085906060850184805b8881101561170a5784356116c3816113dd565b73ffffffffffffffffffffffffffffffffffffffff1683528484013567ffffffffffffffff81168082146116f5578384fd5b848601525093850193918501916001016116b0565b50909998505050505050505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff84168152604060208201526000611792604083018486611719565b95945050505050565b6060815260006117af606083018789611719565b82810360208401526117c2818688611719565b91505073ffffffffffffffffffffffffffffffffffffffff831660408301529695505050505050565b6060808252810185905260006080600587901b8301810190830188835b898110156118b7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8086850301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18c360301811261186957600080fd5b8b01602081810191359067ffffffffffffffff82111561188857600080fd5b81360383131561189757600080fd5b6118a2878385611719565b96509485019493909301925050600101611808565b50505082810360208401526118cd818688611719565b9150506118f2604083018473ffffffffffffffffffffffffffffffffffffffff169052565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261198f57600080fd5b83018035915067ffffffffffffffff8211156119aa57600080fd5b6020019150368190038213156114fa57600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a17577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b8035602083101561134f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b604081526000611a6e604083018587611719565b905073ffffffffffffffffffffffffffffffffffffffff83166020830152949350505050565b600060208284031215611aa657600080fd5b815167ffffffffffffffff80821115611abe57600080fd5b818401915084601f830112611ad257600080fd5b815181811115611ae457611ae46118fc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611b2a57611b2a6118fc565b81604052828152876020848701011115611b4357600080fd5b610e3883602083016020880161135556fea164736f6c6343000810000a", } var VerifierProxyABI = VerifierProxyMetaData.ABI @@ -370,28 +370,28 @@ func (_VerifierProxy *VerifierProxyTransactorSession) UnsetVerifier(configDigest return _VerifierProxy.Contract.UnsetVerifier(&_VerifierProxy.TransactOpts, configDigest) } -func (_VerifierProxy *VerifierProxyTransactor) Verify(opts *bind.TransactOpts, payload []byte) (*types.Transaction, error) { - return _VerifierProxy.contract.Transact(opts, "verify", payload) +func (_VerifierProxy *VerifierProxyTransactor) Verify(opts *bind.TransactOpts, payload []byte, feePayload []byte) (*types.Transaction, error) { + return _VerifierProxy.contract.Transact(opts, "verify", payload, feePayload) } -func (_VerifierProxy *VerifierProxySession) Verify(payload []byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload) +func (_VerifierProxy *VerifierProxySession) Verify(payload []byte, feePayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload, feePayload) } -func (_VerifierProxy *VerifierProxyTransactorSession) Verify(payload []byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload) +func (_VerifierProxy *VerifierProxyTransactorSession) Verify(payload []byte, feePayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload, feePayload) } -func (_VerifierProxy *VerifierProxyTransactor) VerifyBulk(opts *bind.TransactOpts, payloads [][]byte) (*types.Transaction, error) { - return _VerifierProxy.contract.Transact(opts, "verifyBulk", payloads) +func (_VerifierProxy *VerifierProxyTransactor) VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte) (*types.Transaction, error) { + return _VerifierProxy.contract.Transact(opts, "verifyBulk", payloads, feePayload) } -func (_VerifierProxy *VerifierProxySession) VerifyBulk(payloads [][]byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads) +func (_VerifierProxy *VerifierProxySession) VerifyBulk(payloads [][]byte, feePayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads, feePayload) } -func (_VerifierProxy *VerifierProxyTransactorSession) VerifyBulk(payloads [][]byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads) +func (_VerifierProxy *VerifierProxyTransactorSession) VerifyBulk(payloads [][]byte, feePayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads, feePayload) } type VerifierProxyAccessControllerSetIterator struct { @@ -1335,9 +1335,9 @@ type VerifierProxyInterface interface { UnsetVerifier(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) - Verify(opts *bind.TransactOpts, payload []byte) (*types.Transaction, error) + Verify(opts *bind.TransactOpts, payload []byte, feePayload []byte) (*types.Transaction, error) - VerifyBulk(opts *bind.TransactOpts, payloads [][]byte) (*types.Transaction, error) + VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte) (*types.Transaction, error) FilterAccessControllerSet(opts *bind.FilterOpts) (*VerifierProxyAccessControllerSetIterator, error) diff --git a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 47444d741d5..588f21654f4 100644 --- a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,9 +1,9 @@ GETH_VERSION: 1.12.0 errored_verifier: ../../../contracts/solc/v0.8.16/ErroredVerifier.abi ../../../contracts/solc/v0.8.16/ErroredVerifier.bin a1b88979c6b0b210677346df554ffc33992d6ebe24be5a244475bfb4d153155e exposed_verifier: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246 -fee_manager: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin 630d7dfa814579001a359e26d99ff9c1f76a6a6480b0140da91b9f20cc1ab8df +fee_manager: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin 14e1aca5c41bf899cec3c6d3f626642f786348c9d8746f78fe7c3e921d1c878e llo_feeds: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin cb71e018f67e49d7bc0e194c822204dfd59f79ff42e4fc8fd8ab63f3acd71361 llo_feeds_test: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246 reward_manager: ../../../contracts/solc/v0.8.16/RewardManager.abi ../../../contracts/solc/v0.8.16/RewardManager.bin ec52c851ffe7ed00e05a68dbb363b2e01d38088ac829988b611653b30d10ec97 verifier: ../../../contracts/solc/v0.8.16/Verifier.abi ../../../contracts/solc/v0.8.16/Verifier.bin 8f841ddd5e616fc1a8d6ac3d27ea9a383d958055237c90ecaf980f5cb3421e49 -verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin 92ad0416e999e9d55e4f00a8b7df616bb69ae27ce52994a6061598e95364d2cc +verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin ea00d5bea59a19066e36c2f9ec118e2eeb70536ea1862ba3cd1b88796d174ddd From 7c93caa48f99bbfdd06893643e6f17902f31a23b Mon Sep 17 00:00:00 2001 From: Austin Born Date: Thu, 14 Sep 2023 00:29:37 -0700 Subject: [PATCH 07/12] Update integration test interfaces --- integration-tests/contracts/contract_models.go | 4 ++-- integration-tests/contracts/ethereum_contracts.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/integration-tests/contracts/contract_models.go b/integration-tests/contracts/contract_models.go index 7bcddceae5e..6e600cb8a6d 100644 --- a/integration-tests/contracts/contract_models.go +++ b/integration-tests/contracts/contract_models.go @@ -375,6 +375,6 @@ type MercuryVerifier interface { type MercuryVerifierProxy interface { Address() string - Verify(signedReport []byte, value *big.Int) (*types.Transaction, error) - VerifyBulk(signedReports [][]byte, value *big.Int) (*types.Transaction, error) + Verify(signedReport []byte, feePayload []byte, value *big.Int) (*types.Transaction, error) + VerifyBulk(signedReports [][]byte, feePayload []byte, value *big.Int) (*types.Transaction, error) } diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index 763faecace7..f456e6f0db8 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -2257,7 +2257,7 @@ func (e *EthereumMercuryVerifier) Address() string { return e.address.Hex() } -func (e *EthereumMercuryVerifier) Verify(signedReport []byte, sender common.Address) error { +func (e *EthereumMercuryVerifier) Verify(signedReport []byte, feePayload []byte, sender common.Address) error { opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if err != nil { return err @@ -2279,7 +2279,7 @@ func (e *EthereumMercuryVerifierProxy) Address() string { return e.address.Hex() } -func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, value *big.Int) (*types.Transaction, error) { +func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, feePayload []byte, value *big.Int) (*types.Transaction, error) { opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if value != nil { opts.Value = value @@ -2287,14 +2287,14 @@ func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, value *big.In if err != nil { return nil, err } - tx, err := e.instance.Verify(opts, signedReport) + tx, err := e.instance.Verify(opts, feePayload, signedReport) if err != nil { return nil, err } return tx, e.client.ProcessTransaction(tx) } -func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, value *big.Int) (*types.Transaction, error) { +func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, feePayload []byte, value *big.Int) (*types.Transaction, error) { opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if value != nil { opts.Value = value @@ -2302,7 +2302,7 @@ func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, value if err != nil { return nil, err } - tx, err := e.instance.VerifyBulk(opts, signedReports) + tx, err := e.instance.VerifyBulk(opts, signedReports, feePayload) if err != nil { return nil, err } From 8f57dcdb410183b671c14cd40e1e45f28476b297 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Thu, 14 Sep 2023 00:32:24 -0700 Subject: [PATCH 08/12] Prettify --- .../src/v0.8/llo-feeds/VerifierProxy.sol | 10 ++++-- .../src/v0.8/llo-feeds/dev/FeeManager.sol | 18 ++++++++-- .../llo-feeds/interfaces/IVerifierProxy.sol | 10 ++++-- .../test/fee-manager/BaseFeeManager.t.sol | 34 ++++++------------- .../fee-manager/FeeManager.processFee.t.sol | 2 +- .../test/verifier/BaseVerifierTest.t.sol | 7 +++- .../verifier/VerifierTestBillingReport.t.sol | 2 +- .../test/verifier/VerifierVerifyTest.t.sol | 6 +++- .../contracts/ethereum_contracts.go | 2 +- 9 files changed, 55 insertions(+), 36 deletions(-) diff --git a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol index a8ff8eced6b..40ec99594bf 100644 --- a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol @@ -121,7 +121,10 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac } /// @inheritdoc IVerifierProxy - function verify(bytes calldata payload, bytes calldata feePayload) external payable checkAccess returns (bytes memory) { + function verify( + bytes calldata payload, + bytes calldata feePayload + ) external payable checkAccess returns (bytes memory) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier @@ -133,7 +136,10 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac } /// @inheritdoc IVerifierProxy - function verifyBulk(bytes[] calldata payloads, bytes calldata feePayload) external payable checkAccess returns (bytes[] memory verifiedReports) { + function verifyBulk( + bytes[] calldata payloads, + bytes calldata feePayload + ) external payable checkAccess returns (bytes[] memory verifiedReports) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier diff --git a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol index d78acc8935d..1b8e5fc5c42 100644 --- a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol @@ -169,8 +169,16 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } /// @inheritdoc IVerifierFeeManager - function processFee(bytes calldata payload, bytes calldata feePayload, address subscriber) external payable override onlyProxy { - (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(payload, feePayload, subscriber); + function processFee( + bytes calldata payload, + bytes calldata feePayload, + address subscriber + ) external payable override onlyProxy { + (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee( + payload, + feePayload, + subscriber + ); if (fee.amount == 0) { _tryReturnChange(subscriber, msg.value); @@ -188,7 +196,11 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { } /// @inheritdoc IVerifierFeeManager - function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload, address subscriber) external payable override onlyProxy { + function processFeeBulk( + bytes[] calldata payloads, + bytes calldata feePayload, + address subscriber + ) external payable override onlyProxy { FeeAndReward[] memory feesAndRewards = new IFeeManager.FeeAndReward[](payloads.length); //keep track of the number of fees to prevent over initialising the FeePayment array within _convertToLinkAndNativeFees diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol index 3eabbdd5ed6..02192bd0f31 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol @@ -14,7 +14,10 @@ interface IVerifierProxy { * @param feePayload fee metadata for billing * @return verifierResponse The encoded report from the verifier. */ - function verify(bytes calldata payload, bytes calldata feePayload) external payable returns (bytes memory verifierResponse); + function verify( + bytes calldata payload, + bytes calldata feePayload + ) external payable returns (bytes memory verifierResponse); /** * @notice Bulk verifies that the data encoded has been signed @@ -24,7 +27,10 @@ interface IVerifierProxy { * @param feePayload fee metadata for billing * @return verifiedReports The encoded reports from the verifier. */ - function verifyBulk(bytes[] calldata payloads, bytes calldata feePayload) external payable returns (bytes[] memory verifiedReports); + function verifyBulk( + bytes[] calldata payloads, + bytes calldata feePayload + ) external payable returns (bytes[] memory verifiedReports); /** * @notice Sets the verifier address initially, allowing `setVerifier` to be set by this Verifier in the future diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol index a0d38cc9943..4f06d2c5ed0 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol @@ -154,33 +154,21 @@ contract BaseFeeManagerTest is Test { } // solium-disable-next-line no-unused-vars - function getFee( - bytes memory report, - address quote, - address subscriber - ) public view returns (Common.Asset memory) { + function getFee(bytes memory report, address quote, address subscriber) public view returns (Common.Asset memory) { //get the fee (Common.Asset memory fee, , ) = feeManager.getFeeAndReward(subscriber, report, quote); return fee; } - function getReward( - bytes memory report, - address quote, - address subscriber - ) public view returns (Common.Asset memory) { + function getReward(bytes memory report, address quote, address subscriber) public view returns (Common.Asset memory) { //get the reward (, Common.Asset memory reward, ) = feeManager.getFeeAndReward(subscriber, report, quote); return reward; } - function getAppliedDiscount( - bytes memory report, - address quote, - address subscriber - ) public view returns (uint256) { + function getAppliedDiscount(bytes memory report, address quote, address subscriber) public view returns (uint256) { //get the reward (, , uint256 appliedDiscount) = feeManager.getFeeAndReward(subscriber, report, quote); @@ -329,7 +317,12 @@ contract BaseFeeManagerTest is Test { changePrank(originalAddr); } - function processFee(bytes[] memory payloads, address subscriber, address feeAddress, uint256 wrappedNativeValue) public { + function processFee( + bytes[] memory payloads, + address subscriber, + address feeAddress, + uint256 wrappedNativeValue + ) public { //record the current address and switch to the recipient address originalAddr = msg.sender; changePrank(subscriber); @@ -342,14 +335,7 @@ contract BaseFeeManagerTest is Test { } function getPayload(bytes memory reportPayload) public pure returns (bytes memory) { - return - abi.encode( - [DEFAULT_CONFIG_DIGEST, 0, 0], - reportPayload, - new bytes32[](1), - new bytes32[](1), - bytes32("") - ); + return abi.encode([DEFAULT_CONFIG_DIGEST, 0, 0], reportPayload, new bytes32[](1), new bytes32[](1), bytes32("")); } function approveLink(address spender, uint256 quantity, address sender) public { diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol index 6522cc15a8d..2f1faf93da3 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol @@ -100,7 +100,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); //processing the fee will transfer the link from the user to the rewardManager - processFee(payload, USER, address(0), 0); + processFee(payload, USER, address(0), 0); } function test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol index ab84703fc61..758aae59dbf 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol @@ -412,7 +412,12 @@ contract BaseTestWithConfiguredVerifierAndFeeManager is BaseTest { changePrank(originalAddr); } - function _verifyBulk(bytes[] memory payload, address feeAddress, uint256 wrappedNativeValue, address sender) internal { + function _verifyBulk( + bytes[] memory payload, + address feeAddress, + uint256 wrappedNativeValue, + address sender + ) internal { address originalAddr = msg.sender; changePrank(sender); diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol index daa264d4bdb..fffa291b0d8 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol @@ -177,7 +177,7 @@ contract VerifierBulkVerifyBillingReport is VerifierTestWithConfiguredVerifierAn signedReports[1] = signedReportV3; signedReports[2] = signedReportV3; - _approveLink(address(rewardManager), 2* DEFAULT_REPORT_LINK_FEE, USER); + _approveLink(address(rewardManager), 2 * DEFAULT_REPORT_LINK_FEE, USER); _verifyBulk(signedReports, address(link), 0, USER); diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol index 8d770163e00..b4fcac75d3a 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol @@ -155,7 +155,11 @@ contract VerifierVerifySingleConfigDigestTest is VerifierVerifyTest { function test_revertsIfConfigDigestNotSet() public { bytes32[3] memory reportContext = s_reportContext; reportContext[0] = bytes32("wrong-context-digest"); - bytes memory signedReport = _generateV1EncodedBlob(s_testReportOne, reportContext, _getSigners(FAULT_TOLERANCE + 1)); + bytes memory signedReport = _generateV1EncodedBlob( + s_testReportOne, + reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); vm.expectRevert(abi.encodeWithSelector(Verifier.DigestInactive.selector, FEED_ID, reportContext[0])); changePrank(address(s_verifierProxy)); s_verifier.verify(signedReport, msg.sender); diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index f456e6f0db8..9e5569dbd53 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -2257,7 +2257,7 @@ func (e *EthereumMercuryVerifier) Address() string { return e.address.Hex() } -func (e *EthereumMercuryVerifier) Verify(signedReport []byte, feePayload []byte, sender common.Address) error { +func (e *EthereumMercuryVerifier) Verify(signedReport []byte, sender common.Address) error { opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if err != nil { return err From 3bc65f8d38b13f9e2014e0ff4ac8fc4ab5504fcf Mon Sep 17 00:00:00 2001 From: Austin Born Date: Thu, 14 Sep 2023 08:50:39 -0700 Subject: [PATCH 09/12] Update snapshot --- .../gas-snapshots/llo-feeds.gas-snapshot | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/contracts/gas-snapshots/llo-feeds.gas-snapshot b/contracts/gas-snapshots/llo-feeds.gas-snapshot index cbad9688cfd..01abad5c248 100644 --- a/contracts/gas-snapshots/llo-feeds.gas-snapshot +++ b/contracts/gas-snapshots/llo-feeds.gas-snapshot @@ -20,7 +20,7 @@ FeeManagerProcessFeeTest:test_discountIsNoLongerAppliedAfterRemoving() (gas: 459 FeeManagerProcessFeeTest:test_discountIsNotAppliedForInvalidTokenAddress() (gas: 17546) FeeManagerProcessFeeTest:test_discountIsNotAppliedToOtherFeeds() (gas: 54241) FeeManagerProcessFeeTest:test_discountIsReturnedForLink() (gas: 49252) -FeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 12152) +FeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 11286) FeeManagerProcessFeeTest:test_eventIsEmittedAfterSurchargeIsSet() (gas: 41348) FeeManagerProcessFeeTest:test_eventIsEmittedIfNotEnoughLink() (gas: 172711) FeeManagerProcessFeeTest:test_eventIsEmittedUponWithdraw() (gas: 68984) @@ -87,7 +87,7 @@ FeeManagerProcessFeeTest:test_surchargeIsAppliedForNativeFeeWithDiscount() (gas: FeeManagerProcessFeeTest:test_surchargeIsNoLongerAppliedAfterRemoving() (gas: 46503) FeeManagerProcessFeeTest:test_surchargeIsNotAppliedForLinkFee() (gas: 49585) FeeManagerProcessFeeTest:test_surchargeIsNotAppliedWith100PercentDiscount() (gas: 77890) -FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14908) +FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14042) RewardManagerClaimTest:test_claimAllRecipients() (gas: 275763) RewardManagerClaimTest:test_claimMultipleRecipients() (gas: 153306) RewardManagerClaimTest:test_claimRewardsWithDuplicatePoolIdsDoesNotPayoutTwice() (gas: 328345) @@ -123,7 +123,7 @@ RewardManagerRecipientClaimMultiplePoolsTest:test_claimSingleUniqueRecipient() ( RewardManagerRecipientClaimMultiplePoolsTest:test_claimUnevenAmountRoundsDown() (gas: 576289) RewardManagerRecipientClaimMultiplePoolsTest:test_claimUnregisteredRecipient() (gas: 63555) RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorAndTotalPoolsEqual() (gas: 10202) -RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorCannotBeGreaterThanTotalPools() (gas: 12680) +RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorCannotBeGreaterThanTotalPools() (gas: 11107) RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorSingleResult() (gas: 19606) RewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInBothPools() (gas: 29052) RewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInBothPoolsWhereAlreadyClaimed() (gas: 147218) @@ -189,11 +189,11 @@ VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange( VerifierConstructorTest:test_revertsIfInitializedWithEmptyVerifierProxy() (gas: 59939) VerifierConstructorTest:test_setsTheCorrectProperties() (gas: 1788491) VerifierDeactivateFeedWithVerifyTest:test_currentReportAllowsVerification() (gas: 192062) -VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 113377) +VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 111727) VerifierDeactivateFeedWithVerifyTest:test_previousReportAllowsVerification() (gas: 99613) -VerifierDeactivateFeedWithVerifyTest:test_previousReportFailsVerification() (gas: 69932) +VerifierDeactivateFeedWithVerifyTest:test_previousReportFailsVerification() (gas: 68305) VerifierProxyAccessControlledVerificationTest:test_proxiesToTheVerifierIfHasAccess() (gas: 205796) -VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 112334) +VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 110688) VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1482522) VerifierProxyConstructorTest:test_correctlySetsTheOwner() (gas: 1462646) VerifierProxyConstructorTest:test_correctlySetsVersion() (gas: 6873) @@ -215,7 +215,7 @@ VerifierProxyUnsetVerifierTest:test_revertsIfNotAdmin() (gas: 14965) VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVerifier() (gas: 12720) VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_emitsAnEventAfterUnsettingVerifier() (gas: 17965) VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 201609) -VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 117256) +VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 115615) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538605) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964140) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520186) @@ -238,17 +238,17 @@ VerifierTestBillingReport:test_verifyWithNativeUnwrapped() (gas: 317892) VerifierTestBillingReport:test_verifyWithNativeUnwrappedReturnsChange() (gas: 324958) VerifierVerifyMultipleConfigDigestTest:test_canVerifyNewerReportsWithNewerConfigs() (gas: 131228) VerifierVerifyMultipleConfigDigestTest:test_canVerifyOlderReportsWithOlderConfigs() (gas: 187132) -VerifierVerifyMultipleConfigDigestTest:test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() (gas: 88205) -VerifierVerifyMultipleConfigDigestTest:test_revertsIfVerifyingWithAnUnsetDigest() (gas: 128062) +VerifierVerifyMultipleConfigDigestTest:test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() (gas: 86566) +VerifierVerifyMultipleConfigDigestTest:test_revertsIfVerifyingWithAnUnsetDigest() (gas: 126411) VerifierVerifySingleConfigDigestTest:test_emitsAnEventIfReportVerified() (gas: 186945) VerifierVerifySingleConfigDigestTest:test_returnsThePriceAndBlockNumIfReportVerified() (gas: 187114) -VerifierVerifySingleConfigDigestTest:test_revertsIfConfigDigestNotSet() (gas: 116130) -VerifierVerifySingleConfigDigestTest:test_revertsIfDuplicateSignersHaveSigned() (gas: 182315) -VerifierVerifySingleConfigDigestTest:test_revertsIfMismatchedSignatureLength() (gas: 53037) -VerifierVerifySingleConfigDigestTest:test_revertsIfReportHasUnconfiguredFeedID() (gas: 103976) -VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedByNonProxy() (gas: 100992) -VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedWithIncorrectAddresses() (gas: 184066) -VerifierVerifySingleConfigDigestTest:test_revertsIfWrongNumberOfSigners() (gas: 110031) +VerifierVerifySingleConfigDigestTest:test_revertsIfConfigDigestNotSet() (gas: 114479) +VerifierVerifySingleConfigDigestTest:test_revertsIfDuplicateSignersHaveSigned() (gas: 180665) +VerifierVerifySingleConfigDigestTest:test_revertsIfMismatchedSignatureLength() (gas: 51479) +VerifierVerifySingleConfigDigestTest:test_revertsIfReportHasUnconfiguredFeedID() (gas: 102318) +VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedByNonProxy() (gas: 99348) +VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedWithIncorrectAddresses() (gas: 182416) +VerifierVerifySingleConfigDigestTest:test_revertsIfWrongNumberOfSigners() (gas: 108382) VerifierVerifySingleConfigDigestTest:test_setsTheCorrectEpoch() (gas: 194270) Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 212066) Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 519368) From 280acd00c8b74252f846fd517ee28eddb84339ab Mon Sep 17 00:00:00 2001 From: Austin Born Date: Tue, 19 Sep 2023 10:57:58 -0700 Subject: [PATCH 10/12] Change second parameter name to parameterPayload --- .../src/v0.8/llo-feeds/VerifierProxy.sol | 8 ++--- .../src/v0.8/llo-feeds/dev/FeeManager.sol | 12 ++++---- .../dev/interfaces/IVerifierFeeManager.sol | 8 ++--- .../llo-feeds/interfaces/IVerifierProxy.sol | 8 ++--- .../llo-feeds/test/mocks/FeeManagerProxy.sol | 8 ++--- .../generated/fee_manager/fee_manager.go | 30 +++++++++---------- .../verifier_proxy/verifier_proxy.go | 30 +++++++++---------- ...rapper-dependency-versions-do-not-edit.txt | 4 +-- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol index 40ec99594bf..ed5acc2f4ee 100644 --- a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/VerifierProxy.sol @@ -123,13 +123,13 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac /// @inheritdoc IVerifierProxy function verify( bytes calldata payload, - bytes calldata feePayload + bytes calldata parameterPayload ) external payable checkAccess returns (bytes memory) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier if (address(feeManager) != address(0)) { - feeManager.processFee{value: msg.value}(payload, feePayload, msg.sender); + feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender); } return _verify(payload); @@ -138,13 +138,13 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac /// @inheritdoc IVerifierProxy function verifyBulk( bytes[] calldata payloads, - bytes calldata feePayload + bytes calldata parameterPayload ) external payable checkAccess returns (bytes[] memory verifiedReports) { IVerifierFeeManager feeManager = s_feeManager; // Bill the verifier if (address(feeManager) != address(0)) { - feeManager.processFeeBulk{value: msg.value}(payloads, feePayload, msg.sender); + feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender); } //verify the reports diff --git a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol index 1b8e5fc5c42..1b229d5bf92 100644 --- a/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/FeeManager.sol @@ -171,12 +171,12 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { /// @inheritdoc IVerifierFeeManager function processFee( bytes calldata payload, - bytes calldata feePayload, + bytes calldata parameterPayload, address subscriber ) external payable override onlyProxy { (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee( payload, - feePayload, + parameterPayload, subscriber ); @@ -198,7 +198,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { /// @inheritdoc IVerifierFeeManager function processFeeBulk( bytes[] calldata payloads, - bytes calldata feePayload, + bytes calldata parameterPayload, address subscriber ) external payable override onlyProxy { FeeAndReward[] memory feesAndRewards = new IFeeManager.FeeAndReward[](payloads.length); @@ -211,7 +211,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { for (uint256 i; i < payloads.length; ++i) { (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee( payloads[i], - feePayload, + parameterPayload, subscriber ); @@ -371,7 +371,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { function _processFee( bytes calldata payload, - bytes calldata quotePayload, + bytes calldata parameterPayload, address subscriber ) internal view returns (Common.Asset memory, Common.Asset memory, uint256) { if (subscriber == address(this)) revert InvalidAddress(); @@ -386,7 +386,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface { address quote; if (_getReportVersion(feedId) != REPORT_V1) { //decode the quote from the bytes - (quote) = abi.decode(quotePayload, (address)); + (quote) = abi.decode(parameterPayload, (address)); } //decode the fee, it will always be native or LINK diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol index 46dba4e8a20..2fc7d8088bd 100644 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol @@ -8,18 +8,18 @@ interface IVerifierFeeManager is IERC165 { /** * @notice Handles fees for a report from the subscriber and manages rewards * @param payload report to process the fee for - * @param feePayload fee payload + * @param parameterPayload fee payload * @param subscriber address of the fee will be applied */ - function processFee(bytes calldata payload, bytes calldata feePayload, address subscriber) external payable; + function processFee(bytes calldata payload, bytes calldata parameterPayload, address subscriber) external payable; /** * @notice Processes the fees for each report in the payload, billing the subscriber and paying the reward manager * @param payloads reports to process - * @param feePayload fee payload + * @param parameterPayload fee payload * @param subscriber address of the user to process fee for */ - function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload, address subscriber) external payable; + function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload, address subscriber) external payable; /** * @notice Sets the fee recipients according to the fee manager diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol index 02192bd0f31..2cad538bd12 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol @@ -11,12 +11,12 @@ interface IVerifierProxy { * correctly by routing to the correct verifier, and bills the user if applicable. * @param payload The encoded data to be verified, including the signed * report. - * @param feePayload fee metadata for billing + * @param parameterPayload fee metadata for billing * @return verifierResponse The encoded report from the verifier. */ function verify( bytes calldata payload, - bytes calldata feePayload + bytes calldata parameterPayload ) external payable returns (bytes memory verifierResponse); /** @@ -24,12 +24,12 @@ interface IVerifierProxy { * correctly by routing to the correct verifier, and bills the user if applicable. * @param payloads The encoded payloads to be verified, including the signed * report. - * @param feePayload fee metadata for billing + * @param parameterPayload fee metadata for billing * @return verifiedReports The encoded reports from the verifier. */ function verifyBulk( bytes[] calldata payloads, - bytes calldata feePayload + bytes calldata parameterPayload ) external payable returns (bytes[] memory verifiedReports); /** diff --git a/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol b/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol index 6873a05a601..0d629e8c592 100644 --- a/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol +++ b/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol @@ -6,12 +6,12 @@ import "../../dev/interfaces/IFeeManager.sol"; contract FeeManagerProxy { IFeeManager internal i_feeManager; - function processFee(bytes calldata payload, bytes calldata feePayload) public payable { - i_feeManager.processFee{value: msg.value}(payload, feePayload, msg.sender); + function processFee(bytes calldata payload, bytes calldata parameterPayload) public payable { + i_feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender); } - function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload) public payable { - i_feeManager.processFeeBulk{value: msg.value}(payloads, feePayload, msg.sender); + function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload) public payable { + i_feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender); } function setFeeManager(IFeeManager feeManager) public { diff --git a/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go b/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go index b8cb33c2d4c..76ace812c08 100644 --- a/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go +++ b/core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go @@ -46,7 +46,7 @@ type IRewardManagerFeePayment struct { } var FeeManagerMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_linkAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_nativeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_rewardManagerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ExpiredReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDiscount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQuote\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReceivingAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSurcharge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroDeficit\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"fee\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"reward\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"appliedDiscount\",\"type\":\"uint256\"}],\"name\":\"DiscountApplied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"indexed\":false,\"internalType\":\"structIRewardManager.FeePayment[]\",\"name\":\"rewards\",\"type\":\"tuple[]\"}],\"name\":\"InsufficientLink\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"linkQuantity\",\"type\":\"uint256\"}],\"name\":\"LinkDeficitCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSurcharge\",\"type\":\"uint64\"}],\"name\":\"NativeSurchargeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"SubscriberDiscountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"quoteAddress\",\"type\":\"address\"}],\"name\":\"getFeeAndReward\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_nativeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_proxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_rewardManager\",\"outputs\":[{\"internalType\":\"contractIRewardManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"payLinkDeficit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFeeBulk\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_linkDeficit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nativeSurcharge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_subscriberDiscounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"rewardRecipientAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"surcharge\",\"type\":\"uint64\"}],\"name\":\"setNativeSurcharge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"updateSubscriberDiscount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_linkAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_nativeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_rewardManagerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ExpiredReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDiscount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQuote\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReceivingAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSurcharge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroDeficit\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"fee\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"reward\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"appliedDiscount\",\"type\":\"uint256\"}],\"name\":\"DiscountApplied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"indexed\":false,\"internalType\":\"structIRewardManager.FeePayment[]\",\"name\":\"rewards\",\"type\":\"tuple[]\"}],\"name\":\"InsufficientLink\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"linkQuantity\",\"type\":\"uint256\"}],\"name\":\"LinkDeficitCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSurcharge\",\"type\":\"uint64\"}],\"name\":\"NativeSurchargeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"SubscriberDiscountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"quoteAddress\",\"type\":\"address\"}],\"name\":\"getFeeAndReward\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_nativeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_proxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_rewardManager\",\"outputs\":[{\"internalType\":\"contractIRewardManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"payLinkDeficit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFeeBulk\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_linkDeficit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nativeSurcharge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_subscriberDiscounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"rewardRecipientAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"surcharge\",\"type\":\"uint64\"}],\"name\":\"setNativeSurcharge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"updateSubscriberDiscount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x6101006040523480156200001257600080fd5b506040516200349938038062003499833981016040819052620000359162000288565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001c0565b5050506001600160a01b0384161580620000e057506001600160a01b038316155b80620000f357506001600160a01b038216155b806200010657506001600160a01b038116155b15620001255760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03848116608081905284821660a05283821660c05290821660e081905260405163095ea7b360e01b81526004810191909152600019602482015263095ea7b3906044016020604051808303816000875af11580156200018f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b59190620002e5565b505050505062000310565b336001600160a01b038216036200021a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200028357600080fd5b919050565b600080600080608085870312156200029f57600080fd5b620002aa856200026b565b9350620002ba602086016200026b565b9250620002ca604086016200026b565b9150620002da606086016200026b565b905092959194509250565b600060208284031215620002f857600080fd5b815180151581146200030957600080fd5b9392505050565b60805160a05160c05160e0516130a7620003f26000396000818161027501528181611462015281816115f001528181611e0b0152612059015260008181610335015281816107fb01528181610db601526115360152600081816102ee01528181610bd901528181610fd30152818161102a015281816112d701528181611d310152611dda0152600081816104ba0152818161097601528181610b8201528181610d1901528181610ec201528181610ff801528181611081015281816111c60152818161123301528181611273015281816119ac0152611ecc01526130a76000f3fe60806040526004361061016a5760003560e01c806379ba5097116100cb578063dba45fe01161007f578063ea4b861b11610059578063ea4b861b146104a8578063f2fde38b146104dc578063f65df962146104fc57600080fd5b8063dba45fe01461040a578063e03dab1a1461041d578063e389d9a41461048857600080fd5b80638da5cb5b116100b05780638da5cb5b146103aa578063ce7817d1146103d5578063d09dc339146103f557600080fd5b806379ba50971461035757806387d6d8431461036c57600080fd5b80633aa5ac0711610122578063638786681161010757806363878668146102dc5780636c2f1a17146103105780636d1342cb1461032357600080fd5b80633aa5ac071461026357806350538094146102bc57600080fd5b8063181f5a7711610153578063181f5a77146101df5780631d4d84a21461022b57806332f5f7461461024d57600080fd5b8063013f542b1461016f57806301ffc9a7146101af575b600080fd5b34801561017b57600080fd5b5061019c61018a36600461265b565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101bb57600080fd5b506101cf6101ca366004612674565b61051c565b60405190151581526020016101a6565b3480156101eb57600080fd5b50604080518082018252601081527f4665654d616e6167657220312e302e3000000000000000000000000000000000602082015290516101a691906126da565b34801561023757600080fd5b5061024b610246366004612783565b6105b5565b005b34801561025957600080fd5b5061019c60045481565b34801561026f57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a6565b3480156102c857600080fd5b5061024b6102d73660046127e6565b610749565b3480156102e857600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b61024b61031e36600461284a565b6107e3565b34801561032f57600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b34801561036357600080fd5b5061024b610a2a565b34801561037857600080fd5b5061019c6103873660046128f9565b600260209081526000938452604080852082529284528284209052825290205481565b3480156103b657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610297565b3480156103e157600080fd5b5061024b6103f0366004612930565b610b2c565b34801561040157600080fd5b5061019c610ce8565b61024b610418366004612981565b610d9e565b34801561042957600080fd5b5061043d610438366004612adf565b610f3a565b60408051845173ffffffffffffffffffffffffffffffffffffffff9081168252602095860151868301528451169181019190915292909101516060830152608082015260a0016101a6565b34801561049457600080fd5b5061024b6104a336600461265b565b611339565b3480156104b457600080fd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e857600080fd5b5061024b6104f7366004612b38565b61150a565b34801561050857600080fd5b5061024b610517366004612b55565b61151e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fdba45fe00000000000000000000000000000000000000000000000000000000014806105af57507fffffffff0000000000000000000000000000000000000000000000000000000082167f6c2f1a1700000000000000000000000000000000000000000000000000000000145b92915050565b6105bd611660565b73ffffffffffffffffffffffffffffffffffffffff83166106925760008273ffffffffffffffffffffffffffffffffffffffff168277ffffffffffffffffffffffffffffffffffffffffffffffff1660405160006040518083038185875af1925050503d806000811461064c576040519150601f19603f3d011682016040523d82523d6000602084013e610651565b606091505b505090508061068c576040517fef2af20100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6106cd73ffffffffffffffffffffffffffffffffffffffff84168377ffffffffffffffffffffffffffffffffffffffffffffffff84166116e3565b6040805133815273ffffffffffffffffffffffffffffffffffffffff848116602083015285168183015277ffffffffffffffffffffffffffffffffffffffffffffffff8316606082015290517f7ff78a71698bdb18dcca96f52ab25e0a1b146fb6a49adf8e6845299e49021f299181900360800190a15b505050565b610751611660565b670de0b6b3a764000067ffffffffffffffff8216111561079d576040517f05e8ac2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660048190556040519081527f08f7c0d17932ddb8523bc06754d42ff19ebc77d76a8b9bfde02c28ab1ed3d6399060200160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610852576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008467ffffffffffffffff81111561086d5761086d612a05565b6040519080825280602002602001820160405280156108a657816020015b6108936125ce565b81526020019060019003908161088b5790505b5090506000806000805b888110156109f15760008060006108ec8d8d868181106108d2576108d2612bd4565b90506020028101906108e49190612c03565b8d8d8d6117b7565b92509250925082602001516000146109dd5760405180608001604052808e8e8781811061091b5761091b612bd4565b905060200281019061092d9190612c03565b61093691612c68565b81526020018481526020018381526020018281525088868061095790612cd3565b97508151811061096957610969612bd4565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff16036109d6578660010196506109dd565b8560010195505b505050806109ea90612cd3565b90506108b0565b50821515806109ff57508115155b15610a1557610a10858585856118c7565b610a1f565b610a1f85346120db565b505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ab0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b34611660565b670de0b6b3a764000067ffffffffffffffff82161115610b80576040517f997ea36000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015610c2857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15610c5f576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff848116600081815260026020908152604080832088845282528083209487168084529482529182902067ffffffffffffffff86169081905582519485529084015285927f5eba5a8afa39780f0f99b6cbeb95f3da6a7040ca00abd46bdc91a0a060134139910160405180910390a350505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190612d0b565b905090565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610e0d576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000610e1f88888888886117b7565b9250925092508260200151600003610e4357610e3b84346120db565b505050610f33565b604080516001808252818301909252600091816020015b610e626125ce565b815260200190600190039081610e5a575050604080516080810190915290915080610e8d8a8c612c68565b81526020018581526020018481526020018381525081600081518110610eb557610eb5612bd4565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff1603610f2557610a108582600160006118c7565b610a1f8582600060016118c7565b5050505050565b6040805180820182526000808252602080830182905283518085018552828152808201839052845180860186528381528083018490528551808701909652838652918501839052929382610f8d88612d24565b90507fffff00000000000000000000000000000000000000000000000000000000000080821690810161102857505073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811683527f0000000000000000000000000000000000000000000000000000000000000000168152909350915060009050611330565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141580156110d057507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614155b15611107576040517ff861803000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008b8060200190518101906111209190612d7d565b77ffffffffffffffffffffffffffffffffffffffffffffffff91821698509116955063ffffffff1693505050428210159050611188576040517fb6c405f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808e16600090815260026020908152604080832089845282528083208f851684529091529020547f000000000000000000000000000000000000000000000000000000000000000090911687526112176111ff82670de0b6b3a7640000612def565b6112099086612e02565b670de0b6b3a7640000612128565b602088015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116908d16036112a45773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016885260208088015190890152611321565b6004546000906112c0906111ff90670de0b6b3a7640000612e3f565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168a52905061131a61131083670de0b6b3a7640000612def565b6112099083612e02565b60208a0152505b96995094975094955050505050505b93509350939050565b611341611660565b6000818152600360205260408120549081900361138a576040517f03aad31200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600360205260408082208290558051600180825281830190925290816020015b60408051808201909152600080825260208201528152602001906001900390816113af57905050905060405180604001604052808481526020018377ffffffffffffffffffffffffffffffffffffffffffffffff168152508160008151811061141a5761141a612bd4565b60209081029190910101526040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b0d9fa19906114999084903090600401612eb2565b600060405180830381600087803b1580156114b357600080fd5b505af11580156114c7573d6000803e3d6000fd5b50505050827f843f0b103e50b42b08f9d30f12f961845a6d02623730872e24644899c0dd9895836040516114fd91815260200190565b60405180910390a2505050565b611512611660565b61151b81612160565b50565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480159061157c575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156115b3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f14060f2300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906314060f239061162990869086908690600401612eea565b600060405180830381600087803b15801561164357600080fd5b505af1158015611657573d6000803e3d6000fd5b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610aa7565b565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526107449084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612255565b6040805180820190915260008082526020820152604080518082019091526000808252602082015260003073ffffffffffffffffffffffffffffffffffffffff851603611830576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061183e888a018a612f6a565b91505060008161184d90612d24565b905060007e010000000000000000000000000000000000000000000000000000000000007fffff0000000000000000000000000000000000000000000000000000000000008316146118a8576118a5888a018a612b38565b90505b6118b3878483610f3a565b955095509550505050955095509592505050565b60008267ffffffffffffffff8111156118e2576118e2612a05565b60405190808252806020026020018201604052801561192757816020015b60408051808201909152600080825260208201528152602001906001900390816119005790505b50905060008267ffffffffffffffff81111561194557611945612a05565b60405190808252806020026020018201604052801561198a57816020015b60408051808201909152600080825260208201528152602001906001900390816119635790505b50905060008080808061199d888a612e3f565b905060005b81811015611cec577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168b82815181106119f3576119f3612bd4565b6020026020010151602001516000015173ffffffffffffffffffffffffffffffffffffffff1603611ab95760405180604001604052808c8381518110611a3b57611a3b612bd4565b60200260200101516000015181526020018c8381518110611a5e57611a5e612bd4565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250888580611a9790612cd3565b965081518110611aa957611aa9612bd4565b6020026020010181905250611bae565b60405180604001604052808c8381518110611ad657611ad6612bd4565b60200260200101516000015181526020018c8381518110611af957611af9612bd4565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250878480611b3290612cd3565b955081518110611b4457611b44612bd4565b60200260200101819052508a8181518110611b6157611b61612bd4565b6020026020010151602001516020015186611b7c9190612e3f565b95508a8181518110611b9057611b90612bd4565b6020026020010151604001516020015185611bab9190612e3f565b94505b8a8181518110611bc057611bc0612bd4565b602002602001015160600151600014611cdc578b73ffffffffffffffffffffffffffffffffffffffff168b8281518110611bfc57611bfc612bd4565b6020026020010151600001517f88b15eb682210089cddf967648e2cb2a4535aeadc8f8f36050922e33c04e71258d8481518110611c3b57611c3b612bd4565b6020026020010151602001518e8581518110611c5957611c59612bd4565b6020026020010151604001518f8681518110611c7757611c77612bd4565b602002602001015160600151604051611cd393929190835173ffffffffffffffffffffffffffffffffffffffff908116825260209485015185830152835116604082015291909201516060820152608081019190915260a00190565b60405180910390a35b611ce581612cd3565b90506119a2565b5060003415611dba5734861115611d2f576040517fb2e532de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0876040518263ffffffff1660e01b81526004016000604051808303818588803b158015611d9757600080fd5b505af1158015611dab573d6000803e3d6000fd5b50505050508534039050611e02565b8515611e0257611e0273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168d3089612361565b875115611e97577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b0d9fa19898e6040518363ffffffff1660e01b8152600401611e64929190612eb2565b600060405180830381600087803b158015611e7e57600080fd5b505af1158015611e92573d6000803e3d6000fd5b505050505b8651156120c3576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4c9190612d0b565b85111561201c5760005b8751811015611fdf57878181518110611f7157611f71612bd4565b60200260200101516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16600360008a8481518110611fad57611fad612bd4565b60209081029190910181015151825281019190915260400160002080549091019055611fd881612cd3565b9050611f56565b507ff52e5907b69d97c33392936c12d78b494463b78c5b72df50b4c497eee5720b678760405161200f919061300e565b60405180910390a16120c3565b6040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b0d9fa1990612090908a903090600401612eb2565b600060405180830381600087803b1580156120aa57600080fd5b505af11580156120be573d6000803e3d6000fd5b505050505b6120cd8c826120db565b505050505050505050505050565b80156121245760405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610744573d6000803e3d6000fd5b5050565b60008215612156578161213c600185612def565b6121469190613021565b612151906001612e3f565b612159565b60005b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036121df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610aa7565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006122b7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123bf9092919063ffffffff16565b80519091501561074457808060200190518101906122d5919061305c565b610744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610aa7565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261068c9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611735565b60606123ce84846000856123d6565b949350505050565b606082471015612468576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610aa7565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612491919061307e565b60006040518083038185875af1925050503d80600081146124ce576040519150601f19603f3d011682016040523d82523d6000602084013e6124d3565b606091505b50915091506124e4878383876124ef565b979650505050505050565b6060831561258557825160000361257e5773ffffffffffffffffffffffffffffffffffffffff85163b61257e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aa7565b50816123ce565b6123ce838381511561259a5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa791906126da565b6040518060800160405280600080191681526020016126166040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b815260200161264e6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b8152602001600081525090565b60006020828403121561266d57600080fd5b5035919050565b60006020828403121561268657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461215957600080fd5b60005b838110156126d15781810151838201526020016126b9565b50506000910152565b60208152600082518060208401526126f98160408501602087016126b6565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461151b57600080fd5b80356127588161272b565b919050565b77ffffffffffffffffffffffffffffffffffffffffffffffff8116811461151b57600080fd5b60008060006060848603121561279857600080fd5b83356127a38161272b565b925060208401356127b38161272b565b915060408401356127c38161275d565b809150509250925092565b803567ffffffffffffffff8116811461275857600080fd5b6000602082840312156127f857600080fd5b612159826127ce565b60008083601f84011261281357600080fd5b50813567ffffffffffffffff81111561282b57600080fd5b60208301915083602082850101111561284357600080fd5b9250929050565b60008060008060006060868803121561286257600080fd5b853567ffffffffffffffff8082111561287a57600080fd5b818801915088601f83011261288e57600080fd5b81358181111561289d57600080fd5b8960208260051b85010111156128b257600080fd5b6020928301975095509087013590808211156128cd57600080fd5b506128da88828901612801565b90945092506128ed90506040870161274d565b90509295509295909350565b60008060006060848603121561290e57600080fd5b83356129198161272b565b92506020840135915060408401356127c38161272b565b6000806000806080858703121561294657600080fd5b84356129518161272b565b93506020850135925060408501356129688161272b565b9150612976606086016127ce565b905092959194509250565b60008060008060006060868803121561299957600080fd5b853567ffffffffffffffff808211156129b157600080fd5b6129bd89838a01612801565b909750955060208801359150808211156129d657600080fd5b506129e388828901612801565b90945092505060408601356129f78161272b565b809150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112612a4557600080fd5b813567ffffffffffffffff80821115612a6057612a60612a05565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715612aa657612aa6612a05565b81604052838152866020858801011115612abf57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215612af457600080fd5b8335612aff8161272b565b9250602084013567ffffffffffffffff811115612b1b57600080fd5b612b2786828701612a34565b92505060408401356127c38161272b565b600060208284031215612b4a57600080fd5b81356121598161272b565b600080600060408486031215612b6a57600080fd5b83359250602084013567ffffffffffffffff80821115612b8957600080fd5b818601915086601f830112612b9d57600080fd5b813581811115612bac57600080fd5b8760208260061b8501011115612bc157600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c3857600080fd5b83018035915067ffffffffffffffff821115612c5357600080fd5b60200191503681900382131561284357600080fd5b803560208310156105af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d0457612d04612ca4565b5060010190565b600060208284031215612d1d57600080fd5b5051919050565b80516020808301519190811015612d63577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b805163ffffffff8116811461275857600080fd5b60008060008060008060c08789031215612d9657600080fd5b86519550612da660208801612d69565b9450612db460408801612d69565b93506060870151612dc48161275d565b6080880151909350612dd58161275d565b9150612de360a08801612d69565b90509295509295509295565b818103818111156105af576105af612ca4565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e3a57612e3a612ca4565b500290565b808201808211156105af576105af612ca4565b600081518084526020808501945080840160005b83811015612ea75781518051885283015177ffffffffffffffffffffffffffffffffffffffffffffffff168388015260409096019590820190600101612e66565b509495945050505050565b604081526000612ec56040830185612e52565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b8381526040602080830182905282820184905260009190859060608501845b87811015612f5d578335612f1c8161272b565b73ffffffffffffffffffffffffffffffffffffffff16825267ffffffffffffffff612f488585016127ce565b16828401529284019290840190600101612f09565b5098975050505050505050565b60008060808385031215612f7d57600080fd5b83601f840112612f8c57600080fd5b6040516060810167ffffffffffffffff8282108183111715612fb057612fb0612a05565b816040528291506060860187811115612fc857600080fd5b865b81811015612fe2578035845260209384019301612fca565b5092945091359180831115612ff657600080fd5b505061300485828601612a34565b9150509250929050565b6020815260006121596020830184612e52565b600082613057577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561306e57600080fd5b8151801515811461215957600080fd5b600082516130908184602087016126b6565b919091019291505056fea164736f6c6343000810000a", } @@ -476,28 +476,28 @@ func (_FeeManager *FeeManagerTransactorSession) PayLinkDeficit(configDigest [32] return _FeeManager.Contract.PayLinkDeficit(&_FeeManager.TransactOpts, configDigest) } -func (_FeeManager *FeeManagerTransactor) ProcessFee(opts *bind.TransactOpts, payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.contract.Transact(opts, "processFee", payload, feePayload, subscriber) +func (_FeeManager *FeeManagerTransactor) ProcessFee(opts *bind.TransactOpts, payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.contract.Transact(opts, "processFee", payload, parameterPayload, subscriber) } -func (_FeeManager *FeeManagerSession) ProcessFee(payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, feePayload, subscriber) +func (_FeeManager *FeeManagerSession) ProcessFee(payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, parameterPayload, subscriber) } -func (_FeeManager *FeeManagerTransactorSession) ProcessFee(payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, feePayload, subscriber) +func (_FeeManager *FeeManagerTransactorSession) ProcessFee(payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFee(&_FeeManager.TransactOpts, payload, parameterPayload, subscriber) } -func (_FeeManager *FeeManagerTransactor) ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.contract.Transact(opts, "processFeeBulk", payloads, feePayload, subscriber) +func (_FeeManager *FeeManagerTransactor) ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.contract.Transact(opts, "processFeeBulk", payloads, parameterPayload, subscriber) } -func (_FeeManager *FeeManagerSession) ProcessFeeBulk(payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, feePayload, subscriber) +func (_FeeManager *FeeManagerSession) ProcessFeeBulk(payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, parameterPayload, subscriber) } -func (_FeeManager *FeeManagerTransactorSession) ProcessFeeBulk(payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) { - return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, feePayload, subscriber) +func (_FeeManager *FeeManagerTransactorSession) ProcessFeeBulk(payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _FeeManager.Contract.ProcessFeeBulk(&_FeeManager.TransactOpts, payloads, parameterPayload, subscriber) } func (_FeeManager *FeeManagerTransactor) SetFeeRecipients(opts *bind.TransactOpts, configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { @@ -1680,9 +1680,9 @@ type FeeManagerInterface interface { PayLinkDeficit(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) - ProcessFee(opts *bind.TransactOpts, payload []byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) + ProcessFee(opts *bind.TransactOpts, payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) - ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte, subscriber common.Address) (*types.Transaction, error) + ProcessFeeBulk(opts *bind.TransactOpts, payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) SetFeeRecipients(opts *bind.TransactOpts, configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) diff --git a/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go b/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go index a63447a1484..30bb00e6a4a 100644 --- a/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go +++ b/core/gethwrappers/llo-feeds/generated/verifier_proxy/verifier_proxy.go @@ -36,7 +36,7 @@ type CommonAddressAndWeight struct { } var VerifierProxyMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadVerification\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"ConfigDigestAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeManagerInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"VerifierAlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VerifierInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"VerifierNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessController\",\"type\":\"address\"}],\"name\":\"AccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeManager\",\"type\":\"address\"}],\"name\":\"FeeManagerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierUnset\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"initializeVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_accessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeManager\",\"outputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"name\":\"setAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"feeManager\",\"type\":\"address\"}],\"name\":\"setFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"currentConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"addressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"unsetVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"feePayload\",\"type\":\"bytes\"}],\"name\":\"verifyBulk\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"verifiedReports\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadVerification\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"ConfigDigestAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeManagerInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"VerifierAlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VerifierInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"VerifierNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessController\",\"type\":\"address\"}],\"name\":\"AccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeManager\",\"type\":\"address\"}],\"name\":\"FeeManagerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierUnset\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"initializeVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_accessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeManager\",\"outputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"accessController\",\"type\":\"address\"}],\"name\":\"setAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIVerifierFeeManager\",\"name\":\"feeManager\",\"type\":\"address\"}],\"name\":\"setFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"currentConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"addressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"unsetVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"}],\"name\":\"verifyBulk\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"verifiedReports\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", Bin: "0x60806040523480156200001157600080fd5b5060405162001d3638038062001d36833981016040819052620000349162000193565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050600480546001600160a01b0319166001600160a01b03939093169290921790915550620001c5565b336001600160a01b03821603620001425760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001a657600080fd5b81516001600160a01b0381168114620001be57600080fd5b9392505050565b611b6180620001d56000396000f3fe6080604052600436106100dd5760003560e01c806394ba28461161007f578063f08391d811610059578063f08391d8146102be578063f2fde38b146102de578063f7e83aee146102fe578063f873a61c1461031157600080fd5b806394ba28461461022e578063b011b2471461025b578063eeb7b2481461027b57600080fd5b80636e914094116100bb5780636e914094146101ae57806379ba5097146101ce5780638c2a4d53146101e35780638da5cb5b1461020357600080fd5b8063181f5a77146100e257806338416b5b1461013a578063472d35b91461018c575b600080fd5b3480156100ee57600080fd5b5060408051808201909152601381527f566572696669657250726f787920312e312e300000000000000000000000000060208201525b60405161013191906113c3565b60405180910390f35b34801561014657600080fd5b506005546101679073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610131565b34801561019857600080fd5b506101ac6101a73660046113ff565b610331565b005b3480156101ba57600080fd5b506101ac6101c936600461141c565b6105a9565b3480156101da57600080fd5b506101ac61069a565b3480156101ef57600080fd5b506101ac6101fe3660046113ff565b610797565b34801561020f57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610167565b34801561023a57600080fd5b506004546101679073ffffffffffffffffffffffffffffffffffffffff1681565b34801561026757600080fd5b506101ac610276366004611435565b6109c8565b34801561028757600080fd5b5061016761029636600461141c565b60009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b3480156102ca57600080fd5b506101ac6102d93660046113ff565b610bee565b3480156102ea57600080fd5b506101ac6102f93660046113ff565b610c75565b61012461030c366004611501565b610c89565b61032461031f36600461156d565b610e43565b60405161013191906115ee565b6103396110a7565b73ffffffffffffffffffffffffffffffffffffffff8116610386576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527fdba45fe000000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015610410573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610434919061166e565b15806104eb57506040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f6c2f1a1700000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa1580156104c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e9919061166e565b155b15610522576040517f8238941900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f04628abcaa6b1674651352125cb94b65b289145bc2bc4d67720bb7d966372f0391015b60405180910390a15050565b6105b16110a7565b60008181526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610615576040517fb151802b000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b6000828152600360205260409081902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055517f11dc15c4b8ac2b183166cc8427e5385a5ece8308217a4217338c6a7614845c4c9061059d908490849091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60015473ffffffffffffffffffffffffffffffffffffffff16331461071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161060c565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b61079f6110a7565b8073ffffffffffffffffffffffffffffffffffffffff81166107ed576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f3d3ac1b500000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b919061166e565b6108d1576040517f75b0527a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff1615610949576040517f4e01ccfd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015260240161060c565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f1f2cd7c97f4d801b5efe26cc409617c1fd6c5ef786e79aacb90af40923e4e8e9910161059d565b600083815260036020526040902054839073ffffffffffffffffffffffffffffffffffffffff168015610a46576040517f375d1fe60000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff8216602482015260440161060c565b3360009081526002602052604090205460ff16610a8f576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260036020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790558215610ba75760055473ffffffffffffffffffffffffffffffffffffffff16610b1a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546040517ff65df96200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063f65df96290610b7490889088908890600401611690565b600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b505050505b6040805187815260208101879052338183015290517fbeb513e532542a562ac35699e7cd9ae7d198dcd3eee15bada6c857d28ceaddcf9181900360600190a1505050505050565b610bf66110a7565b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f953e92b1a6442e9c3242531154a3f6f6eb00b4e9c719ba8118fa6235e4ce89b6910161059d565b610c7d6110a7565b610c868161112a565b50565b60045460609073ffffffffffffffffffffffffffffffffffffffff168015801590610d4957506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf890610d069033906000903690600401611762565b602060405180830381865afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d47919061166e565b155b15610d80576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055473ffffffffffffffffffffffffffffffffffffffff168015610e2e576040517fdba45fe000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063dba45fe0903490610dfb908b908b908b908b90339060040161179b565b6000604051808303818588803b158015610e1457600080fd5b505af1158015610e28573d6000803e3d6000fd5b50505050505b610e38878761121f565b979650505050505050565b60045460609073ffffffffffffffffffffffffffffffffffffffff168015801590610f0357506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf890610ec09033906000903690600401611762565b602060405180830381865afa158015610edd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f01919061166e565b155b15610f3a576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055473ffffffffffffffffffffffffffffffffffffffff168015610fe8576040517f6c2f1a1700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636c2f1a17903490610fb5908b908b908b908b9033906004016117eb565b6000604051808303818588803b158015610fce57600080fd5b505af1158015610fe2573d6000803e3d6000fd5b50505050505b8567ffffffffffffffff811115611001576110016118fc565b60405190808252806020026020018201604052801561103457816020015b606081526020019060019003908161101f5790505b50925060005b8681101561109c5761106e8888838181106110575761105761192b565b9050602002810190611069919061195a565b61121f565b8482815181106110805761108061192b565b602002602001018190525080611095906119bf565b905061103a565b505050949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161060c565b565b3373ffffffffffffffffffffffffffffffffffffffff8216036111a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161060c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6060600061122d8385611a1e565b60008181526003602052604090205490915073ffffffffffffffffffffffffffffffffffffffff168061128f576040517fb151802b0000000000000000000000000000000000000000000000000000000081526004810183905260240161060c565b6040517f3d3ac1b500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690633d3ac1b5906112e590889088903390600401611a5a565b6000604051808303816000875af1158015611304573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261134a9190810190611a94565b925050505b92915050565b60005b83811015611370578181015183820152602001611358565b50506000910152565b60008151808452611391816020860160208601611355565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006113d66020830184611379565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c8657600080fd5b60006020828403121561141157600080fd5b81356113d6816113dd565b60006020828403121561142e57600080fd5b5035919050565b6000806000806060858703121561144b57600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561147157600080fd5b818701915087601f83011261148557600080fd5b81358181111561149457600080fd5b8860208260061b85010111156114a957600080fd5b95989497505060200194505050565b60008083601f8401126114ca57600080fd5b50813567ffffffffffffffff8111156114e257600080fd5b6020830191508360208285010111156114fa57600080fd5b9250929050565b6000806000806040858703121561151757600080fd5b843567ffffffffffffffff8082111561152f57600080fd5b61153b888389016114b8565b9096509450602087013591508082111561155457600080fd5b50611561878288016114b8565b95989497509550505050565b6000806000806040858703121561158357600080fd5b843567ffffffffffffffff8082111561159b57600080fd5b818701915087601f8301126115af57600080fd5b8135818111156115be57600080fd5b8860208260051b85010111156115d357600080fd5b60209283019650945090860135908082111561155457600080fd5b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611661577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088860301845261164f858351611379565b94509285019290850190600101611615565b5092979650505050505050565b60006020828403121561168057600080fd5b815180151581146113d657600080fd5b838152604060208083018290528282018490526000919085906060850184805b8881101561170a5784356116c3816113dd565b73ffffffffffffffffffffffffffffffffffffffff1683528484013567ffffffffffffffff81168082146116f5578384fd5b848601525093850193918501916001016116b0565b50909998505050505050505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff84168152604060208201526000611792604083018486611719565b95945050505050565b6060815260006117af606083018789611719565b82810360208401526117c2818688611719565b91505073ffffffffffffffffffffffffffffffffffffffff831660408301529695505050505050565b6060808252810185905260006080600587901b8301810190830188835b898110156118b7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8086850301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18c360301811261186957600080fd5b8b01602081810191359067ffffffffffffffff82111561188857600080fd5b81360383131561189757600080fd5b6118a2878385611719565b96509485019493909301925050600101611808565b50505082810360208401526118cd818688611719565b9150506118f2604083018473ffffffffffffffffffffffffffffffffffffffff169052565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261198f57600080fd5b83018035915067ffffffffffffffff8211156119aa57600080fd5b6020019150368190038213156114fa57600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a17577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b8035602083101561134f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b604081526000611a6e604083018587611719565b905073ffffffffffffffffffffffffffffffffffffffff83166020830152949350505050565b600060208284031215611aa657600080fd5b815167ffffffffffffffff80821115611abe57600080fd5b818401915084601f830112611ad257600080fd5b815181811115611ae457611ae46118fc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611b2a57611b2a6118fc565b81604052828152876020848701011115611b4357600080fd5b610e3883602083016020880161135556fea164736f6c6343000810000a", } @@ -370,28 +370,28 @@ func (_VerifierProxy *VerifierProxyTransactorSession) UnsetVerifier(configDigest return _VerifierProxy.Contract.UnsetVerifier(&_VerifierProxy.TransactOpts, configDigest) } -func (_VerifierProxy *VerifierProxyTransactor) Verify(opts *bind.TransactOpts, payload []byte, feePayload []byte) (*types.Transaction, error) { - return _VerifierProxy.contract.Transact(opts, "verify", payload, feePayload) +func (_VerifierProxy *VerifierProxyTransactor) Verify(opts *bind.TransactOpts, payload []byte, parameterPayload []byte) (*types.Transaction, error) { + return _VerifierProxy.contract.Transact(opts, "verify", payload, parameterPayload) } -func (_VerifierProxy *VerifierProxySession) Verify(payload []byte, feePayload []byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload, feePayload) +func (_VerifierProxy *VerifierProxySession) Verify(payload []byte, parameterPayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload, parameterPayload) } -func (_VerifierProxy *VerifierProxyTransactorSession) Verify(payload []byte, feePayload []byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload, feePayload) +func (_VerifierProxy *VerifierProxyTransactorSession) Verify(payload []byte, parameterPayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.Verify(&_VerifierProxy.TransactOpts, payload, parameterPayload) } -func (_VerifierProxy *VerifierProxyTransactor) VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte) (*types.Transaction, error) { - return _VerifierProxy.contract.Transact(opts, "verifyBulk", payloads, feePayload) +func (_VerifierProxy *VerifierProxyTransactor) VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) { + return _VerifierProxy.contract.Transact(opts, "verifyBulk", payloads, parameterPayload) } -func (_VerifierProxy *VerifierProxySession) VerifyBulk(payloads [][]byte, feePayload []byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads, feePayload) +func (_VerifierProxy *VerifierProxySession) VerifyBulk(payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads, parameterPayload) } -func (_VerifierProxy *VerifierProxyTransactorSession) VerifyBulk(payloads [][]byte, feePayload []byte) (*types.Transaction, error) { - return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads, feePayload) +func (_VerifierProxy *VerifierProxyTransactorSession) VerifyBulk(payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) { + return _VerifierProxy.Contract.VerifyBulk(&_VerifierProxy.TransactOpts, payloads, parameterPayload) } type VerifierProxyAccessControllerSetIterator struct { @@ -1335,9 +1335,9 @@ type VerifierProxyInterface interface { UnsetVerifier(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) - Verify(opts *bind.TransactOpts, payload []byte, feePayload []byte) (*types.Transaction, error) + Verify(opts *bind.TransactOpts, payload []byte, parameterPayload []byte) (*types.Transaction, error) - VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, feePayload []byte) (*types.Transaction, error) + VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) FilterAccessControllerSet(opts *bind.FilterOpts) (*VerifierProxyAccessControllerSetIterator, error) diff --git a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 73fac3b33e3..4e097c0c83a 100644 --- a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,9 +1,9 @@ GETH_VERSION: 1.12.0 errored_verifier: ../../../contracts/solc/v0.8.16/ErroredVerifier.abi ../../../contracts/solc/v0.8.16/ErroredVerifier.bin 510d18a58bfda646be35e46491baf73041eb333a349615465b20e2b5b41c5f73 exposed_verifier: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246 -fee_manager: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin 14e1aca5c41bf899cec3c6d3f626642f786348c9d8746f78fe7c3e921d1c878e +fee_manager: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin cac01f18ad6eebac0c58d64fafa9a6076c00a91496bdc1e90aeb18e7b13a815c llo_feeds: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin cb71e018f67e49d7bc0e194c822204dfd59f79ff42e4fc8fd8ab63f3acd71361 llo_feeds_test: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246 reward_manager: ../../../contracts/solc/v0.8.16/RewardManager.abi ../../../contracts/solc/v0.8.16/RewardManager.bin ec52c851ffe7ed00e05a68dbb363b2e01d38088ac829988b611653b30d10ec97 verifier: ../../../contracts/solc/v0.8.16/Verifier.abi ../../../contracts/solc/v0.8.16/Verifier.bin 135206eccb805c267392c398df385aa51b22db4d4c59fa1f31f0e5b0a607c812 -verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin ea00d5bea59a19066e36c2f9ec118e2eeb70536ea1862ba3cd1b88796d174ddd +verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin 250e4066936535d57d8e3859dfd33fddc7abc525b0f81e1fe87d96f00663a74f From 00a5d09f7080e89963522f9fc9682b336a37e702 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Tue, 19 Sep 2023 11:41:57 -0700 Subject: [PATCH 11/12] Prettier --- .../v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol index 2fc7d8088bd..819a2134c37 100644 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/dev/interfaces/IVerifierFeeManager.sol @@ -19,7 +19,11 @@ interface IVerifierFeeManager is IERC165 { * @param parameterPayload fee payload * @param subscriber address of the user to process fee for */ - function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload, address subscriber) external payable; + function processFeeBulk( + bytes[] calldata payloads, + bytes calldata parameterPayload, + address subscriber + ) external payable; /** * @notice Sets the fee recipients according to the fee manager From 7bed3871edb33a4a03170d44ecf63317c03e9a84 Mon Sep 17 00:00:00 2001 From: Austin Born Date: Tue, 19 Sep 2023 11:44:33 -0700 Subject: [PATCH 12/12] feePayload -> parameterPayload in integration tests --- integration-tests/contracts/contract_models.go | 4 ++-- integration-tests/contracts/ethereum_contracts.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration-tests/contracts/contract_models.go b/integration-tests/contracts/contract_models.go index 6e600cb8a6d..9f1130dce9f 100644 --- a/integration-tests/contracts/contract_models.go +++ b/integration-tests/contracts/contract_models.go @@ -375,6 +375,6 @@ type MercuryVerifier interface { type MercuryVerifierProxy interface { Address() string - Verify(signedReport []byte, feePayload []byte, value *big.Int) (*types.Transaction, error) - VerifyBulk(signedReports [][]byte, feePayload []byte, value *big.Int) (*types.Transaction, error) + Verify(signedReport []byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) + VerifyBulk(signedReports [][]byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) } diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index 8e8de17e302..d3db6913c50 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -2297,7 +2297,7 @@ func (e *EthereumMercuryVerifierProxy) Address() string { return e.address.Hex() } -func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, feePayload []byte, value *big.Int) (*types.Transaction, error) { +func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) { opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if value != nil { opts.Value = value @@ -2305,14 +2305,14 @@ func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, feePayload [] if err != nil { return nil, err } - tx, err := e.instance.Verify(opts, feePayload, signedReport) + tx, err := e.instance.Verify(opts, parameterPayload, signedReport) if err != nil { return nil, err } return tx, e.client.ProcessTransaction(tx) } -func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, feePayload []byte, value *big.Int) (*types.Transaction, error) { +func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) { opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if value != nil { opts.Value = value @@ -2320,7 +2320,7 @@ func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, feePay if err != nil { return nil, err } - tx, err := e.instance.VerifyBulk(opts, signedReports, feePayload) + tx, err := e.instance.VerifyBulk(opts, signedReports, parameterPayload) if err != nil { return nil, err }