From 95502ad2699d63891662594f70e82e76682f2ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deividas=20Kar=C5=BEinauskas?= Date: Fri, 14 Jun 2024 17:07:52 +0300 Subject: [PATCH] [KS-331] Single contract serving as router and forwarder (#13528) * Remove redundant IForwarder interface * Move Router error and events to the interface * Remove unused import * More refactors * Tests pass * Merge Forwarder + Router; wrappers + gas snapshot * Use the same mechanism for the forwarder check * Remove router deployment steps * Add changesets --- .changeset/ninety-zebras-hammer.md | 5 + contracts/.changeset/odd-gorillas-develop.md | 5 + contracts/gas-snapshots/keystone.gas-snapshot | 48 +- .../scripts/native_solc_compile_all_keystone | 1 - .../src/v0.8/keystone/KeystoneForwarder.sol | 127 ++- .../src/v0.8/keystone/KeystoneRouter.sol | 76 -- .../v0.8/keystone/interfaces/IForwarder.sol | 5 - .../src/v0.8/keystone/interfaces/IRouter.sol | 32 +- .../test/KeystoneForwarderBaseTest.t.sol | 7 +- .../test/KeystoneForwarder_ReportTest.t.sol | 5 +- ...KeystoneForwarder_TypeAndVersionTest.t.sol | 2 +- .../test/KeystoneRouter_AccessTest.t.sol | 11 +- .../keystone/generated/forwarder/forwarder.go | 376 ++++++- .../keystone/generated/router/router.go | 954 ------------------ ...rapper-dependency-versions-do-not-edit.txt | 3 +- core/gethwrappers/keystone/go_generate.go | 1 - .../keystone/src/01_deploy_contracts_cmd.go | 24 +- 17 files changed, 515 insertions(+), 1167 deletions(-) create mode 100644 .changeset/ninety-zebras-hammer.md create mode 100644 contracts/.changeset/odd-gorillas-develop.md delete mode 100644 contracts/src/v0.8/keystone/KeystoneRouter.sol delete mode 100644 contracts/src/v0.8/keystone/interfaces/IForwarder.sol delete mode 100644 core/gethwrappers/keystone/generated/router/router.go diff --git a/.changeset/ninety-zebras-hammer.md b/.changeset/ninety-zebras-hammer.md new file mode 100644 index 00000000000..0408383bd03 --- /dev/null +++ b/.changeset/ninety-zebras-hammer.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal diff --git a/contracts/.changeset/odd-gorillas-develop.md b/contracts/.changeset/odd-gorillas-develop.md new file mode 100644 index 00000000000..93fba83b558 --- /dev/null +++ b/contracts/.changeset/odd-gorillas-develop.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal diff --git a/contracts/gas-snapshots/keystone.gas-snapshot b/contracts/gas-snapshots/keystone.gas-snapshot index 58f69377803..60af8a141a3 100644 --- a/contracts/gas-snapshots/keystone.gas-snapshot +++ b/contracts/gas-snapshots/keystone.gas-snapshot @@ -78,28 +78,28 @@ CapabilityRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27291) CapabilityRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 26974) CapabilityRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 25538) CapabilityRegistry_UpdateNodesTest:test_UpdatesNodeInfo() (gas: 158803) -KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 1807115) -KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverInterfaceNotSupported() (gas: 132145) -KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverNotContract() (gas: 133638) -KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 162153) -KeystoneForwarder_ReportTest:test_RevertWhen_AlreadyAttempted() (gas: 157192) -KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 86392) -KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 118530) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 94560) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 75914) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasInexistentConfigVersion() (gas: 76282) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 45569) -KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 55282) -KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 56028) -KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 20162) -KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 90143) -KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 14511) -KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 90874) -KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 116644) -KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 1543588) -KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 1540255) +KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 1802140) +KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverInterfaceNotSupported() (gas: 126020) +KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverNotContract() (gas: 127513) +KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 156028) +KeystoneForwarder_ReportTest:test_RevertWhen_AlreadyAttempted() (gas: 152578) +KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 86398) +KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 118536) +KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 94566) +KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 75920) +KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasInexistentConfigVersion() (gas: 76288) +KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 45575) +KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 55288) +KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 56034) +KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 20184) +KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 90165) +KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 14533) +KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 90896) +KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 116678) +KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 1543982) +KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 1540964) KeystoneForwarder_TypeAndVersionTest:test_TypeAndVersion() (gas: 9641) -KeystoneRouter_SetConfigTest:test_AddForwarder_RevertWhen_NotOwner() (gas: 10956) -KeystoneRouter_SetConfigTest:test_RemoveForwarder_RevertWhen_NotOwner() (gas: 10879) -KeystoneRouter_SetConfigTest:test_Route_RevertWhen_Unauthorized() (gas: 18509) -KeystoneRouter_SetConfigTest:test_Route_Success() (gas: 75585) \ No newline at end of file +KeystoneRouter_SetConfigTest:test_AddForwarder_RevertWhen_NotOwner() (gas: 10978) +KeystoneRouter_SetConfigTest:test_RemoveForwarder_RevertWhen_NotOwner() (gas: 10923) +KeystoneRouter_SetConfigTest:test_Route_RevertWhen_UnauthorizedForwarder() (gas: 18553) +KeystoneRouter_SetConfigTest:test_Route_Success() (gas: 75629) \ No newline at end of file diff --git a/contracts/scripts/native_solc_compile_all_keystone b/contracts/scripts/native_solc_compile_all_keystone index 5450cd654c8..1530b307dbd 100755 --- a/contracts/scripts/native_solc_compile_all_keystone +++ b/contracts/scripts/native_solc_compile_all_keystone @@ -30,5 +30,4 @@ compileContract () { compileContract keystone/CapabilityRegistry.sol compileContract keystone/KeystoneForwarder.sol -compileContract keystone/KeystoneRouter.sol compileContract keystone/OCR3Capability.sol diff --git a/contracts/src/v0.8/keystone/KeystoneForwarder.sol b/contracts/src/v0.8/keystone/KeystoneForwarder.sol index 644f4842be7..fe0597ae8f0 100644 --- a/contracts/src/v0.8/keystone/KeystoneForwarder.sol +++ b/contracts/src/v0.8/keystone/KeystoneForwarder.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {IReceiver} from "./interfaces/IReceiver.sol"; import {IRouter} from "./interfaces/IRouter.sol"; -import {IForwarder} from "./interfaces/IForwarder.sol"; +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; @@ -11,7 +11,7 @@ import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; /// allows nodes to determine if reports have been processed (successfully or /// not) in a decentralized and product-agnostic way by recording processed /// reports. -contract KeystoneForwarder is IForwarder, OwnerIsCreator, ITypeAndVersion { +contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { /// @notice This error is returned when the report is shorter than /// REPORT_METADATA_LENGTH, which is the minimum length of a report. error InvalidReport(); @@ -64,8 +64,6 @@ contract KeystoneForwarder is IForwarder, OwnerIsCreator, ITypeAndVersion { mapping(address signer => uint256 position) _positions; // 1-indexed to detect unset values } - address internal s_router; - /// @notice Contains the configuration for each DON ID // @param configId (uint64(donId) << 32) | configVersion mapping(uint64 configId => OracleSet) internal s_configs; @@ -81,10 +79,10 @@ contract KeystoneForwarder is IForwarder, OwnerIsCreator, ITypeAndVersion { bool result ); - string public constant override typeAndVersion = "KeystoneForwarder 1.0.0"; + string public constant override typeAndVersion = "Forwarder and Router 1.0.0"; - constructor(address router) OwnerIsCreator() { - s_router = router; + constructor() OwnerIsCreator() { + s_forwarders[address(this)] = true; } uint256 internal constant MAX_ORACLES = 31; @@ -92,6 +90,87 @@ contract KeystoneForwarder is IForwarder, OwnerIsCreator, ITypeAndVersion { uint256 internal constant FORWARDER_METADATA_LENGTH = 45; uint256 internal constant SIGNATURE_LENGTH = 65; + // ================================================================ + // │ IRouter │ + // ================================================================ + + mapping(address forwarder => bool) internal s_forwarders; + mapping(bytes32 transmissionId => TransmissionInfo) internal s_transmissions; + + function addForwarder(address forwarder) external onlyOwner { + s_forwarders[forwarder] = true; + emit ForwarderAdded(forwarder); + } + + function removeForwarder(address forwarder) external onlyOwner { + s_forwarders[forwarder] = false; + emit ForwarderRemoved(forwarder); + } + + function route( + bytes32 transmissionId, + address transmitter, + address receiver, + bytes calldata metadata, + bytes calldata validatedReport + ) public returns (bool) { + if (!s_forwarders[msg.sender]) { + revert UnauthorizedForwarder(); + } + + if (s_transmissions[transmissionId].transmitter != address(0)) revert AlreadyAttempted(transmissionId); + s_transmissions[transmissionId].transmitter = transmitter; + + if (receiver.code.length == 0) return false; + + try IReceiver(receiver).onReport(metadata, validatedReport) { + s_transmissions[transmissionId].success = true; + return true; + } catch { + return false; + } + } + + function getTransmissionId( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) public pure returns (bytes32) { + // This is slightly cheaper compared to + // keccak256(abi.encode(receiver, workflowExecutionId, reportId)); + return keccak256(bytes.concat(bytes20(uint160(receiver)), workflowExecutionId, reportId)); + } + + /// @notice Get transmitter of a given report or 0x0 if it wasn't transmitted yet + function getTransmitter( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) external view returns (address) { + return s_transmissions[getTransmissionId(receiver, workflowExecutionId, reportId)].transmitter; + } + + /// @notice Get delivery status of a given report + function getTransmissionState( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) external view returns (IRouter.TransmissionState) { + bytes32 transmissionId = getTransmissionId(receiver, workflowExecutionId, reportId); + + if (s_transmissions[transmissionId].transmitter == address(0)) return IRouter.TransmissionState.NOT_ATTEMPTED; + return + s_transmissions[transmissionId].success ? IRouter.TransmissionState.SUCCEEDED : IRouter.TransmissionState.FAILED; + } + + function isForwarder(address forwarder) external view returns (bool) { + return s_forwarders[forwarder]; + } + + // ================================================================ + // │ Forwarder │ + // ================================================================ + function setConfig(uint32 donId, uint32 configVersion, uint8 f, address[] calldata signers) external onlyOwner { if (f == 0) revert FaultToleranceMustBePositive(); if (signers.length > MAX_ORACLES) revert ExcessSigners(signers.length, MAX_ORACLES); @@ -170,7 +249,7 @@ contract KeystoneForwarder is IForwarder, OwnerIsCreator, ITypeAndVersion { } } - bool success = IRouter(s_router).route( + bool success = this.route( getTransmissionId(receiver, workflowExecutionId, reportId), msg.sender, receiver, @@ -181,36 +260,6 @@ contract KeystoneForwarder is IForwarder, OwnerIsCreator, ITypeAndVersion { emit ReportProcessed(receiver, workflowExecutionId, reportId, success); } - function getTransmitter( - address receiver, - bytes32 workflowExecutionId, - bytes2 reportId - ) external view returns (address) { - return IRouter(s_router).getTransmitter(getTransmissionId(receiver, workflowExecutionId, reportId)); - } - - function getTransmissionState( - address receiver, - bytes32 workflowExecutionId, - bytes2 reportId - ) external view returns (IRouter.TransmissionState) { - return IRouter(s_router).getTransmissionState(getTransmissionId(receiver, workflowExecutionId, reportId)); - } - - function getTransmissionId( - address receiver, - bytes32 workflowExecutionId, - bytes2 reportId - ) public pure returns (bytes32) { - // This is slightly cheaper compared to - // keccak256(abi.encode(receiver, workflowExecutionId, reportId)); - return keccak256(bytes.concat(bytes20(uint160(receiver)), workflowExecutionId, reportId)); - } - - function getRouter() external view returns (address) { - return s_router; - } - // solhint-disable-next-line chainlink-solidity/explicit-returns function _getMetadata( bytes memory rawReport diff --git a/contracts/src/v0.8/keystone/KeystoneRouter.sol b/contracts/src/v0.8/keystone/KeystoneRouter.sol deleted file mode 100644 index aacb83d8c6a..00000000000 --- a/contracts/src/v0.8/keystone/KeystoneRouter.sol +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; -import {IRouter} from "./interfaces/IRouter.sol"; -import {IReceiver} from "./interfaces/IReceiver.sol"; - -import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; - -contract KeystoneRouter is IRouter, OwnerIsCreator, ITypeAndVersion { - error Unauthorized(); - error AlreadyAttempted(bytes32 transmissionId); - - event ForwarderAdded(address indexed forwarder); - event ForwarderRemoved(address indexed forwarder); - - mapping(address forwarder => bool) internal s_forwarders; - mapping(bytes32 transmissionId => TransmissionInfo) internal s_transmissions; - - string public constant override typeAndVersion = "KeystoneRouter 1.0.0"; - - struct TransmissionInfo { - address transmitter; - bool state; - } - - function addForwarder(address forwarder) external onlyOwner { - s_forwarders[forwarder] = true; - emit ForwarderAdded(forwarder); - } - - function removeForwarder(address forwarder) external onlyOwner { - s_forwarders[forwarder] = false; - emit ForwarderRemoved(forwarder); - } - - function route( - bytes32 transmissionId, - address transmitter, - address receiver, - bytes calldata metadata, - bytes calldata report - ) external returns (bool) { - if (!s_forwarders[msg.sender]) { - revert Unauthorized(); - } - - if (s_transmissions[transmissionId].transmitter != address(0)) revert AlreadyAttempted(transmissionId); - s_transmissions[transmissionId].transmitter = transmitter; - - if (receiver.code.length == 0) return false; - - try IReceiver(receiver).onReport(metadata, report) { - s_transmissions[transmissionId].state = true; - return true; - } catch { - return false; - } - } - - /// @notice Get transmitter of a given report or 0x0 if it wasn't transmitted yet - function getTransmitter(bytes32 transmissionId) external view returns (address) { - return s_transmissions[transmissionId].transmitter; - } - - /// @notice Get delivery status of a given report - function getTransmissionState(bytes32 transmissionId) external view returns (IRouter.TransmissionState) { - if (s_transmissions[transmissionId].transmitter == address(0)) return IRouter.TransmissionState.NOT_ATTEMPTED; - return - s_transmissions[transmissionId].state ? IRouter.TransmissionState.SUCCEEDED : IRouter.TransmissionState.FAILED; - } - - function isForwarder(address forwarder) external view returns (bool) { - return s_forwarders[forwarder]; - } -} diff --git a/contracts/src/v0.8/keystone/interfaces/IForwarder.sol b/contracts/src/v0.8/keystone/interfaces/IForwarder.sol deleted file mode 100644 index ce9512c6570..00000000000 --- a/contracts/src/v0.8/keystone/interfaces/IForwarder.sol +++ /dev/null @@ -1,5 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -/// @title IForwarder - forwards keystone reports to a target -interface IForwarder {} diff --git a/contracts/src/v0.8/keystone/interfaces/IRouter.sol b/contracts/src/v0.8/keystone/interfaces/IRouter.sol index 63ddd865c21..a36c17c14d6 100644 --- a/contracts/src/v0.8/keystone/interfaces/IRouter.sol +++ b/contracts/src/v0.8/keystone/interfaces/IRouter.sol @@ -3,12 +3,26 @@ pragma solidity ^0.8.19; /// @title IRouter - delivers keystone reports to receiver interface IRouter { + error UnauthorizedForwarder(); + error AlreadyAttempted(bytes32 transmissionId); + + event ForwarderAdded(address indexed forwarder); + event ForwarderRemoved(address indexed forwarder); + enum TransmissionState { NOT_ATTEMPTED, SUCCEEDED, FAILED } + struct TransmissionInfo { + address transmitter; + bool success; + } + + function addForwarder(address forwarder) external; + function removeForwarder(address forwarder) external; + function route( bytes32 transmissionId, address transmitter, @@ -17,6 +31,20 @@ interface IRouter { bytes calldata report ) external returns (bool); - function getTransmitter(bytes32 transmissionId) external view returns (address); - function getTransmissionState(bytes32 transmissionId) external view returns (TransmissionState); + function getTransmissionId( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) external pure returns (bytes32); + function getTransmitter( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) external view returns (address); + function getTransmissionState( + address receiver, + bytes32 workflowExecutionId, + bytes2 reportId + ) external view returns (TransmissionState); + function isForwarder(address forwarder) external view returns (bool); } diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol index 2b1adfb9622..3b3c4060780 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; import {Receiver} from "./mocks/Receiver.sol"; -import {KeystoneRouter} from "../KeystoneRouter.sol"; import {KeystoneForwarder} from "../KeystoneForwarder.sol"; contract BaseTest is Test { @@ -21,13 +20,13 @@ contract BaseTest is Test { Signer[MAX_ORACLES] internal s_signers; KeystoneForwarder internal s_forwarder; - KeystoneRouter internal s_router; + KeystoneForwarder internal s_router; Receiver internal s_receiver; function setUp() public virtual { vm.startPrank(ADMIN); - s_router = new KeystoneRouter(); - s_forwarder = new KeystoneForwarder(address(s_router)); + s_router = new KeystoneForwarder(); + s_forwarder = new KeystoneForwarder(); s_router.addForwarder(address(s_forwarder)); s_receiver = new Receiver(); diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol index cf9d1ad3eee..ccb398fac5a 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.19; import {BaseTest} from "./KeystoneForwarderBaseTest.t.sol"; -import {KeystoneRouter} from "../KeystoneRouter.sol"; import {IRouter} from "../interfaces/IRouter.sol"; import {KeystoneForwarder} from "../KeystoneForwarder.sol"; @@ -37,8 +36,6 @@ contract KeystoneForwarder_ReportTest is BaseTest { s_forwarder.setConfig(DON_ID, CONFIG_VERSION, F, _getSignerAddresses()); s_router.addForwarder(address(s_forwarder)); - assertEq(s_forwarder.getRouter(), address(s_router), "router mismatch"); - mercuryReports[0] = hex"010203"; mercuryReports[1] = hex"aabbccdd"; @@ -148,7 +145,7 @@ contract KeystoneForwarder_ReportTest is BaseTest { s_forwarder.report(address(s_receiver), report, reportContext, signatures); bytes32 transmissionId = s_forwarder.getTransmissionId(address(s_receiver), executionId, reportId); - vm.expectRevert(abi.encodeWithSelector(KeystoneRouter.AlreadyAttempted.selector, transmissionId)); + vm.expectRevert(abi.encodeWithSelector(IRouter.AlreadyAttempted.selector, transmissionId)); s_forwarder.report(address(s_receiver), report, reportContext, signatures); } diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol index 1d8d7572e0c..8aad3766497 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol @@ -5,6 +5,6 @@ import {BaseTest} from "./KeystoneForwarderBaseTest.t.sol"; contract KeystoneForwarder_TypeAndVersionTest is BaseTest { function test_TypeAndVersion() public view { - assertEq(s_forwarder.typeAndVersion(), "KeystoneForwarder 1.0.0"); + assertEq(s_forwarder.typeAndVersion(), "Forwarder and Router 1.0.0"); } } diff --git a/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol index 60c40eec573..efe6091c49d 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol @@ -3,7 +3,8 @@ pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; import {IReceiver} from "../interfaces/IReceiver.sol"; -import {KeystoneRouter} from "../KeystoneRouter.sol"; +import {IRouter} from "../interfaces/IRouter.sol"; +import {KeystoneForwarder} from "../KeystoneForwarder.sol"; contract KeystoneRouter_SetConfigTest is Test { address internal ADMIN = address(1); @@ -16,11 +17,11 @@ contract KeystoneRouter_SetConfigTest is Test { bytes internal report = hex"9998"; bytes32 internal id = hex"6d795f657865637574696f6e5f69640000000000000000000000000000000000"; - KeystoneRouter internal s_router; + KeystoneForwarder internal s_router; function setUp() public virtual { vm.prank(ADMIN); - s_router = new KeystoneRouter(); + s_router = new KeystoneForwarder(); } function test_AddForwarder_RevertWhen_NotOwner() public { @@ -35,9 +36,9 @@ contract KeystoneRouter_SetConfigTest is Test { s_router.removeForwarder(FORWARDER); } - function test_Route_RevertWhen_Unauthorized() public { + function test_Route_RevertWhen_UnauthorizedForwarder() public { vm.prank(STRANGER); - vm.expectRevert(KeystoneRouter.Unauthorized.selector); + vm.expectRevert(IRouter.UnauthorizedForwarder.selector); s_router.route(id, TRANSMITTER, RECEIVER, metadata, report); } diff --git a/core/gethwrappers/keystone/generated/forwarder/forwarder.go b/core/gethwrappers/keystone/generated/forwarder/forwarder.go index eeeb322d96e..b8284b0d419 100644 --- a/core/gethwrappers/keystone/generated/forwarder/forwarder.go +++ b/core/gethwrappers/keystone/generated/forwarder/forwarder.go @@ -31,15 +31,15 @@ var ( ) var KeystoneForwarderMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"configId\",\"type\":\"uint64\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"ConfigSet\",\"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\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"}],\"name\":\"clearConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionState\",\"outputs\":[{\"internalType\":\"enumIRouter.TransmissionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"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\":\"view\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b5060405162001b4a38038062001b4a833981016040819052620000349162000193565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050600280546001600160a01b0319166001600160a01b03939093169290921790915550620001c5565b336001600160a01b03821603620001425760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001a657600080fd5b81516001600160a01b0381168114620001be57600080fd5b9392505050565b61197580620001d56000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638864b86411610081578063ee59d26c1161005b578063ee59d26c14610270578063ef6e17a014610283578063f2fde38b1461029657600080fd5b80638864b864146101fc5780638da5cb5b14610234578063b0f479a11461025257600080fd5b8063354bdd66116100b2578063354bdd661461013557806343c16467146101d457806379ba5097146101f457600080fd5b806311289565146100ce578063181f5a77146100e3575b600080fd5b6100e16100dc3660046112ec565b6102a9565b005b61011f6040518060400160405280601781526020017f4b657973746f6e65466f7277617264657220312e302e3000000000000000000081525081565b60405161012c9190611399565b60405180910390f35b6101c6610143366004611405565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085901b166020820152603481018390527fffff000000000000000000000000000000000000000000000000000000000000821660548201526000906056016040516020818303038152906040528051906020012090509392505050565b60405190815260200161012c565b6101e76101e2366004611405565b610891565b60405161012c919061146c565b6100e16109a6565b61020f61020a366004611405565b610aa3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161012c565b60005473ffffffffffffffffffffffffffffffffffffffff1661020f565b60025473ffffffffffffffffffffffffffffffffffffffff1661020f565b6100e161027e3660046114c6565b610bb0565b6100e1610291366004611544565b610f39565b6100e16102a4366004611577565b610fd9565b606d8510156102e4576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061032889898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610fed92505050565b67ffffffffffffffff8216600090815260036020526040812080549497509195509193509160ff169081900361039b576040517fdf3b81ea00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b856103a78260016115ca565b60ff16146103f9576103ba8160016115ca565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101879052604401610392565b60008b8b60405161040b9291906115e9565b604051908190038120610424918c908c906020016115f9565b604051602081830303815290604052805190602001209050610444611180565b60005b888110156106cd573660008b8b8481811061046457610464611613565b90506020028101906104769190611642565b9092509050604181146104b95781816040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016103929291906116f0565b6000600186848460408181106104d1576104d1611613565b6104e392013560f81c9050601b6115ca565b6104f1602060008789611704565b6104fa9161172e565b61050860406020888a611704565b6105119161172e565b6040805160008152602081018083529590955260ff909316928401929092526060830152608082015260a0016020604051602081039080840390855afa15801561055f573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8116600090815260028c01602052918220549093509150819003610605576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610392565b600086826020811061061957610619611613565b602002015173ffffffffffffffffffffffffffffffffffffffff1614610683576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610392565b8186826020811061069657610696611613565b73ffffffffffffffffffffffffffffffffffffffff9092166020929092020152506106c6925083915061176a9050565b9050610447565b50506002546000945073ffffffffffffffffffffffffffffffffffffffff16925063233fd52d915061078090508c86866040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085901b166020820152603481018390527fffff000000000000000000000000000000000000000000000000000000000000821660548201526000906056016040516020818303038152906040528051906020012090509392505050565b338d8d8d602d90606d9261079693929190611704565b8f8f606d9080926107a993929190611704565b6040518863ffffffff1660e01b81526004016107cb97969594939291906117a2565b6020604051808303816000875af11580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190611803565b9050817dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916838b73ffffffffffffffffffffffffffffffffffffffff167f3617b009e9785c42daebadb6d3fb553243a4bf586d07ea72d65d80013ce116b58460405161087d911515815260200190565b60405180910390a450505050505050505050565b600254604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b16602080830191909152603482018690527fffff0000000000000000000000000000000000000000000000000000000000008516605483015282518083036036018152605683019384905280519101207f516db40800000000000000000000000000000000000000000000000000000000909252605a81019190915260009173ffffffffffffffffffffffffffffffffffffffff169063516db40890607a01602060405180830381865afa15801561097a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099e9190611825565b949350505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610392565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600254604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b16602080830191909152603482018690527fffff0000000000000000000000000000000000000000000000000000000000008516605483015282518083036036018152605683019384905280519101207fe6b7145800000000000000000000000000000000000000000000000000000000909252605a81019190915260009173ffffffffffffffffffffffffffffffffffffffff169063e6b7145890607a01602060405180830381865afa158015610b8c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099e9190611846565b610bb8611008565b8260ff16600003610bf5576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f811115610c3a576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f6024820152604401610392565b610c45836003611863565b60ff168111610ca35780610c5a846003611863565b610c659060016115ca565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff166024820152604401610392565b67ffffffff00000000602086901b1663ffffffff85161760005b67ffffffffffffffff8216600090815260036020526040902060010154811015610d595767ffffffffffffffff821660009081526003602052604081206001810180546002909201929184908110610d1757610d17611613565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812055610d528161176a565b9050610cbd565b5060005b82811015610e7b576000848483818110610d7957610d79611613565b9050602002016020810190610d8e9190611577565b67ffffffffffffffff8416600090815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845260020190915290205490915015610e1e576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610392565b610e29826001611886565b67ffffffffffffffff8416600090815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff9095168352600290940190529190912055610e748161176a565b9050610d5d565b5067ffffffffffffffff81166000908152600360205260409020610ea390600101848461119f565b5067ffffffffffffffff81166000908152600360205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790555163ffffffff86811691908816907f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a45590610f2990889088908890611899565b60405180910390a3505050505050565b610f41611008565b63ffffffff818116602084811b67ffffffff00000000168217600090815260038252604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558051828152928301905291928516917f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a45591604051610fcd929190611901565b60405180910390a35050565b610fe1611008565b610fea8161108b565b50565b60218101516045820151608b90920151909260c09290921c91565b60005473ffffffffffffffffffffffffffffffffffffffff163314611089576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610392565b565b3373ffffffffffffffffffffffffffffffffffffffff82160361110a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610392565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6040518061040001604052806020906020820280368337509192915050565b828054828255906000526020600020908101928215611217579160200282015b828111156112175781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8435161782556020909201916001909101906111bf565b50611223929150611227565b5090565b5b808211156112235760008155600101611228565b73ffffffffffffffffffffffffffffffffffffffff81168114610fea57600080fd5b60008083601f84011261127057600080fd5b50813567ffffffffffffffff81111561128857600080fd5b6020830191508360208285010111156112a057600080fd5b9250929050565b60008083601f8401126112b957600080fd5b50813567ffffffffffffffff8111156112d157600080fd5b6020830191508360208260051b85010111156112a057600080fd5b60008060008060008060006080888a03121561130757600080fd5b87356113128161123c565b9650602088013567ffffffffffffffff8082111561132f57600080fd5b61133b8b838c0161125e565b909850965060408a013591508082111561135457600080fd5b6113608b838c0161125e565b909650945060608a013591508082111561137957600080fd5b506113868a828b016112a7565b989b979a50959850939692959293505050565b600060208083528351808285015260005b818110156113c6578581018301518582016040015282016113aa565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60008060006060848603121561141a57600080fd5b83356114258161123c565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461146157600080fd5b809150509250925092565b60208101600383106114a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b803563ffffffff811681146114c157600080fd5b919050565b6000806000806000608086880312156114de57600080fd5b6114e7866114ad565b94506114f5602087016114ad565b9350604086013560ff8116811461150b57600080fd5b9250606086013567ffffffffffffffff81111561152757600080fd5b611533888289016112a7565b969995985093965092949392505050565b6000806040838503121561155757600080fd5b611560836114ad565b915061156e602084016114ad565b90509250929050565b60006020828403121561158957600080fd5b81356115948161123c565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff81811683821601908111156115e3576115e361159b565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261167757600080fd5b83018035915067ffffffffffffffff82111561169257600080fd5b6020019150368190038213156112a057600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152600061099e6020830184866116a7565b6000808585111561171457600080fd5b8386111561172157600080fd5b5050820193919092039150565b803560208310156115e3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361179b5761179b61159b565b5060010190565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525060a060608301526117e260a0830186886116a7565b82810360808401526117f58185876116a7565b9a9950505050505050505050565b60006020828403121561181557600080fd5b8151801515811461159457600080fd5b60006020828403121561183757600080fd5b81516003811061159457600080fd5b60006020828403121561185857600080fd5b81516115948161123c565b60ff818116838216029081169081811461187f5761187f61159b565b5092915050565b808201808211156115e3576115e361159b565b60ff8416815260406020808301829052908201839052600090849060608401835b868110156118f55783356118cd8161123c565b73ffffffffffffffffffffffffffffffffffffffff16825292820192908201906001016118ba565b50979650505050505050565b60006040820160ff851683526020604081850152818551808452606086019150828701935060005b8181101561195b57845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101611929565b509097965050505050505056fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"configId\",\"type\":\"uint64\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedForwarder\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderRemoved\",\"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\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"addForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"}],\"name\":\"clearConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionState\",\"outputs\":[{\"internalType\":\"enumIRouter.TransmissionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"removeForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"validatedReport\",\"type\":\"bytes\"}],\"name\":\"route\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"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\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b038481169190911790915581161561009757610097816100b9565b5050306000908152600360205260409020805460ff1916600117905550610162565b336001600160a01b038216036101115760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611b7980620001726000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806379ba50971161008c578063abcef55411610066578063abcef5541461023e578063ee59d26c14610277578063ef6e17a01461028a578063f2fde38b1461029d57600080fd5b806379ba5097146101e05780638864b864146101e85780638da5cb5b1461022057600080fd5b8063354bdd66116100c8578063354bdd661461017957806343c164671461019a5780634d93172d146101ba5780635c41d2fe146101cd57600080fd5b806311289565146100ef578063181f5a7714610104578063233fd52d14610156575b600080fd5b6101026100fd36600461148b565b6102b0565b005b6101406040518060400160405280601a81526020017f466f7277617264657220616e6420526f7574657220312e302e3000000000000081525081565b60405161014d9190611536565b60405180910390f35b6101696101643660046115a2565b610814565b604051901515815260200161014d565b61018c61018736600461162a565b610a07565b60405190815260200161014d565b6101ad6101a836600461162a565b610a8b565b60405161014d919061168f565b6101026101c83660046116d0565b610b10565b6101026101db3660046116d0565b610b8c565b610102610c0b565b6101fb6101f636600461162a565b610d08565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014d565b60005473ffffffffffffffffffffffffffffffffffffffff166101fb565b61016961024c3660046116d0565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205460ff1690565b6101026102853660046116ff565b610d48565b61010261029836600461177d565b6110d1565b6101026102ab3660046116d0565b611171565b606d8510156102eb576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061032f89898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061118592505050565b67ffffffffffffffff8216600090815260026020526040812080549497509195509193509160ff16908190036103a2576040517fdf3b81ea00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b856103ae8260016117df565b60ff1614610400576103c18160016117df565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101879052604401610399565b60008b8b6040516104129291906117fe565b60405190819003812061042b918c908c9060200161180e565b60405160208183030381529060405280519060200120905061044b611318565b60005b888110156106d4573660008b8b8481811061046b5761046b611828565b905060200281019061047d9190611857565b9092509050604181146104c05781816040517f2adfdc30000000000000000000000000000000000000000000000000000000008152600401610399929190611905565b6000600186848460408181106104d8576104d8611828565b6104ea92013560f81c9050601b6117df565b6104f8602060008789611921565b6105019161194b565b61050f60406020888a611921565b6105189161194b565b6040805160008152602081018083529590955260ff909316928401929092526060830152608082015260a0016020604051602081039080840390855afa158015610566573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8116600090815260028c0160205291822054909350915081900361060c576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610399565b600086826020811061062057610620611828565b602002015173ffffffffffffffffffffffffffffffffffffffff161461068a576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610399565b8186826020811061069d5761069d611828565b73ffffffffffffffffffffffffffffffffffffffff9092166020929092020152506106cd92508391506119879050565b905061044e565b50505050505060003073ffffffffffffffffffffffffffffffffffffffff1663233fd52d6107038c8686610a07565b338d8d8d602d90606d9261071993929190611921565b8f8f606d90809261072c93929190611921565b6040518863ffffffff1660e01b815260040161074e97969594939291906119bf565b6020604051808303816000875af115801561076d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107919190611a20565b9050817dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916838b73ffffffffffffffffffffffffffffffffffffffff167f3617b009e9785c42daebadb6d3fb553243a4bf586d07ea72d65d80013ce116b584604051610800911515815260200190565b60405180910390a450505050505050505050565b3360009081526003602052604081205460ff1661085d576040517fd79e123d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008881526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16156108bc576040517fa53dc8ca00000000000000000000000000000000000000000000000000000000815260048101899052602401610399565b600088815260046020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a81169190911790915587163b900361091e575060006109fc565b6040517f805f213200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87169063805f213290610976908890889088908890600401611a42565b600060405180830381600087803b15801561099057600080fd5b505af19250505080156109a1575060015b6109ad575060006109fc565b50600087815260046020526040902080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560015b979650505050505050565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085901b166020820152603481018390527fffff000000000000000000000000000000000000000000000000000000000000821660548201526000906056016040516020818303038152906040528051906020012090505b9392505050565b600080610a99858585610a07565b60008181526004602052604090205490915073ffffffffffffffffffffffffffffffffffffffff16610acf576000915050610a84565b60008181526004602052604090205474010000000000000000000000000000000000000000900460ff16610b04576002610b07565b60015b95945050505050565b610b186111a0565b73ffffffffffffffffffffffffffffffffffffffff811660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517fb96d15bf9258c7b8df062753a6a262864611fc7b060a5ee2e57e79b85f898d389190a250565b610b946111a0565b73ffffffffffffffffffffffffffffffffffffffff811660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f0ea0ce2c048ff45a4a95f2947879de3fb94abec2f152190400cab2d1272a68e79190a250565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610399565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600060046000610d19868686610a07565b815260208101919091526040016000205473ffffffffffffffffffffffffffffffffffffffff16949350505050565b610d506111a0565b8260ff16600003610d8d576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f811115610dd2576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f6024820152604401610399565b610ddd836003611a69565b60ff168111610e3b5780610df2846003611a69565b610dfd9060016117df565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff166024820152604401610399565b67ffffffff00000000602086901b1663ffffffff85161760005b67ffffffffffffffff8216600090815260026020526040902060010154811015610ef35767ffffffffffffffff8216600090815260026020819052604082206001810180549190920192919084908110610eb157610eb1611828565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812055610eec81611987565b9050610e55565b5060005b82811015611013576000848483818110610f1357610f13611828565b9050602002016020810190610f2891906116d0565b67ffffffffffffffff8416600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610fb7576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610399565b610fc2826001611a8c565b67ffffffffffffffff8416600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff9096168452949091019052919091205561100c81611987565b9050610ef7565b5067ffffffffffffffff8116600090815260026020526040902061103b906001018484611337565b5067ffffffffffffffff81166000908152600260205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790555163ffffffff86811691908816907f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a455906110c190889088908890611a9f565b60405180910390a3505050505050565b6110d96111a0565b63ffffffff818116602084811b67ffffffff00000000168217600090815260028252604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558051828152928301905291928516917f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a45591604051611165929190611b05565b60405180910390a35050565b6111796111a0565b61118281611223565b50565b60218101516045820151608b90920151909260c09290921c91565b60005473ffffffffffffffffffffffffffffffffffffffff163314611221576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610399565b565b3373ffffffffffffffffffffffffffffffffffffffff8216036112a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610399565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6040518061040001604052806020906020820280368337509192915050565b8280548282559060005260206000209081019282156113af579160200282015b828111156113af5781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190611357565b506113bb9291506113bf565b5090565b5b808211156113bb57600081556001016113c0565b803573ffffffffffffffffffffffffffffffffffffffff811681146113f857600080fd5b919050565b60008083601f84011261140f57600080fd5b50813567ffffffffffffffff81111561142757600080fd5b60208301915083602082850101111561143f57600080fd5b9250929050565b60008083601f84011261145857600080fd5b50813567ffffffffffffffff81111561147057600080fd5b6020830191508360208260051b850101111561143f57600080fd5b60008060008060008060006080888a0312156114a657600080fd5b6114af886113d4565b9650602088013567ffffffffffffffff808211156114cc57600080fd5b6114d88b838c016113fd565b909850965060408a01359150808211156114f157600080fd5b6114fd8b838c016113fd565b909650945060608a013591508082111561151657600080fd5b506115238a828b01611446565b989b979a50959850939692959293505050565b600060208083528351808285015260005b8181101561156357858101830151858201604001528201611547565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b600080600080600080600060a0888a0312156115bd57600080fd5b873596506115cd602089016113d4565b95506115db604089016113d4565b9450606088013567ffffffffffffffff808211156115f857600080fd5b6116048b838c016113fd565b909650945060808a013591508082111561161d57600080fd5b506115238a828b016113fd565b60008060006060848603121561163f57600080fd5b611648846113d4565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461168457600080fd5b809150509250925092565b60208101600383106116ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000602082840312156116e257600080fd5b610a84826113d4565b803563ffffffff811681146113f857600080fd5b60008060008060006080868803121561171757600080fd5b611720866116eb565b945061172e602087016116eb565b9350604086013560ff8116811461174457600080fd5b9250606086013567ffffffffffffffff81111561176057600080fd5b61176c88828901611446565b969995985093965092949392505050565b6000806040838503121561179057600080fd5b611799836116eb565b91506117a7602084016116eb565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff81811683821601908111156117f8576117f86117b0565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261188c57600080fd5b83018035915067ffffffffffffffff8211156118a757600080fd5b60200191503681900382131561143f57600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6020815260006119196020830184866118bc565b949350505050565b6000808585111561193157600080fd5b8386111561193e57600080fd5b5050820193919092039150565b803560208310156117f8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036119b8576119b86117b0565b5060010190565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525060a060608301526119ff60a0830186886118bc565b8281036080840152611a128185876118bc565b9a9950505050505050505050565b600060208284031215611a3257600080fd5b81518015158114610a8457600080fd5b604081526000611a566040830186886118bc565b82810360208401526109fc8185876118bc565b60ff8181168382160290811690818114611a8557611a856117b0565b5092915050565b808201808211156117f8576117f86117b0565b60ff8416815260406020808301829052908201839052600090849060608401835b86811015611af95773ffffffffffffffffffffffffffffffffffffffff611ae6856113d4565b1682529282019290820190600101611ac0565b50979650505050505050565b60006040820160ff851683526020604081850152818551808452606086019150828701935060005b81811015611b5f57845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101611b2d565b509097965050505050505056fea164736f6c6343000813000a", } var KeystoneForwarderABI = KeystoneForwarderMetaData.ABI var KeystoneForwarderBin = KeystoneForwarderMetaData.Bin -func DeployKeystoneForwarder(auth *bind.TransactOpts, backend bind.ContractBackend, router common.Address) (common.Address, *types.Transaction, *KeystoneForwarder, error) { +func DeployKeystoneForwarder(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *KeystoneForwarder, error) { parsed, err := KeystoneForwarderMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -48,7 +48,7 @@ func DeployKeystoneForwarder(auth *bind.TransactOpts, backend bind.ContractBacke return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(KeystoneForwarderBin), backend, router) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(KeystoneForwarderBin), backend) if err != nil { return common.Address{}, nil, nil, err } @@ -171,28 +171,6 @@ func (_KeystoneForwarder *KeystoneForwarderTransactorRaw) Transact(opts *bind.Tr return _KeystoneForwarder.Contract.contract.Transact(opts, method, params...) } -func (_KeystoneForwarder *KeystoneForwarderCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _KeystoneForwarder.contract.Call(opts, &out, "getRouter") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_KeystoneForwarder *KeystoneForwarderSession) GetRouter() (common.Address, error) { - return _KeystoneForwarder.Contract.GetRouter(&_KeystoneForwarder.CallOpts) -} - -func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetRouter() (common.Address, error) { - return _KeystoneForwarder.Contract.GetRouter(&_KeystoneForwarder.CallOpts) -} - func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmissionId(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) ([32]byte, error) { var out []interface{} err := _KeystoneForwarder.contract.Call(opts, &out, "getTransmissionId", receiver, workflowExecutionId, reportId) @@ -259,6 +237,28 @@ func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetTransmitter(receive return _KeystoneForwarder.Contract.GetTransmitter(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) } +func (_KeystoneForwarder *KeystoneForwarderCaller) IsForwarder(opts *bind.CallOpts, forwarder common.Address) (bool, error) { + var out []interface{} + err := _KeystoneForwarder.contract.Call(opts, &out, "isForwarder", forwarder) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_KeystoneForwarder *KeystoneForwarderSession) IsForwarder(forwarder common.Address) (bool, error) { + return _KeystoneForwarder.Contract.IsForwarder(&_KeystoneForwarder.CallOpts, forwarder) +} + +func (_KeystoneForwarder *KeystoneForwarderCallerSession) IsForwarder(forwarder common.Address) (bool, error) { + return _KeystoneForwarder.Contract.IsForwarder(&_KeystoneForwarder.CallOpts, forwarder) +} + func (_KeystoneForwarder *KeystoneForwarderCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _KeystoneForwarder.contract.Call(opts, &out, "owner") @@ -315,6 +315,18 @@ func (_KeystoneForwarder *KeystoneForwarderTransactorSession) AcceptOwnership() return _KeystoneForwarder.Contract.AcceptOwnership(&_KeystoneForwarder.TransactOpts) } +func (_KeystoneForwarder *KeystoneForwarderTransactor) AddForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) { + return _KeystoneForwarder.contract.Transact(opts, "addForwarder", forwarder) +} + +func (_KeystoneForwarder *KeystoneForwarderSession) AddForwarder(forwarder common.Address) (*types.Transaction, error) { + return _KeystoneForwarder.Contract.AddForwarder(&_KeystoneForwarder.TransactOpts, forwarder) +} + +func (_KeystoneForwarder *KeystoneForwarderTransactorSession) AddForwarder(forwarder common.Address) (*types.Transaction, error) { + return _KeystoneForwarder.Contract.AddForwarder(&_KeystoneForwarder.TransactOpts, forwarder) +} + func (_KeystoneForwarder *KeystoneForwarderTransactor) ClearConfig(opts *bind.TransactOpts, donId uint32, configVersion uint32) (*types.Transaction, error) { return _KeystoneForwarder.contract.Transact(opts, "clearConfig", donId, configVersion) } @@ -327,6 +339,18 @@ func (_KeystoneForwarder *KeystoneForwarderTransactorSession) ClearConfig(donId return _KeystoneForwarder.Contract.ClearConfig(&_KeystoneForwarder.TransactOpts, donId, configVersion) } +func (_KeystoneForwarder *KeystoneForwarderTransactor) RemoveForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) { + return _KeystoneForwarder.contract.Transact(opts, "removeForwarder", forwarder) +} + +func (_KeystoneForwarder *KeystoneForwarderSession) RemoveForwarder(forwarder common.Address) (*types.Transaction, error) { + return _KeystoneForwarder.Contract.RemoveForwarder(&_KeystoneForwarder.TransactOpts, forwarder) +} + +func (_KeystoneForwarder *KeystoneForwarderTransactorSession) RemoveForwarder(forwarder common.Address) (*types.Transaction, error) { + return _KeystoneForwarder.Contract.RemoveForwarder(&_KeystoneForwarder.TransactOpts, forwarder) +} + func (_KeystoneForwarder *KeystoneForwarderTransactor) Report(opts *bind.TransactOpts, receiver common.Address, rawReport []byte, reportContext []byte, signatures [][]byte) (*types.Transaction, error) { return _KeystoneForwarder.contract.Transact(opts, "report", receiver, rawReport, reportContext, signatures) } @@ -339,6 +363,18 @@ func (_KeystoneForwarder *KeystoneForwarderTransactorSession) Report(receiver co return _KeystoneForwarder.Contract.Report(&_KeystoneForwarder.TransactOpts, receiver, rawReport, reportContext, signatures) } +func (_KeystoneForwarder *KeystoneForwarderTransactor) Route(opts *bind.TransactOpts, transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, validatedReport []byte) (*types.Transaction, error) { + return _KeystoneForwarder.contract.Transact(opts, "route", transmissionId, transmitter, receiver, metadata, validatedReport) +} + +func (_KeystoneForwarder *KeystoneForwarderSession) Route(transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, validatedReport []byte) (*types.Transaction, error) { + return _KeystoneForwarder.Contract.Route(&_KeystoneForwarder.TransactOpts, transmissionId, transmitter, receiver, metadata, validatedReport) +} + +func (_KeystoneForwarder *KeystoneForwarderTransactorSession) Route(transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, validatedReport []byte) (*types.Transaction, error) { + return _KeystoneForwarder.Contract.Route(&_KeystoneForwarder.TransactOpts, transmissionId, transmitter, receiver, metadata, validatedReport) +} + func (_KeystoneForwarder *KeystoneForwarderTransactor) SetConfig(opts *bind.TransactOpts, donId uint32, configVersion uint32, f uint8, signers []common.Address) (*types.Transaction, error) { return _KeystoneForwarder.contract.Transact(opts, "setConfig", donId, configVersion, f, signers) } @@ -501,6 +537,260 @@ func (_KeystoneForwarder *KeystoneForwarderFilterer) ParseConfigSet(log types.Lo return event, nil } +type KeystoneForwarderForwarderAddedIterator struct { + Event *KeystoneForwarderForwarderAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *KeystoneForwarderForwarderAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(KeystoneForwarderForwarderAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(KeystoneForwarderForwarderAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *KeystoneForwarderForwarderAddedIterator) Error() error { + return it.fail +} + +func (it *KeystoneForwarderForwarderAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type KeystoneForwarderForwarderAdded struct { + Forwarder common.Address + Raw types.Log +} + +func (_KeystoneForwarder *KeystoneForwarderFilterer) FilterForwarderAdded(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneForwarderForwarderAddedIterator, error) { + + var forwarderRule []interface{} + for _, forwarderItem := range forwarder { + forwarderRule = append(forwarderRule, forwarderItem) + } + + logs, sub, err := _KeystoneForwarder.contract.FilterLogs(opts, "ForwarderAdded", forwarderRule) + if err != nil { + return nil, err + } + return &KeystoneForwarderForwarderAddedIterator{contract: _KeystoneForwarder.contract, event: "ForwarderAdded", logs: logs, sub: sub}, nil +} + +func (_KeystoneForwarder *KeystoneForwarderFilterer) WatchForwarderAdded(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderForwarderAdded, forwarder []common.Address) (event.Subscription, error) { + + var forwarderRule []interface{} + for _, forwarderItem := range forwarder { + forwarderRule = append(forwarderRule, forwarderItem) + } + + logs, sub, err := _KeystoneForwarder.contract.WatchLogs(opts, "ForwarderAdded", forwarderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(KeystoneForwarderForwarderAdded) + if err := _KeystoneForwarder.contract.UnpackLog(event, "ForwarderAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_KeystoneForwarder *KeystoneForwarderFilterer) ParseForwarderAdded(log types.Log) (*KeystoneForwarderForwarderAdded, error) { + event := new(KeystoneForwarderForwarderAdded) + if err := _KeystoneForwarder.contract.UnpackLog(event, "ForwarderAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type KeystoneForwarderForwarderRemovedIterator struct { + Event *KeystoneForwarderForwarderRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *KeystoneForwarderForwarderRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(KeystoneForwarderForwarderRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(KeystoneForwarderForwarderRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *KeystoneForwarderForwarderRemovedIterator) Error() error { + return it.fail +} + +func (it *KeystoneForwarderForwarderRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type KeystoneForwarderForwarderRemoved struct { + Forwarder common.Address + Raw types.Log +} + +func (_KeystoneForwarder *KeystoneForwarderFilterer) FilterForwarderRemoved(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneForwarderForwarderRemovedIterator, error) { + + var forwarderRule []interface{} + for _, forwarderItem := range forwarder { + forwarderRule = append(forwarderRule, forwarderItem) + } + + logs, sub, err := _KeystoneForwarder.contract.FilterLogs(opts, "ForwarderRemoved", forwarderRule) + if err != nil { + return nil, err + } + return &KeystoneForwarderForwarderRemovedIterator{contract: _KeystoneForwarder.contract, event: "ForwarderRemoved", logs: logs, sub: sub}, nil +} + +func (_KeystoneForwarder *KeystoneForwarderFilterer) WatchForwarderRemoved(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderForwarderRemoved, forwarder []common.Address) (event.Subscription, error) { + + var forwarderRule []interface{} + for _, forwarderItem := range forwarder { + forwarderRule = append(forwarderRule, forwarderItem) + } + + logs, sub, err := _KeystoneForwarder.contract.WatchLogs(opts, "ForwarderRemoved", forwarderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(KeystoneForwarderForwarderRemoved) + if err := _KeystoneForwarder.contract.UnpackLog(event, "ForwarderRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_KeystoneForwarder *KeystoneForwarderFilterer) ParseForwarderRemoved(log types.Log) (*KeystoneForwarderForwarderRemoved, error) { + event := new(KeystoneForwarderForwarderRemoved) + if err := _KeystoneForwarder.contract.UnpackLog(event, "ForwarderRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + type KeystoneForwarderOwnershipTransferRequestedIterator struct { Event *KeystoneForwarderOwnershipTransferRequested @@ -923,6 +1213,10 @@ func (_KeystoneForwarder *KeystoneForwarder) ParseLog(log types.Log) (generated. switch log.Topics[0] { case _KeystoneForwarder.abi.Events["ConfigSet"].ID: return _KeystoneForwarder.ParseConfigSet(log) + case _KeystoneForwarder.abi.Events["ForwarderAdded"].ID: + return _KeystoneForwarder.ParseForwarderAdded(log) + case _KeystoneForwarder.abi.Events["ForwarderRemoved"].ID: + return _KeystoneForwarder.ParseForwarderRemoved(log) case _KeystoneForwarder.abi.Events["OwnershipTransferRequested"].ID: return _KeystoneForwarder.ParseOwnershipTransferRequested(log) case _KeystoneForwarder.abi.Events["OwnershipTransferred"].ID: @@ -939,6 +1233,14 @@ func (KeystoneForwarderConfigSet) Topic() common.Hash { return common.HexToHash("0x4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a455") } +func (KeystoneForwarderForwarderAdded) Topic() common.Hash { + return common.HexToHash("0x0ea0ce2c048ff45a4a95f2947879de3fb94abec2f152190400cab2d1272a68e7") +} + +func (KeystoneForwarderForwarderRemoved) Topic() common.Hash { + return common.HexToHash("0xb96d15bf9258c7b8df062753a6a262864611fc7b060a5ee2e57e79b85f898d38") +} + func (KeystoneForwarderOwnershipTransferRequested) Topic() common.Hash { return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") } @@ -956,24 +1258,30 @@ func (_KeystoneForwarder *KeystoneForwarder) Address() common.Address { } type KeystoneForwarderInterface interface { - GetRouter(opts *bind.CallOpts) (common.Address, error) - GetTransmissionId(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) ([32]byte, error) GetTransmissionState(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (uint8, error) GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) + IsForwarder(opts *bind.CallOpts, forwarder common.Address) (bool, error) + Owner(opts *bind.CallOpts) (common.Address, error) TypeAndVersion(opts *bind.CallOpts) (string, error) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + AddForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) + ClearConfig(opts *bind.TransactOpts, donId uint32, configVersion uint32) (*types.Transaction, error) + RemoveForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) + Report(opts *bind.TransactOpts, receiver common.Address, rawReport []byte, reportContext []byte, signatures [][]byte) (*types.Transaction, error) + Route(opts *bind.TransactOpts, transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, validatedReport []byte) (*types.Transaction, error) + SetConfig(opts *bind.TransactOpts, donId uint32, configVersion uint32, f uint8, signers []common.Address) (*types.Transaction, error) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) @@ -984,6 +1292,18 @@ type KeystoneForwarderInterface interface { ParseConfigSet(log types.Log) (*KeystoneForwarderConfigSet, error) + FilterForwarderAdded(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneForwarderForwarderAddedIterator, error) + + WatchForwarderAdded(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderForwarderAdded, forwarder []common.Address) (event.Subscription, error) + + ParseForwarderAdded(log types.Log) (*KeystoneForwarderForwarderAdded, error) + + FilterForwarderRemoved(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneForwarderForwarderRemovedIterator, error) + + WatchForwarderRemoved(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderForwarderRemoved, forwarder []common.Address) (event.Subscription, error) + + ParseForwarderRemoved(log types.Log) (*KeystoneForwarderForwarderRemoved, error) + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneForwarderOwnershipTransferRequestedIterator, error) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *KeystoneForwarderOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) diff --git a/core/gethwrappers/keystone/generated/router/router.go b/core/gethwrappers/keystone/generated/router/router.go deleted file mode 100644 index 5c58af890bc..00000000000 --- a/core/gethwrappers/keystone/generated/router/router.go +++ /dev/null @@ -1,954 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package router - -import ( - "errors" - "fmt" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" -) - -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -var KeystoneRouterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderRemoved\",\"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\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"addForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"getTransmissionState\",\"outputs\":[{\"internalType\":\"enumIRouter.TransmissionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"removeForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"route\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b610aa6806101576000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c806379ba509711610076578063abcef5541161005b578063abcef554146101c7578063e6b7145814610200578063f2fde38b1461023657600080fd5b806379ba5097146101805780638da5cb5b1461018857600080fd5b80634d93172d116100a75780634d93172d14610138578063516db4081461014d5780635c41d2fe1461016d57600080fd5b8063181f5a77146100c3578063233fd52d14610115575b600080fd5b6100ff6040518060400160405280601481526020017f4b657973746f6e65526f7574657220312e302e3000000000000000000000000081525081565b60405161010c9190610834565b60405180910390f35b610128610123366004610912565b610249565b604051901515815260200161010c565b61014b6101463660046109ad565b610441565b005b61016061015b3660046109cf565b6104bd565b60405161010c91906109e8565b61014b61017b3660046109ad565b61052c565b61014b6105ab565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010c565b6101286101d53660046109ad565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205460ff1690565b6101a261020e3660046109cf565b60009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b61014b6102443660046109ad565b6106a8565b3360009081526002602052604081205460ff16610292576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008881526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16156102f6576040517fa53dc8ca000000000000000000000000000000000000000000000000000000008152600481018990526024015b60405180910390fd5b600088815260036020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a81169190911790915587163b900361035857506000610436565b6040517f805f213200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87169063805f2132906103b0908890889088908890600401610a72565b600060405180830381600087803b1580156103ca57600080fd5b505af19250505080156103db575060015b6103e757506000610436565b50600087815260036020526040902080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560015b979650505050505050565b6104496106bc565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517fb96d15bf9258c7b8df062753a6a262864611fc7b060a5ee2e57e79b85f898d389190a250565b60008181526003602052604081205473ffffffffffffffffffffffffffffffffffffffff166104ee57506000919050565b60008281526003602052604090205474010000000000000000000000000000000000000000900460ff16610523576002610526565b60015b92915050565b6105346106bc565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f0ea0ce2c048ff45a4a95f2947879de3fb94abec2f152190400cab2d1272a68e79190a250565b60015473ffffffffffffffffffffffffffffffffffffffff16331461062c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016102ed565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6106b06106bc565b6106b98161073f565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461073d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102ed565b565b3373ffffffffffffffffffffffffffffffffffffffff8216036107be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102ed565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208083528351808285015260005b8181101561086157858101830151858201604001528201610845565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146108c457600080fd5b919050565b60008083601f8401126108db57600080fd5b50813567ffffffffffffffff8111156108f357600080fd5b60208301915083602082850101111561090b57600080fd5b9250929050565b600080600080600080600060a0888a03121561092d57600080fd5b8735965061093d602089016108a0565b955061094b604089016108a0565b9450606088013567ffffffffffffffff8082111561096857600080fd5b6109748b838c016108c9565b909650945060808a013591508082111561098d57600080fd5b5061099a8a828b016108c9565b989b979a50959850939692959293505050565b6000602082840312156109bf57600080fd5b6109c8826108a0565b9392505050565b6000602082840312156109e157600080fd5b5035919050565b6020810160038310610a23577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b604081526000610a86604083018688610a29565b8281036020840152610436818587610a2956fea164736f6c6343000813000a", -} - -var KeystoneRouterABI = KeystoneRouterMetaData.ABI - -var KeystoneRouterBin = KeystoneRouterMetaData.Bin - -func DeployKeystoneRouter(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *KeystoneRouter, error) { - parsed, err := KeystoneRouterMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(KeystoneRouterBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &KeystoneRouter{address: address, abi: *parsed, KeystoneRouterCaller: KeystoneRouterCaller{contract: contract}, KeystoneRouterTransactor: KeystoneRouterTransactor{contract: contract}, KeystoneRouterFilterer: KeystoneRouterFilterer{contract: contract}}, nil -} - -type KeystoneRouter struct { - address common.Address - abi abi.ABI - KeystoneRouterCaller - KeystoneRouterTransactor - KeystoneRouterFilterer -} - -type KeystoneRouterCaller struct { - contract *bind.BoundContract -} - -type KeystoneRouterTransactor struct { - contract *bind.BoundContract -} - -type KeystoneRouterFilterer struct { - contract *bind.BoundContract -} - -type KeystoneRouterSession struct { - Contract *KeystoneRouter - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type KeystoneRouterCallerSession struct { - Contract *KeystoneRouterCaller - CallOpts bind.CallOpts -} - -type KeystoneRouterTransactorSession struct { - Contract *KeystoneRouterTransactor - TransactOpts bind.TransactOpts -} - -type KeystoneRouterRaw struct { - Contract *KeystoneRouter -} - -type KeystoneRouterCallerRaw struct { - Contract *KeystoneRouterCaller -} - -type KeystoneRouterTransactorRaw struct { - Contract *KeystoneRouterTransactor -} - -func NewKeystoneRouter(address common.Address, backend bind.ContractBackend) (*KeystoneRouter, error) { - abi, err := abi.JSON(strings.NewReader(KeystoneRouterABI)) - if err != nil { - return nil, err - } - contract, err := bindKeystoneRouter(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &KeystoneRouter{address: address, abi: abi, KeystoneRouterCaller: KeystoneRouterCaller{contract: contract}, KeystoneRouterTransactor: KeystoneRouterTransactor{contract: contract}, KeystoneRouterFilterer: KeystoneRouterFilterer{contract: contract}}, nil -} - -func NewKeystoneRouterCaller(address common.Address, caller bind.ContractCaller) (*KeystoneRouterCaller, error) { - contract, err := bindKeystoneRouter(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &KeystoneRouterCaller{contract: contract}, nil -} - -func NewKeystoneRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*KeystoneRouterTransactor, error) { - contract, err := bindKeystoneRouter(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &KeystoneRouterTransactor{contract: contract}, nil -} - -func NewKeystoneRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*KeystoneRouterFilterer, error) { - contract, err := bindKeystoneRouter(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &KeystoneRouterFilterer{contract: contract}, nil -} - -func bindKeystoneRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := KeystoneRouterMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_KeystoneRouter *KeystoneRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _KeystoneRouter.Contract.KeystoneRouterCaller.contract.Call(opts, result, method, params...) -} - -func (_KeystoneRouter *KeystoneRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _KeystoneRouter.Contract.KeystoneRouterTransactor.contract.Transfer(opts) -} - -func (_KeystoneRouter *KeystoneRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _KeystoneRouter.Contract.KeystoneRouterTransactor.contract.Transact(opts, method, params...) -} - -func (_KeystoneRouter *KeystoneRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _KeystoneRouter.Contract.contract.Call(opts, result, method, params...) -} - -func (_KeystoneRouter *KeystoneRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _KeystoneRouter.Contract.contract.Transfer(opts) -} - -func (_KeystoneRouter *KeystoneRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _KeystoneRouter.Contract.contract.Transact(opts, method, params...) -} - -func (_KeystoneRouter *KeystoneRouterCaller) GetTransmissionState(opts *bind.CallOpts, transmissionId [32]byte) (uint8, error) { - var out []interface{} - err := _KeystoneRouter.contract.Call(opts, &out, "getTransmissionState", transmissionId) - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -func (_KeystoneRouter *KeystoneRouterSession) GetTransmissionState(transmissionId [32]byte) (uint8, error) { - return _KeystoneRouter.Contract.GetTransmissionState(&_KeystoneRouter.CallOpts, transmissionId) -} - -func (_KeystoneRouter *KeystoneRouterCallerSession) GetTransmissionState(transmissionId [32]byte) (uint8, error) { - return _KeystoneRouter.Contract.GetTransmissionState(&_KeystoneRouter.CallOpts, transmissionId) -} - -func (_KeystoneRouter *KeystoneRouterCaller) GetTransmitter(opts *bind.CallOpts, transmissionId [32]byte) (common.Address, error) { - var out []interface{} - err := _KeystoneRouter.contract.Call(opts, &out, "getTransmitter", transmissionId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_KeystoneRouter *KeystoneRouterSession) GetTransmitter(transmissionId [32]byte) (common.Address, error) { - return _KeystoneRouter.Contract.GetTransmitter(&_KeystoneRouter.CallOpts, transmissionId) -} - -func (_KeystoneRouter *KeystoneRouterCallerSession) GetTransmitter(transmissionId [32]byte) (common.Address, error) { - return _KeystoneRouter.Contract.GetTransmitter(&_KeystoneRouter.CallOpts, transmissionId) -} - -func (_KeystoneRouter *KeystoneRouterCaller) IsForwarder(opts *bind.CallOpts, forwarder common.Address) (bool, error) { - var out []interface{} - err := _KeystoneRouter.contract.Call(opts, &out, "isForwarder", forwarder) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -func (_KeystoneRouter *KeystoneRouterSession) IsForwarder(forwarder common.Address) (bool, error) { - return _KeystoneRouter.Contract.IsForwarder(&_KeystoneRouter.CallOpts, forwarder) -} - -func (_KeystoneRouter *KeystoneRouterCallerSession) IsForwarder(forwarder common.Address) (bool, error) { - return _KeystoneRouter.Contract.IsForwarder(&_KeystoneRouter.CallOpts, forwarder) -} - -func (_KeystoneRouter *KeystoneRouterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _KeystoneRouter.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_KeystoneRouter *KeystoneRouterSession) Owner() (common.Address, error) { - return _KeystoneRouter.Contract.Owner(&_KeystoneRouter.CallOpts) -} - -func (_KeystoneRouter *KeystoneRouterCallerSession) Owner() (common.Address, error) { - return _KeystoneRouter.Contract.Owner(&_KeystoneRouter.CallOpts) -} - -func (_KeystoneRouter *KeystoneRouterCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _KeystoneRouter.contract.Call(opts, &out, "typeAndVersion") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -func (_KeystoneRouter *KeystoneRouterSession) TypeAndVersion() (string, error) { - return _KeystoneRouter.Contract.TypeAndVersion(&_KeystoneRouter.CallOpts) -} - -func (_KeystoneRouter *KeystoneRouterCallerSession) TypeAndVersion() (string, error) { - return _KeystoneRouter.Contract.TypeAndVersion(&_KeystoneRouter.CallOpts) -} - -func (_KeystoneRouter *KeystoneRouterTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _KeystoneRouter.contract.Transact(opts, "acceptOwnership") -} - -func (_KeystoneRouter *KeystoneRouterSession) AcceptOwnership() (*types.Transaction, error) { - return _KeystoneRouter.Contract.AcceptOwnership(&_KeystoneRouter.TransactOpts) -} - -func (_KeystoneRouter *KeystoneRouterTransactorSession) AcceptOwnership() (*types.Transaction, error) { - return _KeystoneRouter.Contract.AcceptOwnership(&_KeystoneRouter.TransactOpts) -} - -func (_KeystoneRouter *KeystoneRouterTransactor) AddForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) { - return _KeystoneRouter.contract.Transact(opts, "addForwarder", forwarder) -} - -func (_KeystoneRouter *KeystoneRouterSession) AddForwarder(forwarder common.Address) (*types.Transaction, error) { - return _KeystoneRouter.Contract.AddForwarder(&_KeystoneRouter.TransactOpts, forwarder) -} - -func (_KeystoneRouter *KeystoneRouterTransactorSession) AddForwarder(forwarder common.Address) (*types.Transaction, error) { - return _KeystoneRouter.Contract.AddForwarder(&_KeystoneRouter.TransactOpts, forwarder) -} - -func (_KeystoneRouter *KeystoneRouterTransactor) RemoveForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) { - return _KeystoneRouter.contract.Transact(opts, "removeForwarder", forwarder) -} - -func (_KeystoneRouter *KeystoneRouterSession) RemoveForwarder(forwarder common.Address) (*types.Transaction, error) { - return _KeystoneRouter.Contract.RemoveForwarder(&_KeystoneRouter.TransactOpts, forwarder) -} - -func (_KeystoneRouter *KeystoneRouterTransactorSession) RemoveForwarder(forwarder common.Address) (*types.Transaction, error) { - return _KeystoneRouter.Contract.RemoveForwarder(&_KeystoneRouter.TransactOpts, forwarder) -} - -func (_KeystoneRouter *KeystoneRouterTransactor) Route(opts *bind.TransactOpts, transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, report []byte) (*types.Transaction, error) { - return _KeystoneRouter.contract.Transact(opts, "route", transmissionId, transmitter, receiver, metadata, report) -} - -func (_KeystoneRouter *KeystoneRouterSession) Route(transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, report []byte) (*types.Transaction, error) { - return _KeystoneRouter.Contract.Route(&_KeystoneRouter.TransactOpts, transmissionId, transmitter, receiver, metadata, report) -} - -func (_KeystoneRouter *KeystoneRouterTransactorSession) Route(transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, report []byte) (*types.Transaction, error) { - return _KeystoneRouter.Contract.Route(&_KeystoneRouter.TransactOpts, transmissionId, transmitter, receiver, metadata, report) -} - -func (_KeystoneRouter *KeystoneRouterTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _KeystoneRouter.contract.Transact(opts, "transferOwnership", to) -} - -func (_KeystoneRouter *KeystoneRouterSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _KeystoneRouter.Contract.TransferOwnership(&_KeystoneRouter.TransactOpts, to) -} - -func (_KeystoneRouter *KeystoneRouterTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _KeystoneRouter.Contract.TransferOwnership(&_KeystoneRouter.TransactOpts, to) -} - -type KeystoneRouterForwarderAddedIterator struct { - Event *KeystoneRouterForwarderAdded - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *KeystoneRouterForwarderAddedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterForwarderAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterForwarderAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *KeystoneRouterForwarderAddedIterator) Error() error { - return it.fail -} - -func (it *KeystoneRouterForwarderAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type KeystoneRouterForwarderAdded struct { - Forwarder common.Address - Raw types.Log -} - -func (_KeystoneRouter *KeystoneRouterFilterer) FilterForwarderAdded(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneRouterForwarderAddedIterator, error) { - - var forwarderRule []interface{} - for _, forwarderItem := range forwarder { - forwarderRule = append(forwarderRule, forwarderItem) - } - - logs, sub, err := _KeystoneRouter.contract.FilterLogs(opts, "ForwarderAdded", forwarderRule) - if err != nil { - return nil, err - } - return &KeystoneRouterForwarderAddedIterator{contract: _KeystoneRouter.contract, event: "ForwarderAdded", logs: logs, sub: sub}, nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) WatchForwarderAdded(opts *bind.WatchOpts, sink chan<- *KeystoneRouterForwarderAdded, forwarder []common.Address) (event.Subscription, error) { - - var forwarderRule []interface{} - for _, forwarderItem := range forwarder { - forwarderRule = append(forwarderRule, forwarderItem) - } - - logs, sub, err := _KeystoneRouter.contract.WatchLogs(opts, "ForwarderAdded", forwarderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(KeystoneRouterForwarderAdded) - if err := _KeystoneRouter.contract.UnpackLog(event, "ForwarderAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) ParseForwarderAdded(log types.Log) (*KeystoneRouterForwarderAdded, error) { - event := new(KeystoneRouterForwarderAdded) - if err := _KeystoneRouter.contract.UnpackLog(event, "ForwarderAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type KeystoneRouterForwarderRemovedIterator struct { - Event *KeystoneRouterForwarderRemoved - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *KeystoneRouterForwarderRemovedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterForwarderRemoved) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterForwarderRemoved) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *KeystoneRouterForwarderRemovedIterator) Error() error { - return it.fail -} - -func (it *KeystoneRouterForwarderRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type KeystoneRouterForwarderRemoved struct { - Forwarder common.Address - Raw types.Log -} - -func (_KeystoneRouter *KeystoneRouterFilterer) FilterForwarderRemoved(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneRouterForwarderRemovedIterator, error) { - - var forwarderRule []interface{} - for _, forwarderItem := range forwarder { - forwarderRule = append(forwarderRule, forwarderItem) - } - - logs, sub, err := _KeystoneRouter.contract.FilterLogs(opts, "ForwarderRemoved", forwarderRule) - if err != nil { - return nil, err - } - return &KeystoneRouterForwarderRemovedIterator{contract: _KeystoneRouter.contract, event: "ForwarderRemoved", logs: logs, sub: sub}, nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) WatchForwarderRemoved(opts *bind.WatchOpts, sink chan<- *KeystoneRouterForwarderRemoved, forwarder []common.Address) (event.Subscription, error) { - - var forwarderRule []interface{} - for _, forwarderItem := range forwarder { - forwarderRule = append(forwarderRule, forwarderItem) - } - - logs, sub, err := _KeystoneRouter.contract.WatchLogs(opts, "ForwarderRemoved", forwarderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(KeystoneRouterForwarderRemoved) - if err := _KeystoneRouter.contract.UnpackLog(event, "ForwarderRemoved", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) ParseForwarderRemoved(log types.Log) (*KeystoneRouterForwarderRemoved, error) { - event := new(KeystoneRouterForwarderRemoved) - if err := _KeystoneRouter.contract.UnpackLog(event, "ForwarderRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type KeystoneRouterOwnershipTransferRequestedIterator struct { - Event *KeystoneRouterOwnershipTransferRequested - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *KeystoneRouterOwnershipTransferRequestedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterOwnershipTransferRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterOwnershipTransferRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *KeystoneRouterOwnershipTransferRequestedIterator) Error() error { - return it.fail -} - -func (it *KeystoneRouterOwnershipTransferRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type KeystoneRouterOwnershipTransferRequested struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_KeystoneRouter *KeystoneRouterFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneRouterOwnershipTransferRequestedIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _KeystoneRouter.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return &KeystoneRouterOwnershipTransferRequestedIterator{contract: _KeystoneRouter.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *KeystoneRouterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _KeystoneRouter.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(KeystoneRouterOwnershipTransferRequested) - if err := _KeystoneRouter.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) ParseOwnershipTransferRequested(log types.Log) (*KeystoneRouterOwnershipTransferRequested, error) { - event := new(KeystoneRouterOwnershipTransferRequested) - if err := _KeystoneRouter.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type KeystoneRouterOwnershipTransferredIterator struct { - Event *KeystoneRouterOwnershipTransferred - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *KeystoneRouterOwnershipTransferredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(KeystoneRouterOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *KeystoneRouterOwnershipTransferredIterator) Error() error { - return it.fail -} - -func (it *KeystoneRouterOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type KeystoneRouterOwnershipTransferred struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_KeystoneRouter *KeystoneRouterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneRouterOwnershipTransferredIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _KeystoneRouter.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return &KeystoneRouterOwnershipTransferredIterator{contract: _KeystoneRouter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *KeystoneRouterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _KeystoneRouter.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(KeystoneRouterOwnershipTransferred) - if err := _KeystoneRouter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_KeystoneRouter *KeystoneRouterFilterer) ParseOwnershipTransferred(log types.Log) (*KeystoneRouterOwnershipTransferred, error) { - event := new(KeystoneRouterOwnershipTransferred) - if err := _KeystoneRouter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -func (_KeystoneRouter *KeystoneRouter) ParseLog(log types.Log) (generated.AbigenLog, error) { - switch log.Topics[0] { - case _KeystoneRouter.abi.Events["ForwarderAdded"].ID: - return _KeystoneRouter.ParseForwarderAdded(log) - case _KeystoneRouter.abi.Events["ForwarderRemoved"].ID: - return _KeystoneRouter.ParseForwarderRemoved(log) - case _KeystoneRouter.abi.Events["OwnershipTransferRequested"].ID: - return _KeystoneRouter.ParseOwnershipTransferRequested(log) - case _KeystoneRouter.abi.Events["OwnershipTransferred"].ID: - return _KeystoneRouter.ParseOwnershipTransferred(log) - - default: - return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) - } -} - -func (KeystoneRouterForwarderAdded) Topic() common.Hash { - return common.HexToHash("0x0ea0ce2c048ff45a4a95f2947879de3fb94abec2f152190400cab2d1272a68e7") -} - -func (KeystoneRouterForwarderRemoved) Topic() common.Hash { - return common.HexToHash("0xb96d15bf9258c7b8df062753a6a262864611fc7b060a5ee2e57e79b85f898d38") -} - -func (KeystoneRouterOwnershipTransferRequested) Topic() common.Hash { - return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") -} - -func (KeystoneRouterOwnershipTransferred) Topic() common.Hash { - return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") -} - -func (_KeystoneRouter *KeystoneRouter) Address() common.Address { - return _KeystoneRouter.address -} - -type KeystoneRouterInterface interface { - GetTransmissionState(opts *bind.CallOpts, transmissionId [32]byte) (uint8, error) - - GetTransmitter(opts *bind.CallOpts, transmissionId [32]byte) (common.Address, error) - - IsForwarder(opts *bind.CallOpts, forwarder common.Address) (bool, error) - - Owner(opts *bind.CallOpts) (common.Address, error) - - TypeAndVersion(opts *bind.CallOpts) (string, error) - - AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - - AddForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) - - RemoveForwarder(opts *bind.TransactOpts, forwarder common.Address) (*types.Transaction, error) - - Route(opts *bind.TransactOpts, transmissionId [32]byte, transmitter common.Address, receiver common.Address, metadata []byte, report []byte) (*types.Transaction, error) - - TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - - FilterForwarderAdded(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneRouterForwarderAddedIterator, error) - - WatchForwarderAdded(opts *bind.WatchOpts, sink chan<- *KeystoneRouterForwarderAdded, forwarder []common.Address) (event.Subscription, error) - - ParseForwarderAdded(log types.Log) (*KeystoneRouterForwarderAdded, error) - - FilterForwarderRemoved(opts *bind.FilterOpts, forwarder []common.Address) (*KeystoneRouterForwarderRemovedIterator, error) - - WatchForwarderRemoved(opts *bind.WatchOpts, sink chan<- *KeystoneRouterForwarderRemoved, forwarder []common.Address) (event.Subscription, error) - - ParseForwarderRemoved(log types.Log) (*KeystoneRouterForwarderRemoved, error) - - FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneRouterOwnershipTransferRequestedIterator, error) - - WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *KeystoneRouterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferRequested(log types.Log) (*KeystoneRouterOwnershipTransferRequested, error) - - FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneRouterOwnershipTransferredIterator, error) - - WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *KeystoneRouterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferred(log types.Log) (*KeystoneRouterOwnershipTransferred, error) - - ParseLog(log types.Log) (generated.AbigenLog, error) - - Address() common.Address -} diff --git a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 8f31bd27c77..eca45db5753 100644 --- a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,5 +1,4 @@ GETH_VERSION: 1.13.8 -forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin eb51d0a17d036385b840872d73022269a26ce79f3515a7f4adeefe07bdf4bdcd +forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin bd15b7c5cecc87d44cac0b8414627cfb2c0e1cdd554df60a50dcb682f9a05129 keystone_capability_registry: ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.abi ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.bin cc978f3a11c405f0559cf1d371ed8a1553d9b9975e8b3915a142cc781d280823 ocr3_capability: ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin 144f23145878b95d1672e4919874eddeeaa38ce520d0edbe72c6677e39bb4741 -router: ../../../contracts/solc/v0.8.19/KeystoneRouter/KeystoneRouter.abi ../../../contracts/solc/v0.8.19/KeystoneRouter/KeystoneRouter.bin d579702bbbe3c03caf2336a9d097f691e3c9033139480e97945b1e4c5f989523 diff --git a/core/gethwrappers/keystone/go_generate.go b/core/gethwrappers/keystone/go_generate.go index e6287906443..679b678b8f2 100644 --- a/core/gethwrappers/keystone/go_generate.go +++ b/core/gethwrappers/keystone/go_generate.go @@ -5,6 +5,5 @@ package gethwrappers // Keystone //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin KeystoneForwarder forwarder -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/KeystoneRouter/KeystoneRouter.abi ../../../contracts/solc/v0.8.19/KeystoneRouter/KeystoneRouter.bin KeystoneRouter router //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin OCR3Capability ocr3_capability //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.abi ../../../contracts/solc/v0.8.19/CapabilityRegistry/CapabilityRegistry.bin CapabilityRegistry keystone_capability_registry diff --git a/core/scripts/keystone/src/01_deploy_contracts_cmd.go b/core/scripts/keystone/src/01_deploy_contracts_cmd.go index 34b8143f082..2ca60bdfaf2 100644 --- a/core/scripts/keystone/src/01_deploy_contracts_cmd.go +++ b/core/scripts/keystone/src/01_deploy_contracts_cmd.go @@ -14,12 +14,10 @@ import ( helpers "github.com/smartcontractkit/chainlink/core/scripts/common" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/router" ) type deployedContracts struct { OCRContract common.Address `json:"ocrContract"` - RouterContract common.Address `json:"routerContract"` ForwarderContract common.Address `json:"forwarderContract"` // The block number of the transaction that set the config on the OCR3 contract. We use this to replay blocks from this point on // when we load the OCR3 job specs on the nodes. @@ -109,15 +107,12 @@ func deploy( fmt.Println("Deploying keystone ocr3 contract...") ocrContract := DeployKeystoneOCR3Capability(env) - fmt.Println("Deploying keystone router contract...") - routerContract := DeployRouter(env) fmt.Println("Deploying keystone forwarder contract...") - forwarderContract := DeployForwarder(env, routerContract.Address()) + forwarderContract := DeployForwarder(env) fmt.Println("Writing deployed contract addresses to file...") contracts := deployedContracts{ OCRContract: ocrContract.Address(), - RouterContract: routerContract.Address(), ForwarderContract: forwarderContract.Address(), } jsonBytes, err := json.Marshal(contracts) @@ -126,11 +121,6 @@ func deploy( err = os.WriteFile(DeployedContractsFilePath(), jsonBytes, 0600) PanicErr(err) - // Add forwarder to router allow list - tx, err := routerContract.AddForwarder(env.Owner, forwarderContract.Address()) - PanicErr(err) - _ = helpers.ConfirmTXMined(context.Background(), env.Ec, tx, env.ChainID) - setOCR3Config(env, ocrConfig) if skipFunding { @@ -199,16 +189,8 @@ func DeployedContractsFilePath() string { return filepath.Join(artefactsDir, deployedContractsJSON) } -func DeployRouter(e helpers.Environment) *router.KeystoneRouter { - _, tx, contract, err := router.DeployKeystoneRouter(e.Owner, e.Ec) - PanicErr(err) - helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) - - return contract -} - -func DeployForwarder(e helpers.Environment, routerAddress common.Address) *forwarder.KeystoneForwarder { - _, tx, contract, err := forwarder.DeployKeystoneForwarder(e.Owner, e.Ec, routerAddress) +func DeployForwarder(e helpers.Environment) *forwarder.KeystoneForwarder { + _, tx, contract, err := forwarder.DeployKeystoneForwarder(e.Owner, e.Ec) PanicErr(err) helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID)