From 2ee92dacd24eeb31f7ee628f40e74d9ac32c814b Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 14:00:18 +0200 Subject: [PATCH 1/7] rename CCIPConfig to CCIPHome rename configCount to version remove ERC165 remove CCIPConfigTypes --- contracts/gas-snapshots/ccip.gas-snapshot | 114 ++-- .../{CCIPConfig.sol => CCIPHome.sol} | 223 ++++--- .../interfaces/IOCR3ConfigEncoder.sol | 6 +- .../capability/libraries/CCIPConfigTypes.sol | 68 --- .../{CCIPConfig.t.sol => CCIPHome.t.sol} | 578 +++++++++--------- .../ccip/test/helpers/CCIPConfigHelper.sol | 68 --- .../v0.8/ccip/test/helpers/CCIPHomeHelper.sol | 60 ++ 7 files changed, 533 insertions(+), 584 deletions(-) rename contracts/src/v0.8/ccip/capability/{CCIPConfig.sol => CCIPHome.sol} (71%) delete mode 100644 contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol rename contracts/src/v0.8/ccip/test/capability/{CCIPConfig.t.sol => CCIPHome.t.sol} (65%) delete mode 100644 contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol create mode 100644 contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 9861ed236c..acda477aa4 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -35,63 +35,63 @@ BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244050) BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24170) CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2052431) -CCIPConfigSetup:test_getCapabilityConfiguration_Success() (gas: 9508) -CCIPConfig_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83274) -CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354656) -CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466876) -CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433253) -CCIPConfig_ConfigStateMachine:test__groupByPluginType_TooManyOCR3Configs_Reverts() (gas: 28063) -CCIPConfig_ConfigStateMachine:test__groupByPluginType_threeCommitConfigs_Reverts() (gas: 61002) -CCIPConfig_ConfigStateMachine:test__groupByPluginType_threeExecutionConfigs_Reverts() (gas: 60940) -CCIPConfig_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11668) -CCIPConfig_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8783) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305974) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46142) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 25040) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362471) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 110001) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141606) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362211) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141673) -CCIPConfig_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9632) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1699166) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 991503) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 991534) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9665) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 16042) -CCIPConfig_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9596) -CCIPConfig_chainConfig:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 185139) -CCIPConfig_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347170) -CCIPConfig_chainConfig:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 20599) -CCIPConfig_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270867) -CCIPConfig_chainConfig:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14943) -CCIPConfig_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9617) -CCIPConfig_chainConfig:test_getPaginatedCCIPConfigs_Success() (gas: 370770) -CCIPConfig_constructor:test_constructor_Success() (gas: 3155264) -CCIPConfig_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61226) -CCIPConfig_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 22160) -CCIPConfig_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19491) -CCIPConfig_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9654) -CCIPConfig_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1039133) -CCIPConfig_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1923111) -CCIPConfig_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1923145) -CCIPConfig_validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 333177) -CCIPConfig_validateConfig:test__validateConfigSmallerFChain_Success() (gas: 464532) -CCIPConfig_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 288463) -CCIPConfig_validateConfig:test__validateConfig_ChainSelectorNotFound_Reverts() (gas: 291264) -CCIPConfig_validateConfig:test__validateConfig_ChainSelectorNotSet_Reverts() (gas: 288096) -CCIPConfig_validateConfig:test__validateConfig_FChainTooHigh_Reverts() (gas: 335512) -CCIPConfig_validateConfig:test__validateConfig_FMustBePositive_Reverts() (gas: 289648) -CCIPConfig_validateConfig:test__validateConfig_FTooHigh_Reverts() (gas: 289087) -CCIPConfig_validateConfig:test__validateConfig_NodeNotInRegistry_Reverts() (gas: 342330) -CCIPConfig_validateConfig:test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() (gas: 306844) -CCIPConfig_validateConfig:test__validateConfig_NotEnoughTransmitters_Reverts() (gas: 1209806) -CCIPConfig_validateConfig:test__validateConfig_OfframpAddressCannotBeZero_Reverts() (gas: 288202) -CCIPConfig_validateConfig:test__validateConfig_Success() (gas: 299119) -CCIPConfig_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 788872) -CCIPConfig_validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 292418) -CCIPConfig_validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 292467) -CCIPConfig_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9596) +CCIPHomeSetup:test_getCapabilityConfiguration_Success() (gas: 9508) +CCIPHome_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83274) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354656) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466876) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433253) +CCIPHome_ConfigStateMachine:test__groupByPluginType_TooManyOCR3Configs_Reverts() (gas: 28163) +CCIPHome_ConfigStateMachine:test__groupByPluginType_threeCommitConfigs_Reverts() (gas: 61102) +CCIPHome_ConfigStateMachine:test__groupByPluginType_threeExecutionConfigs_Reverts() (gas: 61040) +CCIPHome_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11668) +CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8783) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305974) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46142) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 25040) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362471) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 110001) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141606) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362211) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141673) +CCIPHome_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9632) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1699268) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 991604) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 991635) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9665) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 16142) +CCIPHome_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9596) +CCIPHome_chainConfig:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 185182) +CCIPHome_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347170) +CCIPHome_chainConfig:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 20599) +CCIPHome_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270849) +CCIPHome_chainConfig:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14921) +CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9617) +CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370770) +CCIPHome_constructor:test_constructor_Success() (gas: 3130950) +CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61194) +CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 22160) +CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19491) +CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9654) +CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1039134) +CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1923112) +CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1923146) +CCIPHome_validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 333177) +CCIPHome_validateConfig:test__validateConfigSmallerFChain_Success() (gas: 464532) +CCIPHome_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 288463) +CCIPHome_validateConfig:test__validateConfig_ChainSelectorNotFound_Reverts() (gas: 291264) +CCIPHome_validateConfig:test__validateConfig_ChainSelectorNotSet_Reverts() (gas: 288096) +CCIPHome_validateConfig:test__validateConfig_FChainTooHigh_Reverts() (gas: 335512) +CCIPHome_validateConfig:test__validateConfig_FMustBePositive_Reverts() (gas: 289648) +CCIPHome_validateConfig:test__validateConfig_FTooHigh_Reverts() (gas: 289087) +CCIPHome_validateConfig:test__validateConfig_NodeNotInRegistry_Reverts() (gas: 342330) +CCIPHome_validateConfig:test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() (gas: 306844) +CCIPHome_validateConfig:test__validateConfig_NotEnoughTransmitters_Reverts() (gas: 1209806) +CCIPHome_validateConfig:test__validateConfig_OfframpAddressCannotBeZero_Reverts() (gas: 288202) +CCIPHome_validateConfig:test__validateConfig_Success() (gas: 299119) +CCIPHome_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 788872) +CCIPHome_validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 292418) +CCIPHome_validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 292467) +CCIPHome_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9596) CommitStore_constructor:test_Constructor_Success() (gas: 2855567) CommitStore_isUnpausedAndRMNHealthy:test_RMN_Success() (gas: 73954) CommitStore_report:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 28739) diff --git a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol similarity index 71% rename from contracts/src/v0.8/ccip/capability/CCIPConfig.sol rename to contracts/src/v0.8/ccip/capability/CCIPHome.sol index 3414f4912f..6a58509543 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -7,26 +7,25 @@ import {ICapabilitiesRegistry} from "./interfaces/ICapabilitiesRegistry.sol"; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {Internal} from "../libraries/Internal.sol"; -import {CCIPConfigTypes} from "./libraries/CCIPConfigTypes.sol"; -import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol"; import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; -/// @notice CCIPConfig stores the configuration for the CCIP capability. +/// @notice CCIPHome stores the configuration for the CCIP capability. /// We have two classes of configuration: chain configuration and DON (in the CapabilitiesRegistry sense) configuration. /// Each chain will have a single configuration which includes information like the router address. /// Each CR DON will have up to four configurations: for each of (commit, exec), one blue and one green configuration. /// This is done in order to achieve "blue-green" deployments. -contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator, IERC165 { +contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { using EnumerableSet for EnumerableSet.UintSet; /// @notice Emitted when a chain's configuration is set. /// @param chainSelector The chain selector. /// @param chainConfig The chain configuration. - event ChainConfigSet(uint64 chainSelector, CCIPConfigTypes.ChainConfig chainConfig); + event ChainConfigSet(uint64 chainSelector, ChainConfig chainConfig); /// @notice Emitted when a chain's configuration is removed. /// @param chainSelector The chain selector. event ChainConfigRemoved(uint64 chainSelector); + event ConfigSet(uint32 indexed donId, uint8 indexed pluginType, OCR3ConfigWithMeta[] config); error NodeNotInRegistry(bytes32 p2pId); error OnlyCapabilitiesRegistryCanCall(); @@ -34,7 +33,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator error ChainSelectorNotSet(); error TooManyOCR3Configs(); error TooManySigners(); - error InvalidNode(CCIPConfigTypes.OCR3Node node); + error InvalidNode(OCR3Node node); error NotEnoughTransmitters(uint256 got, uint256 minimum); error FChainMustBePositive(); error FTooHigh(); @@ -42,25 +41,84 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator error InvalidPluginType(); error OfframpAddressCannotBeZero(); error InvalidConfigLength(uint256 length); - error InvalidConfigStateTransition( - CCIPConfigTypes.ConfigState currentState, CCIPConfigTypes.ConfigState proposedState - ); + error InvalidConfigStateTransition(ConfigState currentState, ConfigState proposedState); error NonExistentConfigTransition(); error WrongConfigCount(uint64 got, uint64 expected); error WrongConfigDigest(bytes32 got, bytes32 expected); error WrongConfigDigestBlueGreen(bytes32 got, bytes32 expected); error ZeroAddressNotAllowed(); - event ConfigSet(uint32 indexed donId, uint8 indexed pluginType, CCIPConfigTypes.OCR3ConfigWithMeta[] config); + /// @notice ConfigState indicates the state of the configuration. + /// A DON's configuration always starts out in the "Init" state - this is the starting state. + /// The only valid transition from "Init" is to the "Running" state - this is the first ever configuration. + /// The only valid transition from "Running" is to the "Staging" state - this is a blue/green proposal. + /// The only valid transition from "Staging" is back to the "Running" state - this is a promotion. + /// In order to rollback a configuration, we must therefore do the following: + /// - Suppose that we have a correct configuration in the "Running" state (V1). + /// - We propose a new configuration and transition to the "Staging" state (V2). + /// - V2 turns out to be buggy + /// - In the same transaction, we must: + /// - Promote V2 + /// - Re-propose V1 + /// - Promote V1 + enum ConfigState { + Init, + Running, + Staging + } + + /// @notice Chain configuration. + /// Changes to chain configuration are detected out-of-band in plugins and decoded offchain. + struct ChainConfig { + bytes32[] readers; // The P2P IDs of the readers for the chain. These IDs must be registered in the capabilities registry. + uint8 fChain; // The fault tolerance parameter of the chain. + bytes config; // The chain configuration. This is kept intentionally opaque so as to add fields in the future if needed. + } + + /// @notice Chain configuration information struct used in applyChainConfigUpdates and getAllChainConfigs. + struct ChainConfigInfo { + uint64 chainSelector; + ChainConfig chainConfig; + } + + /// @notice Represents an oracle node in OCR3 configs part of the role DON. + /// Every configured node should be a signer, but does not have to be a transmitter. + struct OCR3Node { + bytes32 p2pId; // Peer2Peer connection ID of the oracle + bytes signerKey; // On-chain signer public key + bytes transmitterKey; // On-chain transmitter public key. Can be set to empty bytes to represent that the node is a signer but not a transmitter. + } + + /// @notice OCR3 configuration. + /// Note that FRoleDON >= fChain, since FRoleDON represents the role DON, and fChain represents sub-committees. + /// FRoleDON values are typically identical across multiple OCR3 configs since the chains pertain to one role DON, + /// but FRoleDON values can change across OCR3 configs to indicate role DON splits. + struct OCR3Config { + Internal.OCRPluginType pluginType; // ─╮ The plugin that the configuration is for. + uint64 chainSelector; // | The (remote) chain that the configuration is for. + uint8 FRoleDON; // | The "big F" parameter for the role DON. + uint64 offchainConfigVersion; // ──────╯ The version of the offchain configuration. + bytes offrampAddress; // The remote chain offramp address. + OCR3Node[] nodes; // Keys & IDs of nodes part of the role DON + bytes offchainConfig; // The offchain configuration for the OCR3 protocol. Protobuf encoded. + } + + /// @notice OCR3 configuration with metadata, specifically the config count and the config digest. + struct OCR3ConfigWithMeta { + OCR3Config config; // The OCR3 configuration. + uint64 version; // The version used to compute the config digest, starts at 1 and increments by 1 for each new config. + bytes32 configDigest; // The config digest of the OCR3 configuration. + } /// @dev Type and version override. - string public constant override typeAndVersion = "CCIPConfig 1.6.0-dev"; + string public constant override typeAndVersion = "CCIPHome 1.6.0-dev"; /// @dev The canonical capabilities registry address. address internal immutable i_capabilitiesRegistry; uint8 internal constant MAX_OCR3_CONFIGS_PER_PLUGIN = 2; - uint8 internal constant MAX_OCR3_CONFIGS_PER_DON = 4; + /// @dev We have two plugins: commit and execution, for each we can store a blue and a green config. + uint8 internal constant MAX_OCR3_CONFIGS_PER_DON = 2 * MAX_OCR3_CONFIGS_PER_PLUGIN; uint256 internal constant CONFIG_DIGEST_PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..0 /// @dev must be equal to libocr multi role: https://github.com/smartcontractkit/libocr/blob/ae747ca5b81236ffdbf1714318c652e923a5ff4d/offchainreporting2plus/types/config_digest.go#L28 uint256 internal constant CONFIG_DIGEST_PREFIX = 0x000a << (256 - 16); // 0x000a00..00 @@ -69,7 +127,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator uint256 internal constant MAX_NUM_ORACLES = 256; /// @dev chain configuration for each chain that CCIP is deployed on. - mapping(uint64 chainSelector => CCIPConfigTypes.ChainConfig chainConfig) private s_chainConfigurations; + mapping(uint64 chainSelector => ChainConfig chainConfig) private s_chainConfigurations; /// @dev All chains that are configured. EnumerableSet.UintSet private s_remoteChainSelectors; @@ -77,9 +135,8 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @dev OCR3 configurations for each DON. /// Each CR DON will have a commit and execution configuration. /// This means that a DON can have up to 4 configurations, since we are implementing blue/green deployments. - mapping( - uint32 donId => mapping(Internal.OCRPluginType pluginType => CCIPConfigTypes.OCR3ConfigWithMeta[] ocr3Configs) - ) private s_ocr3Configs; + mapping(uint32 donId => mapping(Internal.OCRPluginType pluginType => OCR3ConfigWithMeta[] ocr3Configs)) private + s_ocr3Configs; /// @param capabilitiesRegistry the canonical capabilities registry address. constructor(address capabilitiesRegistry) { @@ -89,14 +146,10 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator i_capabilitiesRegistry = capabilitiesRegistry; } - /// @inheritdoc IERC165 - function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { - return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; - } - // ================================================================ // │ Config Getters │ // ================================================================ + /// @notice Returns the capabilities registry address. /// @return The capabilities registry address. function getCapabilityRegistry() external view returns (address) { @@ -113,15 +166,12 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @param pageIndex The page index. /// @param pageSize The page size. /// @return paginatedChainConfigs chain configurations. - function getAllChainConfigs( - uint256 pageIndex, - uint256 pageSize - ) external view returns (CCIPConfigTypes.ChainConfigInfo[] memory) { + function getAllChainConfigs(uint256 pageIndex, uint256 pageSize) external view returns (ChainConfigInfo[] memory) { uint256 totalItems = s_remoteChainSelectors.length(); // Total number of chain selectors uint256 startIndex = pageIndex * pageSize; if (pageSize == 0 || startIndex >= totalItems) { - return new CCIPConfigTypes.ChainConfigInfo[](0); // Return an empty array if pageSize is 0 or pageIndex is out of bounds + return new ChainConfigInfo[](0); // Return an empty array if pageSize is 0 or pageIndex is out of bounds } uint256 endIndex = startIndex + pageSize; @@ -129,16 +179,13 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator endIndex = totalItems; } - CCIPConfigTypes.ChainConfigInfo[] memory paginatedChainConfigs = - new CCIPConfigTypes.ChainConfigInfo[](endIndex - startIndex); + ChainConfigInfo[] memory paginatedChainConfigs = new ChainConfigInfo[](endIndex - startIndex); uint256[] memory chainSelectors = s_remoteChainSelectors.values(); for (uint256 i = startIndex; i < endIndex; ++i) { uint64 chainSelector = uint64(chainSelectors[i]); - paginatedChainConfigs[i - startIndex] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: chainSelector, - chainConfig: s_chainConfigurations[chainSelector] - }); + paginatedChainConfigs[i - startIndex] = + ChainConfigInfo({chainSelector: chainSelector, chainConfig: s_chainConfigurations[chainSelector]}); } return paginatedChainConfigs; @@ -151,7 +198,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator function getOCRConfig( uint32 donId, Internal.OCRPluginType pluginType - ) external view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { + ) external view returns (OCR3ConfigWithMeta[] memory) { return s_ocr3Configs[donId][pluginType]; } @@ -169,17 +216,17 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Called by the registry prior to the config being set for a particular DON. /// @dev precondition Requires destination chain config to be set function beforeCapabilityConfigSet( - bytes32[] calldata, /* nodes */ + bytes32[] calldata, // nodes bytes calldata config, - uint64, /* configCount */ + uint64, // configCount uint32 donId ) external override { if (msg.sender != i_capabilitiesRegistry) { revert OnlyCapabilitiesRegistryCanCall(); } - (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) = - _groupByPluginType(abi.decode(config, (CCIPConfigTypes.OCR3Config[]))); + (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) = + _groupByPluginType(abi.decode(config, (OCR3Config[]))); if (commitConfigs.length > 0) { _updatePluginConfig(donId, Internal.OCRPluginType.Commit, commitConfigs); } @@ -192,21 +239,17 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @param donId The DON ID. /// @param pluginType The plugin type. /// @param newConfig The new configuration. - function _updatePluginConfig( - uint32 donId, - Internal.OCRPluginType pluginType, - CCIPConfigTypes.OCR3Config[] memory newConfig - ) internal { - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = s_ocr3Configs[donId][pluginType]; + function _updatePluginConfig(uint32 donId, Internal.OCRPluginType pluginType, OCR3Config[] memory newConfig) internal { + OCR3ConfigWithMeta[] memory currentConfig = s_ocr3Configs[donId][pluginType]; // Validate the state transition being proposed, which is implicitly defined by the combination // of lengths of the current and new configurations. - CCIPConfigTypes.ConfigState currentState = _stateFromConfigLength(currentConfig.length); - CCIPConfigTypes.ConfigState proposedState = _stateFromConfigLength(newConfig.length); + ConfigState currentState = _stateFromConfigLength(currentConfig.length); + ConfigState proposedState = _stateFromConfigLength(newConfig.length); _validateConfigStateTransition(currentState, proposedState); // Build the new configuration with metadata and validate that the transition is valid. - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + OCR3ConfigWithMeta[] memory newConfigWithMeta = _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, proposedState); _validateConfigTransition(currentConfig, newConfigWithMeta); @@ -216,12 +259,12 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator for (uint256 i = 0; i < newConfigWithMeta.length; ++i) { // Struct has to be manually copied since there is a nested OCR3Node array. Direct assignment // will result in Unimplemented Feature issue. - CCIPConfigTypes.OCR3ConfigWithMeta storage ocr3ConfigWithMeta = s_ocr3Configs[donId][pluginType].push(); + OCR3ConfigWithMeta storage ocr3ConfigWithMeta = s_ocr3Configs[donId][pluginType].push(); ocr3ConfigWithMeta.configDigest = newConfigWithMeta[i].configDigest; - ocr3ConfigWithMeta.configCount = newConfigWithMeta[i].configCount; + ocr3ConfigWithMeta.version = newConfigWithMeta[i].version; - CCIPConfigTypes.OCR3Config storage ocr3Config = ocr3ConfigWithMeta.config; - CCIPConfigTypes.OCR3Config memory newOcr3Config = newConfigWithMeta[i].config; + OCR3Config storage ocr3Config = ocr3ConfigWithMeta.config; + OCR3Config memory newOcr3Config = newConfigWithMeta[i].config; ocr3Config.pluginType = newOcr3Config.pluginType; ocr3Config.chainSelector = newOcr3Config.chainSelector; ocr3Config.FRoleDON = newOcr3Config.FRoleDON; @@ -252,11 +295,11 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Determine the config state of the configuration from the length of the config. /// @param configLen The length of the configuration. /// @return The config state. - function _stateFromConfigLength(uint256 configLen) internal pure returns (CCIPConfigTypes.ConfigState) { + function _stateFromConfigLength(uint256 configLen) internal pure returns (ConfigState) { if (configLen > 2) { revert InvalidConfigLength(configLen); } - return CCIPConfigTypes.ConfigState(configLen); + return ConfigState(configLen); } /// @notice Validates the state transition between two config states. @@ -267,10 +310,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// Everything else is invalid and should revert. /// @param currentState The current state. /// @param newState The new state. - function _validateConfigStateTransition( - CCIPConfigTypes.ConfigState currentState, - CCIPConfigTypes.ConfigState newState - ) internal pure { + function _validateConfigStateTransition(ConfigState currentState, ConfigState newState) internal pure { // Calculate the difference between the new state and the current state int256 stateDiff = int256(uint256(newState)) - int256(uint256(currentState)); @@ -279,7 +319,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // 1. currentState -> newState (where stateDiff == 1) // e.g., init -> running or running -> staging // 2. staging -> running (where stateDiff == -1) - if (stateDiff == 1 || (stateDiff == -1 && currentState == CCIPConfigTypes.ConfigState.Staging)) { + if (stateDiff == 1 || (stateDiff == -1 && currentState == ConfigState.Staging)) { return; } revert InvalidConfigStateTransition(currentState, newState); @@ -289,15 +329,15 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @param currentConfig The current configuration with metadata. /// @param newConfigWithMeta The new configuration with metadata. function _validateConfigTransition( - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta + OCR3ConfigWithMeta[] memory currentConfig, + OCR3ConfigWithMeta[] memory newConfigWithMeta ) internal pure { uint256 currentConfigLen = currentConfig.length; uint256 newConfigLen = newConfigWithMeta.length; if (currentConfigLen == 0 && newConfigLen == 1) { // Config counts always must start at 1 for the first ever config. - if (newConfigWithMeta[0].configCount != 1) { - revert WrongConfigCount(newConfigWithMeta[0].configCount, 1); + if (newConfigWithMeta[0].version != 1) { + revert WrongConfigCount(newConfigWithMeta[0].version, 1); } return; } @@ -309,8 +349,8 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator if (newConfigWithMeta[0].configDigest != currentConfig[0].configDigest) { revert WrongConfigDigestBlueGreen(newConfigWithMeta[0].configDigest, currentConfig[0].configDigest); } - if (newConfigWithMeta[1].configCount != currentConfig[0].configCount + 1) { - revert WrongConfigCount(newConfigWithMeta[1].configCount, currentConfig[0].configCount + 1); + if (newConfigWithMeta[1].version != currentConfig[0].version + 1) { + revert WrongConfigCount(newConfigWithMeta[1].version, currentConfig[0].version + 1); } return; } @@ -335,38 +375,37 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @return The new configuration with metadata. function _computeNewConfigWithMeta( uint32 donId, - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, - CCIPConfigTypes.OCR3Config[] memory newConfig, - CCIPConfigTypes.ConfigState currentState, - CCIPConfigTypes.ConfigState newState - ) internal view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { + OCR3ConfigWithMeta[] memory currentConfig, + OCR3Config[] memory newConfig, + ConfigState currentState, + ConfigState newState + ) internal view returns (OCR3ConfigWithMeta[] memory) { uint64[] memory configCounts = new uint64[](newConfig.length); // Set config counts based on the only valid state transitions. // Init -> Running (first ever config) // Running -> Staging (blue/green proposal) // Staging -> Running (promotion) - if (currentState == CCIPConfigTypes.ConfigState.Init && newState == CCIPConfigTypes.ConfigState.Running) { + if (currentState == ConfigState.Init && newState == ConfigState.Running) { // First ever config starts with config count == 1. configCounts[0] = 1; - } else if (currentState == CCIPConfigTypes.ConfigState.Running && newState == CCIPConfigTypes.ConfigState.Staging) { + } else if (currentState == ConfigState.Running && newState == ConfigState.Staging) { // On a blue/green proposal, the config count of the green config is the blue config count + 1. - configCounts[0] = currentConfig[0].configCount; - configCounts[1] = currentConfig[0].configCount + 1; - } else if (currentState == CCIPConfigTypes.ConfigState.Staging && newState == CCIPConfigTypes.ConfigState.Running) { + configCounts[0] = currentConfig[0].version; + configCounts[1] = currentConfig[0].version + 1; + } else if (currentState == ConfigState.Staging && newState == ConfigState.Running) { // On a promotion, the config count of the green config becomes the blue config count. - configCounts[0] = currentConfig[1].configCount; + configCounts[0] = currentConfig[1].version; } else { revert InvalidConfigStateTransition(currentState, newState); } - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = - new CCIPConfigTypes.OCR3ConfigWithMeta[](newConfig.length); + OCR3ConfigWithMeta[] memory newConfigWithMeta = new OCR3ConfigWithMeta[](newConfig.length); for (uint256 i = 0; i < configCounts.length; ++i) { _validateConfig(newConfig[i]); - newConfigWithMeta[i] = CCIPConfigTypes.OCR3ConfigWithMeta({ + newConfigWithMeta[i] = OCR3ConfigWithMeta({ config: newConfig[i], - configCount: configCounts[i], + version: configCounts[i], configDigest: _computeConfigDigest(donId, configCounts[i], newConfig[i]) }); } @@ -379,12 +418,8 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @return commitConfigs The commit configurations. /// @return execConfigs The execution configurations. function _groupByPluginType( - CCIPConfigTypes.OCR3Config[] memory ocr3Configs - ) - internal - pure - returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) - { + OCR3Config[] memory ocr3Configs + ) internal pure returns (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) { if (ocr3Configs.length > MAX_OCR3_CONFIGS_PER_DON) { revert TooManyOCR3Configs(); } @@ -393,8 +428,8 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // If we have less we will adjust the length later using mstore. // If the caller provides more than 2 configs per plugin type, we will revert due to out of bounds // access in the for loop below. - commitConfigs = new CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); - execConfigs = new CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); + commitConfigs = new OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); + execConfigs = new OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); uint256 commitCount = 0; uint256 execCount = 0; for (uint256 i = 0; i < ocr3Configs.length; ++i) { @@ -418,7 +453,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Validates an OCR3 configuration. /// @param cfg The OCR3 configuration. - function _validateConfig(CCIPConfigTypes.OCR3Config memory cfg) internal view { + function _validateConfig(OCR3Config memory cfg) internal view { if (cfg.chainSelector == 0) revert ChainSelectorNotSet(); if (cfg.pluginType != Internal.OCRPluginType.Commit && cfg.pluginType != Internal.OCRPluginType.Execution) { revert InvalidPluginType(); @@ -446,7 +481,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator uint256 nonZeroTransmitters = 0; bytes32[] memory p2pIds = new bytes32[](numberOfNodes); for (uint256 i = 0; i < numberOfNodes; ++i) { - CCIPConfigTypes.OCR3Node memory node = cfg.nodes[i]; + OCR3Node memory node = cfg.nodes[i]; // 3 * fChain + 1 <= nonZeroTransmitters <= 3 * FRoleDON + 1 // Transmitters can be set to 0 since there can be more signers than transmitters, @@ -479,13 +514,13 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// be used on remote chains; so we use the chain selector instead of block.chainid. The don ID /// replaces the address(this) in the traditional computation. /// @param donId The DON ID. - /// @param configCount The configuration count. + /// @param version The version number of the config. /// @param ocr3Config The OCR3 configuration. /// @return The computed digest. function _computeConfigDigest( uint32 donId, - uint64 configCount, - CCIPConfigTypes.OCR3Config memory ocr3Config + uint64 version, + OCR3Config memory ocr3Config ) internal pure returns (bytes32) { uint256 h = uint256( keccak256( @@ -494,7 +529,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator donId, ocr3Config.pluginType, ocr3Config.offrampAddress, - configCount, + version, ocr3Config.nodes, ocr3Config.FRoleDON, ocr3Config.offchainConfigVersion, @@ -516,7 +551,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @param chainConfigAdds The chain configurations to add. function applyChainConfigUpdates( uint64[] calldata chainSelectorRemoves, - CCIPConfigTypes.ChainConfigInfo[] calldata chainConfigAdds + ChainConfigInfo[] calldata chainConfigAdds ) external onlyOwner { // Process removals first. for (uint256 i = 0; i < chainSelectorRemoves.length; ++i) { @@ -533,7 +568,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // Process additions next. for (uint256 i = 0; i < chainConfigAdds.length; ++i) { - CCIPConfigTypes.ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; + ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; uint64 chainSelector = chainConfigAdds[i].chainSelector; // Verify that the provided readers are present in the capabilities registry. diff --git a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol index 6d0b0f72a5..37de759a2f 100644 --- a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol +++ b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.24; -import {CCIPConfigTypes} from "../libraries/CCIPConfigTypes.sol"; +import {CCIPHome} from "../CCIPHome.sol"; /// @dev This is so that we can generate gethwrappers and easily encode/decode OCR3Config /// in the offchain integration tests. interface IOCR3ConfigEncoder { /// @dev Encodes an array of OCR3Config into a bytes array. For test usage only. - function exposeOCR3Config(CCIPConfigTypes.OCR3Config[] calldata config) external view returns (bytes memory); + function exposeOCR3Config(CCIPHome.OCR3Config[] calldata config) external view returns (bytes memory); } diff --git a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol deleted file mode 100644 index eca133f5dd..0000000000 --- a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; - -import {Internal} from "../../libraries/Internal.sol"; - -library CCIPConfigTypes { - /// @notice ConfigState indicates the state of the configuration. - /// A DON's configuration always starts out in the "Init" state - this is the starting state. - /// The only valid transition from "Init" is to the "Running" state - this is the first ever configuration. - /// The only valid transition from "Running" is to the "Staging" state - this is a blue/green proposal. - /// The only valid transition from "Staging" is back to the "Running" state - this is a promotion. - /// In order to rollback a configuration, we must therefore do the following: - /// - Suppose that we have a correct configuration in the "Running" state (V1). - /// - We propose a new configuration and transition to the "Staging" state (V2). - /// - V2 turns out to be buggy - /// - In the same transaction, we must: - /// - Promote V2 - /// - Re-propose V1 - /// - Promote V1 - enum ConfigState { - Init, - Running, - Staging - } - - /// @notice Chain configuration. - /// Changes to chain configuration are detected out-of-band in plugins and decoded offchain. - struct ChainConfig { - bytes32[] readers; // The P2P IDs of the readers for the chain. These IDs must be registered in the capabilities registry. - uint8 fChain; // The fault tolerance parameter of the chain. - bytes config; // The chain configuration. This is kept intentionally opaque so as to add fields in the future if needed. - } - - /// @notice Chain configuration information struct used in applyChainConfigUpdates and getAllChainConfigs. - struct ChainConfigInfo { - uint64 chainSelector; - ChainConfig chainConfig; - } - - /// @notice Represents an oracle node in OCR3 configs part of the role DON. - /// Every configured node should be a signer, but does not have to be a transmitter. - struct OCR3Node { - bytes32 p2pId; // Peer2Peer connection ID of the oracle - bytes signerKey; // On-chain signer public key - bytes transmitterKey; // On-chain transmitter public key. Can be set to empty bytes to represent that the node is a signer but not a transmitter. - } - - /// @notice OCR3 configuration. - /// Note that FRoleDON >= fChain, since FRoleDON represents the role DON, and fChain represents sub-committees. - /// FRoleDON values are typically identical across multiple OCR3 configs since the chains pertain to one role DON, - /// but FRoleDON values can change across OCR3 configs to indicate role DON splits. - struct OCR3Config { - Internal.OCRPluginType pluginType; // ────────╮ The plugin that the configuration is for. - uint64 chainSelector; // | The (remote) chain that the configuration is for. - uint8 FRoleDON; // | The "big F" parameter for the role DON. - uint64 offchainConfigVersion; // ─────────────╯ The version of the offchain configuration. - bytes offrampAddress; // The remote chain offramp address. - OCR3Node[] nodes; // Keys & IDs of nodes part of the role DON - bytes offchainConfig; // The offchain configuration for the OCR3 protocol. Protobuf encoded. - } - - /// @notice OCR3 configuration with metadata, specifically the config count and the config digest. - struct OCR3ConfigWithMeta { - OCR3Config config; // The OCR3 configuration. - uint64 configCount; // The config count used to compute the config digest. - bytes32 configDigest; // The config digest of the OCR3 configuration. - } -} diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol similarity index 65% rename from contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol rename to contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol index a64fee8b9a..0c6c228e4f 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol @@ -1,22 +1,21 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; -import {CCIPConfig} from "../../capability/CCIPConfig.sol"; +import {CCIPHome} from "../../capability/CCIPHome.sol"; import {ICapabilitiesRegistry} from "../../capability/interfaces/ICapabilitiesRegistry.sol"; -import {CCIPConfigTypes} from "../../capability/libraries/CCIPConfigTypes.sol"; import {Internal} from "../../libraries/Internal.sol"; -import {CCIPConfigHelper} from "../helpers/CCIPConfigHelper.sol"; +import {CCIPHomeHelper} from "../helpers/CCIPHomeHelper.sol"; import {Test} from "forge-std/Test.sol"; -contract CCIPConfigSetup is Test { +contract CCIPHomeSetup is Test { address public constant OWNER = 0x82ae2B4F57CA5C1CBF8f744ADbD3697aD1a35AFe; address public constant CAPABILITIES_REGISTRY = 0x272aF4BF7FBFc4944Ed59F914Cd864DfD912D55e; - CCIPConfigHelper public s_ccipCC; + CCIPHomeHelper public s_ccipCC; function setUp() public { changePrank(OWNER); - s_ccipCC = new CCIPConfigHelper(CAPABILITIES_REGISTRY); + s_ccipCC = new CCIPHomeHelper(CAPABILITIES_REGISTRY); } function _makeBytes32Array(uint256 length, uint256 seed) internal pure returns (bytes32[] memory arr) { @@ -43,19 +42,19 @@ contract CCIPConfigSetup is Test { return subset; } - function _addChainConfig(uint256 numNodes) internal returns (CCIPConfigTypes.OCR3Node[] memory nodes) { + function _addChainConfig(uint256 numNodes) internal returns (CCIPHome.OCR3Node[] memory nodes) { return _addChainConfig(numNodes, 1); } - function _addChainConfig(uint256 numNodes, uint8 fChain) internal returns (CCIPConfigTypes.OCR3Node[] memory nodes) { + function _addChainConfig(uint256 numNodes, uint8 fChain) internal returns (CCIPHome.OCR3Node[] memory nodes) { bytes32[] memory p2pIds = _makeBytes32Array(numNodes, 0); bytes[] memory signers = _makeBytesArray(numNodes, 10); bytes[] memory transmitters = _makeBytesArray(numNodes, 20); - nodes = new CCIPConfigTypes.OCR3Node[](numNodes); + nodes = new CCIPHome.OCR3Node[](numNodes); for (uint256 i = 0; i < numNodes; i++) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); + nodes[i] = CCIPHome.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); vm.mockCall( CAPABILITIES_REGISTRY, @@ -74,14 +73,14 @@ contract CCIPConfigSetup is Test { ); } // Add chain selector for chain 1. - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ + CCIPHome.ChainConfigInfo[] memory adds = new CCIPHome.ChainConfigInfo[](1); + adds[0] = CCIPHome.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: p2pIds, fChain: fChain, config: bytes("config1")}) + chainConfig: CCIPHome.ChainConfig({readers: p2pIds, fChain: fChain, config: bytes("config1")}) }); vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); + emit CCIPHome.ChainConfigSet(1, adds[0].chainConfig); s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); return nodes; @@ -91,32 +90,29 @@ contract CCIPConfigSetup is Test { bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters - ) internal pure returns (CCIPConfigTypes.OCR3Node[] memory nodes) { - nodes = new CCIPConfigTypes.OCR3Node[](p2pIds.length); + ) internal pure returns (CCIPHome.OCR3Node[] memory nodes) { + nodes = new CCIPHome.OCR3Node[](p2pIds.length); for (uint256 i = 0; i < p2pIds.length; i++) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); + nodes[i] = CCIPHome.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); } return nodes; } function _assertOCR3ConfigWithMetaEqual( - CCIPConfigTypes.OCR3ConfigWithMeta[] memory a, - CCIPConfigTypes.OCR3ConfigWithMeta[] memory b + CCIPHome.OCR3ConfigWithMeta[] memory a, + CCIPHome.OCR3ConfigWithMeta[] memory b ) internal pure { assertEq(a.length, b.length, "OCR3ConfigWithMeta lengths do no match"); for (uint256 i = 0; i < a.length; ++i) { _assertOCR3ConfigEqual(a[i].config, b[i].config); - assertEq(a[i].configCount, b[i].configCount, "configCount must match"); + assertEq(a[i].version, b[i].version, "configCount must match"); assertEq(a[i].configDigest, b[i].configDigest, "configDigest must match"); } } - function _assertOCR3ConfigEqual( - CCIPConfigTypes.OCR3Config memory a, - CCIPConfigTypes.OCR3Config memory b - ) internal pure { + function _assertOCR3ConfigEqual(CCIPHome.OCR3Config memory a, CCIPHome.OCR3Config memory b) internal pure { assertEq(uint8(a.pluginType), uint8(b.pluginType), "pluginType must match"); assertEq(a.chainSelector, b.chainSelector, "chainSelector must match"); assertEq(a.FRoleDON, b.FRoleDON, "FRoleDON must match"); @@ -138,37 +134,37 @@ contract CCIPConfigSetup is Test { } } -contract CCIPConfig_constructor is Test { +contract CCIPHome_constructor is Test { // Successes. function test_constructor_Success() public { address capabilitiesRegistry = makeAddr("capabilitiesRegistry"); - CCIPConfigHelper ccipCC = new CCIPConfigHelper(capabilitiesRegistry); + CCIPHomeHelper ccipCC = new CCIPHomeHelper(capabilitiesRegistry); assertEq(address(ccipCC.getCapabilityRegistry()), capabilitiesRegistry); - assertEq(ccipCC.typeAndVersion(), "CCIPConfig 1.6.0-dev"); + assertEq(ccipCC.typeAndVersion(), "CCIPHome 1.6.0-dev"); } // Reverts. function test_constructor_ZeroAddressNotAllowed_Revert() public { - vm.expectRevert(CCIPConfig.ZeroAddressNotAllowed.selector); - new CCIPConfigHelper(address(0)); + vm.expectRevert(CCIPHome.ZeroAddressNotAllowed.selector); + new CCIPHomeHelper(address(0)); } } -contract CCIPConfig_chainConfig is CCIPConfigSetup { +contract CCIPHome_chainConfig is CCIPHomeSetup { // Successes. function test_applyChainConfigUpdates_addChainConfigs_Success() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ + CCIPHome.ChainConfigInfo[] memory adds = new CCIPHome.ChainConfigInfo[](2); + adds[0] = CCIPHome.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ + adds[1] = CCIPHome.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) }); vm.mockCall( CAPABILITIES_REGISTRY, @@ -186,29 +182,29 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { ) ); vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); + emit CCIPHome.ChainConfigSet(1, adds[0].chainConfig); vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); + emit CCIPHome.ChainConfigSet(2, adds[1].chainConfig); s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - CCIPConfigTypes.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(0, 2); + CCIPHome.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(0, 2); assertEq(configs.length, 2, "chain configs length must be 2"); assertEq(configs[0].chainSelector, 1, "chain selector must match"); assertEq(configs[1].chainSelector, 2, "chain selector must match"); assertEq(s_ccipCC.getNumChainConfigurations(), 2, "total chain configs must be 2"); } - function test_getPaginatedCCIPConfigs_Success() public { + function test_getPaginatedCCIPHomes_Success() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ + CCIPHome.ChainConfigInfo[] memory adds = new CCIPHome.ChainConfigInfo[](2); + adds[0] = CCIPHome.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ + adds[1] = CCIPHome.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) }); vm.mockCall( CAPABILITIES_REGISTRY, @@ -228,7 +224,7 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - CCIPConfigTypes.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(0, 2); + CCIPHome.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(0, 2); assertEq(configs.length, 2, "chain configs length must be 2"); assertEq(configs[0].chainSelector, 1, "chain selector must match"); assertEq(configs[1].chainSelector, 2, "chain selector must match"); @@ -252,14 +248,14 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { function test_applyChainConfigUpdates_removeChainConfigs_Success() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ + CCIPHome.ChainConfigInfo[] memory adds = new CCIPHome.ChainConfigInfo[](2); + adds[0] = CCIPHome.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ + adds[1] = CCIPHome.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) }); vm.mockCall( @@ -279,9 +275,9 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { ); vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); + emit CCIPHome.ChainConfigSet(1, adds[0].chainConfig); vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); + emit CCIPHome.ChainConfigSet(2, adds[1].chainConfig); s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); assertEq(s_ccipCC.getNumChainConfigurations(), 2, "total chain configs must be 2"); @@ -290,8 +286,8 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { removes[0] = uint64(1); vm.expectEmit(); - emit CCIPConfig.ChainConfigRemoved(1); - s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); + emit CCIPHome.ChainConfigRemoved(1); + s_ccipCC.applyChainConfigUpdates(removes, new CCIPHome.ChainConfigInfo[](0)); assertEq(s_ccipCC.getNumChainConfigurations(), 1, "total chain configs must be 1"); } @@ -302,17 +298,17 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { uint64[] memory removes = new uint64[](1); removes[0] = uint64(1); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.ChainSelectorNotFound.selector, 1)); - s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.ChainSelectorNotFound.selector, 1)); + s_ccipCC.applyChainConfigUpdates(removes, new CCIPHome.ChainConfigInfo[](0)); } function test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ + CCIPHome.ChainConfigInfo[] memory adds = new CCIPHome.ChainConfigInfo[](1); + adds[0] = CCIPHome.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) }); vm.mockCall( @@ -331,21 +327,21 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { ) ); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NodeNotInRegistry.selector, chainReaders[0])); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NodeNotInRegistry.selector, chainReaders[0])); s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); } function test__applyChainConfigUpdates_FChainNotPositive_Reverts() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ + CCIPHome.ChainConfigInfo[] memory adds = new CCIPHome.ChainConfigInfo[](2); + adds[0] = CCIPHome.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ + adds[1] = CCIPHome.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain }); vm.mockCall( @@ -364,16 +360,16 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { ) ); - vm.expectRevert(CCIPConfig.FChainMustBePositive.selector); + vm.expectRevert(CCIPHome.FChainMustBePositive.selector); s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); } } -contract CCIPConfig_validateConfig is CCIPConfigSetup { - function _getCorrectOCR3Config(uint8 numNodes, uint8 FRoleDON) internal returns (CCIPConfigTypes.OCR3Config memory) { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(numNodes); +contract CCIPHome_validateConfig is CCIPHomeSetup { + function _getCorrectOCR3Config(uint8 numNodes, uint8 FRoleDON) internal returns (CCIPHome.OCR3Config memory) { + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(numNodes); - return CCIPConfigTypes.OCR3Config({ + return CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -384,7 +380,7 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { }); } - function _getCorrectOCR3Config() internal returns (CCIPConfigTypes.OCR3Config memory) { + function _getCorrectOCR3Config() internal returns (CCIPHome.OCR3Config memory) { return _getCorrectOCR3Config(4, 1); } @@ -396,14 +392,14 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { function test__validateConfigLessTransmittersThanSigners_Success() public { // fChain is 1, so there should be at least 4 transmitters. - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(5, 1); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(5, 1); config.nodes[1].transmitterKey = bytes(""); s_ccipCC.validateConfig(config); } function test__validateConfigSmallerFChain_Success() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(11, 3); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(11, 3); // Set fChain to 2 _addChainConfig(4, 2); @@ -414,43 +410,43 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { // Reverts. function test__validateConfig_ChainSelectorNotSet_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.chainSelector = 0; // invalid - vm.expectRevert(CCIPConfig.ChainSelectorNotSet.selector); + vm.expectRevert(CCIPHome.ChainSelectorNotSet.selector); s_ccipCC.validateConfig(config); } function test__validateConfig_OfframpAddressCannotBeZero_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.offrampAddress = ""; // invalid - vm.expectRevert(CCIPConfig.OfframpAddressCannotBeZero.selector); + vm.expectRevert(CCIPHome.OfframpAddressCannotBeZero.selector); s_ccipCC.validateConfig(config); } function test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.offrampAddress = abi.encode(address(0)); // invalid - vm.expectRevert(CCIPConfig.OfframpAddressCannotBeZero.selector); + vm.expectRevert(CCIPHome.OfframpAddressCannotBeZero.selector); s_ccipCC.validateConfig(config); } function test__validateConfig_ChainSelectorNotFound_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.chainSelector = 2; // not set - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.ChainSelectorNotFound.selector, 2)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.ChainSelectorNotFound.selector, 2)); s_ccipCC.validateConfig(config); } function test__validateConfig_NotEnoughTransmitters_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); uint256 numberOfTransmitters = 3; // 32 > 31 (max num oracles) - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(31); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(31); // truncate transmitters to < 3 * fChain + 1 // since fChain is 1 in this case, we need to truncate to 3 transmitters. @@ -459,15 +455,15 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { } config.nodes = nodes; - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, numberOfTransmitters, 4)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NotEnoughTransmitters.selector, numberOfTransmitters, 4)); s_ccipCC.validateConfig(config); } function test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes[0].transmitterKey = bytes(""); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, 3, 4)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NotEnoughTransmitters.selector, 3, 4)); s_ccipCC.validateConfig(config); // Zero out remaining transmitters to verify error changes @@ -475,63 +471,63 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { config.nodes[i].transmitterKey = bytes(""); } - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, 0, 4)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NotEnoughTransmitters.selector, 0, 4)); s_ccipCC.validateConfig(config); } function test__validateConfig_TooManySigners_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.nodes = new CCIPConfigTypes.OCR3Node[](257); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.nodes = new CCIPHome.OCR3Node[](257); - vm.expectRevert(CCIPConfig.TooManySigners.selector); + vm.expectRevert(CCIPHome.TooManySigners.selector); s_ccipCC.validateConfig(config); } function test__validateConfig_FChainTooHigh_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.FRoleDON = 2; // too low // Set fChain to 3 _addChainConfig(4, 3); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.FChainTooHigh.selector, 3, 2)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.FChainTooHigh.selector, 3, 2)); s_ccipCC.validateConfig(config); } function test__validateConfig_FMustBePositive_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.FRoleDON = 0; // not positive - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.FChainTooHigh.selector, 1, 0)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.FChainTooHigh.selector, 1, 0)); s_ccipCC.validateConfig(config); } function test__validateConfig_FTooHigh_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.FRoleDON = 2; // too high - vm.expectRevert(CCIPConfig.FTooHigh.selector); + vm.expectRevert(CCIPHome.FTooHigh.selector); s_ccipCC.validateConfig(config); } function test__validateConfig_ZeroP2PId_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes[1].p2pId = bytes32(0); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidNode.selector, config.nodes[1])); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidNode.selector, config.nodes[1])); s_ccipCC.validateConfig(config); } function test__validateConfig_ZeroSignerKey_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes[2].signerKey = bytes(""); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidNode.selector, config.nodes[2])); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidNode.selector, config.nodes[2])); s_ccipCC.validateConfig(config); } function test__validateConfig_NodeNotInRegistry_Reverts() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); bytes32 nonExistentP2PId = keccak256("notInRegistry"); nodes[0].p2pId = nonExistentP2PId; @@ -550,37 +546,37 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { }) ) ); - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes = nodes; - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NodeNotInRegistry.selector, nonExistentP2PId)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NodeNotInRegistry.selector, nonExistentP2PId)); s_ccipCC.validateConfig(config); } } -contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { +contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { // Successful cases. function test__stateFromConfigLength_Success() public view { uint256 configLen = 0; - CCIPConfigTypes.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Init)); + CCIPHome.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); + assertEq(uint256(state), uint256(CCIPHome.ConfigState.Init)); configLen = 1; state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Running)); + assertEq(uint256(state), uint256(CCIPHome.ConfigState.Running)); configLen = 2; state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Staging)); + assertEq(uint256(state), uint256(CCIPHome.ConfigState.Staging)); } function test__validateConfigStateTransition_Success() public view { - s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Init, CCIPConfigTypes.ConfigState.Running); + s_ccipCC.validateConfigStateTransition(CCIPHome.ConfigState.Init, CCIPHome.ConfigState.Running); - s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Running, CCIPConfigTypes.ConfigState.Staging); + s_ccipCC.validateConfigStateTransition(CCIPHome.ConfigState.Running, CCIPHome.ConfigState.Staging); - s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Staging, CCIPConfigTypes.ConfigState.Running); + s_ccipCC.validateConfigStateTransition(CCIPHome.ConfigState.Staging, CCIPHome.ConfigState.Running); } function test__computeConfigDigest_Success() public view { @@ -592,12 +588,12 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfigTypes.OCR3Node[] memory nodes = new CCIPConfigTypes.OCR3Node[](4); + CCIPHome.OCR3Node[] memory nodes = new CCIPHome.OCR3Node[](4); for (uint256 i = 0; i < 4; ++i) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); + nodes[i] = CCIPHome.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); } - CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory config = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -637,14 +633,14 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfigTypes.OCR3Node[] memory nodes = new CCIPConfigTypes.OCR3Node[](4); + CCIPHome.OCR3Node[] memory nodes = new CCIPHome.OCR3Node[](4); for (uint256 i = 0; i < 4; ++i) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); + nodes[i] = CCIPHome.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); } - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](numCommitCfgs + numExecCfgs); + CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](numCommitCfgs + numExecCfgs); for (uint256 i = 0; i < numCommitCfgs; i++) { - cfgs[i] = CCIPConfigTypes.OCR3Config({ + cfgs[i] = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -655,7 +651,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { }); } for (uint256 i = 0; i < numExecCfgs; i++) { - cfgs[numCommitCfgs + i] = CCIPConfigTypes.OCR3Config({ + cfgs[numCommitCfgs + i] = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -665,8 +661,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: abi.encode("exec", numCommitCfgs + i) }); } - (CCIPConfigTypes.OCR3Config[] memory commitCfgs, CCIPConfigTypes.OCR3Config[] memory execCfgs) = - s_ccipCC.groupByPluginType(cfgs); + (CCIPHome.OCR3Config[] memory commitCfgs, CCIPHome.OCR3Config[] memory execCfgs) = s_ccipCC.groupByPluginType(cfgs); assertEq(commitCfgs.length, numCommitCfgs, "commitCfgs length must match"); assertEq(execCfgs.length, numExecCfgs, "execCfgs length must match"); @@ -681,11 +676,11 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__computeNewConfigWithMeta_InitToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); - newConfig[0] = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](0); + CCIPHome.OCR3Config[] memory newConfig = new CCIPHome.OCR3Config[](1); + newConfig[0] = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -694,12 +689,12 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Init; - CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPHome.ConfigState currentState = CCIPHome.ConfigState.Init; + CCIPHome.ConfigState newState = CCIPHome.ConfigState.Running; + CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta = s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); - assertEq(newConfigWithMeta[0].configCount, uint64(1), "config count must be 1"); + assertEq(newConfigWithMeta[0].version, uint64(1), "config count must be 1"); assertEq(uint8(newConfigWithMeta[0].config.pluginType), uint8(newConfig[0].pluginType), "plugin type must match"); assertEq(newConfigWithMeta[0].config.offchainConfig, newConfig[0].offchainConfig, "offchain config must match"); assertEq( @@ -713,9 +708,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__computeNewConfigWithMeta_RunningToStaging_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -724,7 +719,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -734,27 +729,27 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](2); + CCIPHome.OCR3Config[] memory newConfig = new CCIPHome.OCR3Config[](2); // existing blue config first. newConfig[0] = blueConfig; // green config next. newConfig[1] = greenConfig; - CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Running; - CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Staging; + CCIPHome.ConfigState currentState = CCIPHome.ConfigState.Running; + CCIPHome.ConfigState newState = CCIPHome.ConfigState.Staging; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta = s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); assertEq(newConfigWithMeta.length, 2, "new config with meta length must be 2"); - assertEq(newConfigWithMeta[0].configCount, uint64(1), "config count of blue must be 1"); + assertEq(newConfigWithMeta[0].version, uint64(1), "config count of blue must be 1"); assertEq( uint8(newConfigWithMeta[0].config.pluginType), uint8(blueConfig.pluginType), "plugin type of blue must match" ); @@ -767,7 +762,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { "config digest of blue must match" ); - assertEq(newConfigWithMeta[1].configCount, uint64(2), "config count of green must be 2"); + assertEq(newConfigWithMeta[1].version, uint64(2), "config count of green must be 2"); assertEq( uint8(newConfigWithMeta[1].config.pluginType), uint8(greenConfig.pluginType), "plugin type of green must match" ); @@ -785,9 +780,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__computeNewConfigWithMeta_StagingToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -796,7 +791,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -806,28 +801,28 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + currentConfig[1] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); + CCIPHome.OCR3Config[] memory newConfig = new CCIPHome.OCR3Config[](1); newConfig[0] = greenConfig; - CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Staging; - CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; + CCIPHome.ConfigState currentState = CCIPHome.ConfigState.Staging; + CCIPHome.ConfigState newState = CCIPHome.ConfigState.Running; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta = s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); - assertEq(newConfigWithMeta[0].configCount, uint64(2), "config count must be 2"); + assertEq(newConfigWithMeta[0].version, uint64(2), "config count must be 2"); assertEq(uint8(newConfigWithMeta[0].config.pluginType), uint8(greenConfig.pluginType), "plugin type must match"); assertEq(newConfigWithMeta[0].config.offchainConfig, greenConfig.offchainConfig, "offchain config must match"); assertEq( @@ -839,9 +834,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__validateConfigTransition_InitToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -851,21 +846,21 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](0); s_ccipCC.validateConfigTransition(currentConfig, newConfig); } function test__validateConfigTransition_RunningToStaging_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -874,7 +869,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -884,21 +879,21 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + newConfig[1] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); @@ -907,9 +902,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__validateConfigTransition_StagingToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -918,7 +913,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -928,21 +923,21 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + currentConfig[1] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); @@ -954,7 +949,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test_Fuzz__stateFromConfigLength_Reverts(uint256 configLen) public { vm.assume(configLen > 2); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigLength.selector, configLen)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidConfigLength.selector, configLen)); s_ccipCC.stateFromConfigLength(configLen); } @@ -962,9 +957,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); + CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](3); for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPConfigTypes.OCR3Config({ + cfgs[i] = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -982,9 +977,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); + CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](3); for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPConfigTypes.OCR3Config({ + cfgs[i] = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -999,14 +994,14 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__groupByPluginType_TooManyOCR3Configs_Reverts() public { - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](5); - vm.expectRevert(CCIPConfig.TooManyOCR3Configs.selector); + CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](5); + vm.expectRevert(CCIPHome.TooManyOCR3Configs.selector); s_ccipCC.groupByPluginType(cfgs); } function test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() public { uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1019,21 +1014,21 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 0, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 0, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](0); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.WrongConfigCount.selector, 0, 1)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.WrongConfigCount.selector, 0, 1)); s_ccipCC.validateConfigTransition(currentConfig, newConfig); } function test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() public { uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1042,7 +1037,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1055,28 +1050,28 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 3, blueConfig) // wrong config digest (due to diff config count) }); - newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + newConfig[1] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); vm.expectRevert( abi.encodeWithSelector( - CCIPConfig.WrongConfigDigestBlueGreen.selector, + CCIPHome.WrongConfigDigestBlueGreen.selector, s_ccipCC.computeConfigDigest(donId, 3, blueConfig), s_ccipCC.computeConfigDigest(donId, 1, blueConfig) ) @@ -1086,7 +1081,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() public { uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1095,7 +1090,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1105,32 +1100,32 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 3, // wrong config count + newConfig[1] = CCIPHome.OCR3ConfigWithMeta({ + version: 3, // wrong config count config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) }); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.WrongConfigCount.selector, 3, 2)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.WrongConfigCount.selector, 3, 2)); s_ccipCC.validateConfigTransition(currentConfig, newConfig); } function test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() public { uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1139,7 +1134,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1149,28 +1144,28 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + currentConfig[1] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPHome.OCR3ConfigWithMeta({ + version: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) // wrong config digest }); vm.expectRevert( abi.encodeWithSelector( - CCIPConfig.WrongConfigDigest.selector, + CCIPHome.WrongConfigDigest.selector, s_ccipCC.computeConfigDigest(donId, 3, greenConfig), s_ccipCC.computeConfigDigest(donId, 2, greenConfig) ) @@ -1179,20 +1174,20 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__validateConfigTransition_NonExistentConfigTransition_Reverts() public { - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](3); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - vm.expectRevert(CCIPConfig.NonExistentConfigTransition.selector); + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig = new CCIPHome.OCR3ConfigWithMeta[](3); + CCIPHome.OCR3ConfigWithMeta[] memory newConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + vm.expectRevert(CCIPHome.NonExistentConfigTransition.selector); s_ccipCC.validateConfigTransition(currentConfig, newConfig); } } -contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { +contract CCIPHome_updatePluginConfig is CCIPHomeSetup { // Successes. function test_updatePluginConfig_InitToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1201,32 +1196,31 @@ contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); + CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](1); configs[0] = blueConfig; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - expectedConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + CCIPHome.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPHome.OCR3ConfigWithMeta[](1); + expectedConfig[0] = CCIPHome.OCR3ConfigWithMeta({ config: blueConfig, - configCount: 1, + version: 1, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); vm.expectEmit(); - emit CCIPConfig.ConfigSet(donId, uint8(Internal.OCRPluginType.Commit), expectedConfig); + emit CCIPHome.ConfigSet(donId, uint8(Internal.OCRPluginType.Commit), expectedConfig); s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, configs); // should see the updated config in the contract state. - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = - s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + CCIPHome.OCR3ConfigWithMeta[] memory storedConfig = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); _assertOCR3ConfigWithMetaEqual(storedConfig, expectedConfig); } function test_updatePluginConfig_RunningToStaging_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); // add blue config. uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1235,12 +1229,12 @@ contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.OCR3Config[](1); + CCIPHome.OCR3Config[] memory startConfigs = new CCIPHome.OCR3Config[](1); startConfigs[0] = blueConfig; // add blue AND green config to indicate an update. s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, startConfigs); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1249,39 +1243,38 @@ contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); + CCIPHome.OCR3Config[] memory blueAndGreen = new CCIPHome.OCR3Config[](2); blueAndGreen[0] = blueConfig; blueAndGreen[1] = greenConfig; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - expectedConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + CCIPHome.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + expectedConfig[0] = CCIPHome.OCR3ConfigWithMeta({ config: blueConfig, - configCount: 1, + version: 1, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - expectedConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + expectedConfig[1] = CCIPHome.OCR3ConfigWithMeta({ config: greenConfig, - configCount: 2, + version: 2, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); vm.expectEmit(); - emit CCIPConfig.ConfigSet(donId, uint8(Internal.OCRPluginType.Commit), expectedConfig); + emit CCIPHome.ConfigSet(donId, uint8(Internal.OCRPluginType.Commit), expectedConfig); s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, blueAndGreen); // should see the updated config in the contract state. - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = - s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + CCIPHome.OCR3ConfigWithMeta[] memory storedConfig = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); _assertOCR3ConfigWithMetaEqual(storedConfig, expectedConfig); } function test_updatePluginConfig_StagingToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); // add blue config. uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1290,12 +1283,12 @@ contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.OCR3Config[](1); + CCIPHome.OCR3Config[] memory startConfigs = new CCIPHome.OCR3Config[](1); startConfigs[0] = blueConfig; // add blue AND green config to indicate an update. s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, startConfigs); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory greenConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1304,30 +1297,29 @@ contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit-new") }); - CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); + CCIPHome.OCR3Config[] memory blueAndGreen = new CCIPHome.OCR3Config[](2); blueAndGreen[0] = blueConfig; blueAndGreen[1] = greenConfig; - CCIPConfigTypes.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - expectedConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + CCIPHome.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPHome.OCR3ConfigWithMeta[](2); + expectedConfig[0] = CCIPHome.OCR3ConfigWithMeta({ config: blueConfig, - configCount: 1, + version: 1, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - expectedConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + expectedConfig[1] = CCIPHome.OCR3ConfigWithMeta({ config: greenConfig, - configCount: 2, + version: 2, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); vm.expectEmit(); - emit CCIPConfig.ConfigSet(donId, uint8(Internal.OCRPluginType.Commit), expectedConfig); + emit CCIPHome.ConfigSet(donId, uint8(Internal.OCRPluginType.Commit), expectedConfig); s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, blueAndGreen); // should see the updated config in the contract state. - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = - s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + CCIPHome.OCR3ConfigWithMeta[] memory storedConfig = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); _assertOCR3ConfigWithMetaEqual(storedConfig, expectedConfig); } @@ -1335,36 +1327,36 @@ contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { // Reverts. function test__updatePluginConfig_InvalidConfigLength_Reverts() public { uint32 donId = 1; - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](3); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigLength.selector, uint256(3))); + CCIPHome.OCR3Config[] memory newConfig = new CCIPHome.OCR3Config[](3); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidConfigLength.selector, uint256(3))); s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); } function test__updatePluginConfig_InvalidConfigStateTransition_Reverts() public { uint32 donId = 1; - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](2); + CCIPHome.OCR3Config[] memory newConfig = new CCIPHome.OCR3Config[](2); // 0 -> 2 is an invalid state transition. - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigStateTransition.selector, 0, 2)); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidConfigStateTransition.selector, 0, 2)); s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); } } -contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { +contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup { // Successes. function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public { changePrank(CAPABILITIES_REGISTRY); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](0); + CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](0); bytes memory encodedConfigs = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encodedConfigs, 1, 1); } function test_beforeCapabilityConfigSet_CommitConfigOnly_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); changePrank(CAPABILITIES_REGISTRY); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1373,27 +1365,26 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); + CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](1); configs[0] = blueConfig; bytes memory encoded = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfigs = - s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + CCIPHome.OCR3ConfigWithMeta[] memory storedConfigs = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfigs.length, 1, "config length must be 1"); - assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq(storedConfigs[0].version, uint64(1), "config count must be 1"); assertEq( uint256(storedConfigs[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must be commit" ); } function test_beforeCapabilityConfigSet_ExecConfigOnly_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); changePrank(CAPABILITIES_REGISTRY); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1402,16 +1393,15 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("exec") }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); + CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](1); configs[0] = blueConfig; bytes memory encoded = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfigs = - s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); + CCIPHome.OCR3ConfigWithMeta[] memory storedConfigs = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); assertEq(storedConfigs.length, 1, "config length must be 1"); - assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq(storedConfigs[0].version, uint64(1), "config count must be 1"); assertEq( uint256(storedConfigs[0].config.pluginType), uint256(Internal.OCRPluginType.Execution), @@ -1420,11 +1410,11 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { } function test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); changePrank(CAPABILITIES_REGISTRY); uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueCommitConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueCommitConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1433,7 +1423,7 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfigTypes.OCR3Config memory blueExecConfig = CCIPConfigTypes.OCR3Config({ + CCIPHome.OCR3Config memory blueExecConfig = CCIPHome.OCR3Config({ pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, @@ -1442,27 +1432,27 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("exec") }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](2); + CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](2); configs[0] = blueExecConfig; configs[1] = blueCommitConfig; bytes memory encoded = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedExecConfigs = + CCIPHome.OCR3ConfigWithMeta[] memory storedExecConfigs = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); assertEq(storedExecConfigs.length, 1, "config length must be 1"); - assertEq(storedExecConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq(storedExecConfigs[0].version, uint64(1), "config count must be 1"); assertEq( uint256(storedExecConfigs[0].config.pluginType), uint256(Internal.OCRPluginType.Execution), "plugin type must be execution" ); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedCommitConfigs = + CCIPHome.OCR3ConfigWithMeta[] memory storedCommitConfigs = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedCommitConfigs.length, 1, "config length must be 1"); - assertEq(storedCommitConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq(storedCommitConfigs[0].version, uint64(1), "config count must be 1"); assertEq( uint256(storedCommitConfigs[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), @@ -1477,7 +1467,7 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { bytes memory config = bytes(""); uint64 configCount = 1; uint32 donId = 1; - vm.expectRevert(CCIPConfig.OnlyCapabilitiesRegistryCanCall.selector); + vm.expectRevert(CCIPHome.OnlyCapabilitiesRegistryCanCall.selector); s_ccipCC.beforeCapabilityConfigSet(nodes, config, configCount, donId); } } diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol deleted file mode 100644 index efade5190b..0000000000 --- a/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.24; - -import {CCIPConfig} from "../../capability/CCIPConfig.sol"; -import {CCIPConfigTypes} from "../../capability/libraries/CCIPConfigTypes.sol"; -import {Internal} from "../../libraries/Internal.sol"; - -contract CCIPConfigHelper is CCIPConfig { - constructor(address capabilitiesRegistry) CCIPConfig(capabilitiesRegistry) {} - - function stateFromConfigLength(uint256 configLength) public pure returns (CCIPConfigTypes.ConfigState) { - return _stateFromConfigLength(configLength); - } - - function validateConfigStateTransition( - CCIPConfigTypes.ConfigState currentState, - CCIPConfigTypes.ConfigState newState - ) public pure { - _validateConfigStateTransition(currentState, newState); - } - - function validateConfigTransition( - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta - ) public pure { - _validateConfigTransition(currentConfig, newConfigWithMeta); - } - - function computeNewConfigWithMeta( - uint32 donId, - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, - CCIPConfigTypes.OCR3Config[] memory newConfig, - CCIPConfigTypes.ConfigState currentState, - CCIPConfigTypes.ConfigState newState - ) public view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { - return _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); - } - - function groupByPluginType( - CCIPConfigTypes.OCR3Config[] memory ocr3Configs - ) - public - pure - returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) - { - return _groupByPluginType(ocr3Configs); - } - - function computeConfigDigest( - uint32 donId, - uint64 configCount, - CCIPConfigTypes.OCR3Config memory ocr3Config - ) public pure returns (bytes32) { - return _computeConfigDigest(donId, configCount, ocr3Config); - } - - function validateConfig(CCIPConfigTypes.OCR3Config memory cfg) public view { - _validateConfig(cfg); - } - - function updatePluginConfig( - uint32 donId, - Internal.OCRPluginType pluginType, - CCIPConfigTypes.OCR3Config[] memory newConfig - ) public { - _updatePluginConfig(donId, pluginType, newConfig); - } -} diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol new file mode 100644 index 0000000000..8cde09c74f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {CCIPHome} from "../../capability/CCIPHome.sol"; +import {Internal} from "../../libraries/Internal.sol"; + +contract CCIPHomeHelper is CCIPHome { + constructor(address capabilitiesRegistry) CCIPHome(capabilitiesRegistry) {} + + function stateFromConfigLength(uint256 configLength) public pure returns (CCIPHome.ConfigState) { + return _stateFromConfigLength(configLength); + } + + function validateConfigStateTransition(CCIPHome.ConfigState currentState, CCIPHome.ConfigState newState) public pure { + _validateConfigStateTransition(currentState, newState); + } + + function validateConfigTransition( + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig, + CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta + ) public pure { + _validateConfigTransition(currentConfig, newConfigWithMeta); + } + + function computeNewConfigWithMeta( + uint32 donId, + CCIPHome.OCR3ConfigWithMeta[] memory currentConfig, + CCIPHome.OCR3Config[] memory newConfig, + CCIPHome.ConfigState currentState, + CCIPHome.ConfigState newState + ) public view returns (CCIPHome.OCR3ConfigWithMeta[] memory) { + return _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + } + + function groupByPluginType( + CCIPHome.OCR3Config[] memory ocr3Configs + ) public pure returns (CCIPHome.OCR3Config[] memory commitConfigs, CCIPHome.OCR3Config[] memory execConfigs) { + return _groupByPluginType(ocr3Configs); + } + + function computeConfigDigest( + uint32 donId, + uint64 configCount, + CCIPHome.OCR3Config memory ocr3Config + ) public pure returns (bytes32) { + return _computeConfigDigest(donId, configCount, ocr3Config); + } + + function validateConfig(CCIPHome.OCR3Config memory cfg) public view { + _validateConfig(cfg); + } + + function updatePluginConfig( + uint32 donId, + Internal.OCRPluginType pluginType, + CCIPHome.OCR3Config[] memory newConfig + ) public { + _updatePluginConfig(donId, pluginType, newConfig); + } +} From d2b96ec7c8f1fedd73ddabc8017332fec8dd2ed8 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 14:10:36 +0200 Subject: [PATCH 2/7] rm _groupByPluginType, input commit and exec separate --- contracts/gas-snapshots/ccip.gas-snapshot | 69 +++++----- .../src/v0.8/ccip/capability/CCIPHome.sol | 53 ++------ .../v0.8/ccip/test/capability/CCIPHome.t.sol | 126 ++---------------- .../v0.8/ccip/test/helpers/CCIPHomeHelper.sol | 6 - 4 files changed, 57 insertions(+), 197 deletions(-) diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index acda477aa4..85c1464e3b 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -35,46 +35,43 @@ BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244050) BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24170) CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2052431) -CCIPHomeSetup:test_getCapabilityConfiguration_Success() (gas: 9508) -CCIPHome_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83274) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354656) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466876) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433253) -CCIPHome_ConfigStateMachine:test__groupByPluginType_TooManyOCR3Configs_Reverts() (gas: 28163) -CCIPHome_ConfigStateMachine:test__groupByPluginType_threeCommitConfigs_Reverts() (gas: 61102) -CCIPHome_ConfigStateMachine:test__groupByPluginType_threeExecutionConfigs_Reverts() (gas: 61040) -CCIPHome_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11668) -CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8783) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305974) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46142) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 25040) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362471) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 110001) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141606) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362211) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141673) -CCIPHome_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9632) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1699268) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 991604) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 991635) +CCIPHomeSetup:test_getCapabilityConfiguration_Success() (gas: 9551) +CCIPHome_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83249) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354619) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466942) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433238) +CCIPHome_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11646) +CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8761) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305971) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46117) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 25018) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362446) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 109995) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141578) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362163) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141645) +CCIPHome_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9740) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1698388) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 990917) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 990951) CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9665) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 16142) -CCIPHome_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9596) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 15592) +CCIPHome_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9639) CCIPHome_chainConfig:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 185182) -CCIPHome_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347170) +CCIPHome_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347148) CCIPHome_chainConfig:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 20599) -CCIPHome_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270849) +CCIPHome_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270814) CCIPHome_chainConfig:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14921) -CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9617) +CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9660) CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370770) -CCIPHome_constructor:test_constructor_Success() (gas: 3130950) -CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61194) -CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 22160) -CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19491) -CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9654) -CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1039134) -CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1923112) -CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1923146) +CCIPHome_constructor:test_constructor_Success() (gas: 3016066) +CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61051) +CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 22183) +CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19514) +CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9697) +CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1039323) +CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1923495) +CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1923529) CCIPHome_validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 333177) CCIPHome_validateConfig:test__validateConfigSmallerFChain_Success() (gas: 464532) CCIPHome_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 288463) @@ -91,7 +88,7 @@ CCIPHome_validateConfig:test__validateConfig_Success() (gas: 299119) CCIPHome_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 788872) CCIPHome_validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 292418) CCIPHome_validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 292467) -CCIPHome_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9596) +CCIPHome_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9639) CommitStore_constructor:test_Constructor_Success() (gas: 2855567) CommitStore_isUnpausedAndRMNHealthy:test_RMN_Success() (gas: 73954) CommitStore_report:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 28739) diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol index 6a58509543..ea4bfcc671 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPHome.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -39,6 +39,9 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { error FTooHigh(); error FChainTooHigh(uint256 fChain, uint256 FRoleDON); error InvalidPluginType(); + error PluginTypeMismatch( + bytes32 configDigest, Internal.OCRPluginType expectedPluginType, Internal.OCRPluginType gotPluginType + ); error OfframpAddressCannotBeZero(); error InvalidConfigLength(uint256 length); error InvalidConfigStateTransition(ConfigState currentState, ConfigState proposedState); @@ -214,6 +217,7 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { } /// @notice Called by the registry prior to the config being set for a particular DON. + /// @param config The configuration, abi encoded as (OCR3Config[] commitConfigs, OCR3Config[] execConfigs). /// @dev precondition Requires destination chain config to be set function beforeCapabilityConfigSet( bytes32[] calldata, // nodes @@ -226,7 +230,8 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { } (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) = - _groupByPluginType(abi.decode(config, (OCR3Config[]))); + abi.decode(config, (OCR3Config[], OCR3Config[])); + if (commitConfigs.length > 0) { _updatePluginConfig(donId, Internal.OCRPluginType.Commit, commitConfigs); } @@ -251,12 +256,19 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { // Build the new configuration with metadata and validate that the transition is valid. OCR3ConfigWithMeta[] memory newConfigWithMeta = _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, proposedState); + _validateConfigTransition(currentConfig, newConfigWithMeta); // Update contract state with new configuration if its valid. // We won't run out of gas from this delete since the array is at most 2 elements long. delete s_ocr3Configs[donId][pluginType]; for (uint256 i = 0; i < newConfigWithMeta.length; ++i) { + OCR3Config memory newOcr3Config = newConfigWithMeta[i].config; + + if (newOcr3Config.pluginType != pluginType) { + revert PluginTypeMismatch(newConfigWithMeta[i].configDigest, pluginType, newOcr3Config.pluginType); + } + // Struct has to be manually copied since there is a nested OCR3Node array. Direct assignment // will result in Unimplemented Feature issue. OCR3ConfigWithMeta storage ocr3ConfigWithMeta = s_ocr3Configs[donId][pluginType].push(); @@ -264,7 +276,6 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { ocr3ConfigWithMeta.version = newConfigWithMeta[i].version; OCR3Config storage ocr3Config = ocr3ConfigWithMeta.config; - OCR3Config memory newOcr3Config = newConfigWithMeta[i].config; ocr3Config.pluginType = newOcr3Config.pluginType; ocr3Config.chainSelector = newOcr3Config.chainSelector; ocr3Config.FRoleDON = newOcr3Config.FRoleDON; @@ -413,44 +424,6 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { return newConfigWithMeta; } - /// @notice Group the OCR3 configurations by plugin type for further processing. - /// @param ocr3Configs The OCR3 configurations to group. - /// @return commitConfigs The commit configurations. - /// @return execConfigs The execution configurations. - function _groupByPluginType( - OCR3Config[] memory ocr3Configs - ) internal pure returns (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) { - if (ocr3Configs.length > MAX_OCR3_CONFIGS_PER_DON) { - revert TooManyOCR3Configs(); - } - - // Declare with size 2 since we have a maximum of two configs per plugin type (blue, green). - // If we have less we will adjust the length later using mstore. - // If the caller provides more than 2 configs per plugin type, we will revert due to out of bounds - // access in the for loop below. - commitConfigs = new OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); - execConfigs = new OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); - uint256 commitCount = 0; - uint256 execCount = 0; - for (uint256 i = 0; i < ocr3Configs.length; ++i) { - if (ocr3Configs[i].pluginType == Internal.OCRPluginType.Commit) { - commitConfigs[commitCount] = ocr3Configs[i]; - ++commitCount; - } else { - execConfigs[execCount] = ocr3Configs[i]; - ++execCount; - } - } - - // Adjust the length of the arrays to the actual number of configs. - assembly { - mstore(commitConfigs, commitCount) - mstore(execConfigs, execCount) - } - - return (commitConfigs, execConfigs); - } - /// @notice Validates an OCR3 configuration. /// @param cfg The OCR3 configuration. function _validateConfig(OCR3Config memory cfg) internal view { diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol index 0c6c228e4f..9ae93b9dec 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol @@ -135,8 +135,6 @@ contract CCIPHomeSetup is Test { } contract CCIPHome_constructor is Test { - // Successes. - function test_constructor_Success() public { address capabilitiesRegistry = makeAddr("capabilitiesRegistry"); CCIPHomeHelper ccipCC = new CCIPHomeHelper(capabilitiesRegistry); @@ -153,7 +151,6 @@ contract CCIPHome_constructor is Test { } contract CCIPHome_chainConfig is CCIPHomeSetup { - // Successes. function test_applyChainConfigUpdates_addChainConfigs_Success() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); @@ -384,8 +381,6 @@ contract CCIPHome_validateConfig is CCIPHomeSetup { return _getCorrectOCR3Config(4, 1); } - // Successes. - function test__validateConfig_Success() public { s_ccipCC.validateConfig(_getCorrectOCR3Config()); } @@ -555,8 +550,6 @@ contract CCIPHome_validateConfig is CCIPHomeSetup { } contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { - // Successful cases. - function test__stateFromConfigLength_Success() public view { uint256 configLen = 0; CCIPHome.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); @@ -626,55 +619,6 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { assertNotEq(configDigest2, configDigest4, "config digests 2 and 4 must not match"); } - function test_Fuzz__groupByPluginType_Success(uint256 numCommitCfgs, uint256 numExecCfgs) public view { - numCommitCfgs = bound(numCommitCfgs, 0, 2); - numExecCfgs = bound(numExecCfgs, 0, 2); - - bytes32[] memory p2pIds = _makeBytes32Array(4, 0); - bytes[] memory signers = _makeBytesArray(4, 10); - bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPHome.OCR3Node[] memory nodes = new CCIPHome.OCR3Node[](4); - for (uint256 i = 0; i < 4; ++i) { - nodes[i] = CCIPHome.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); - } - - CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](numCommitCfgs + numExecCfgs); - for (uint256 i = 0; i < numCommitCfgs; i++) { - cfgs[i] = CCIPHome.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: abi.encode("commit", i) - }); - } - for (uint256 i = 0; i < numExecCfgs; i++) { - cfgs[numCommitCfgs + i] = CCIPHome.OCR3Config({ - pluginType: Internal.OCRPluginType.Execution, - offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: abi.encode("exec", numCommitCfgs + i) - }); - } - (CCIPHome.OCR3Config[] memory commitCfgs, CCIPHome.OCR3Config[] memory execCfgs) = s_ccipCC.groupByPluginType(cfgs); - - assertEq(commitCfgs.length, numCommitCfgs, "commitCfgs length must match"); - assertEq(execCfgs.length, numExecCfgs, "execCfgs length must match"); - for (uint256 i = 0; i < commitCfgs.length; i++) { - assertEq(uint8(commitCfgs[i].pluginType), uint8(Internal.OCRPluginType.Commit), "plugin type must be commit"); - assertEq(commitCfgs[i].offchainConfig, abi.encode("commit", i), "offchain config must match"); - } - for (uint256 i = 0; i < execCfgs.length; i++) { - assertEq(uint8(execCfgs[i].pluginType), uint8(Internal.OCRPluginType.Execution), "plugin type must be execution"); - assertEq(execCfgs[i].offchainConfig, abi.encode("exec", numCommitCfgs + i), "offchain config must match"); - } - } - function test__computeNewConfigWithMeta_InitToRunning_Success() public { CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; @@ -953,52 +897,6 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { s_ccipCC.stateFromConfigLength(configLen); } - function test__groupByPluginType_threeCommitConfigs_Reverts() public { - bytes32[] memory p2pIds = _makeBytes32Array(4, 0); - bytes[] memory signers = _makeBytesArray(4, 10); - bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](3); - for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPHome.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), - chainSelector: 1, - nodes: _constructNodesArray(p2pIds, signers, transmitters), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: abi.encode("commit", i) - }); - } - vm.expectRevert(); - s_ccipCC.groupByPluginType(cfgs); - } - - function test__groupByPluginType_threeExecutionConfigs_Reverts() public { - bytes32[] memory p2pIds = _makeBytes32Array(4, 0); - bytes[] memory signers = _makeBytesArray(4, 10); - bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](3); - for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPHome.OCR3Config({ - pluginType: Internal.OCRPluginType.Execution, - offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), - chainSelector: 1, - nodes: _constructNodesArray(p2pIds, signers, transmitters), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: abi.encode("exec", i) - }); - } - vm.expectRevert(); - s_ccipCC.groupByPluginType(cfgs); - } - - function test__groupByPluginType_TooManyOCR3Configs_Reverts() public { - CCIPHome.OCR3Config[] memory cfgs = new CCIPHome.OCR3Config[](5); - vm.expectRevert(CCIPHome.TooManyOCR3Configs.selector); - s_ccipCC.groupByPluginType(cfgs); - } - function test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() public { uint32 donId = 1; CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ @@ -1182,8 +1080,6 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { } contract CCIPHome_updatePluginConfig is CCIPHomeSetup { - // Successes. - function test_updatePluginConfig_InitToRunning_Success() public { CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); uint32 donId = 1; @@ -1342,12 +1238,11 @@ contract CCIPHome_updatePluginConfig is CCIPHomeSetup { } contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup { - // Successes. function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public { changePrank(CAPABILITIES_REGISTRY); CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](0); - bytes memory encodedConfigs = abi.encode(configs); + bytes memory encodedConfigs = abi.encode(configs, configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encodedConfigs, 1, 1); } @@ -1368,8 +1263,8 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup { CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](1); configs[0] = blueConfig; - bytes memory encoded = abi.encode(configs); - s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); + bytes memory commitAndExecConfig = abi.encode(configs, new CCIPHome.OCR3Config[](0)); + s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), commitAndExecConfig, 1, donId); CCIPHome.OCR3ConfigWithMeta[] memory storedConfigs = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfigs.length, 1, "config length must be 1"); @@ -1393,10 +1288,10 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup { offchainConfigVersion: 30, offchainConfig: bytes("exec") }); - CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](1); - configs[0] = blueConfig; + CCIPHome.OCR3Config[] memory execConfigs = new CCIPHome.OCR3Config[](1); + execConfigs[0] = blueConfig; - bytes memory encoded = abi.encode(configs); + bytes memory encoded = abi.encode(new CCIPHome.OCR3Config[](0), execConfigs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); CCIPHome.OCR3ConfigWithMeta[] memory storedConfigs = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); @@ -1432,11 +1327,12 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup { offchainConfigVersion: 30, offchainConfig: bytes("exec") }); - CCIPHome.OCR3Config[] memory configs = new CCIPHome.OCR3Config[](2); - configs[0] = blueExecConfig; - configs[1] = blueCommitConfig; + CCIPHome.OCR3Config[] memory commitConfigs = new CCIPHome.OCR3Config[](1); + CCIPHome.OCR3Config[] memory execConfigs = new CCIPHome.OCR3Config[](1); + commitConfigs[0] = blueCommitConfig; + execConfigs[0] = blueExecConfig; - bytes memory encoded = abi.encode(configs); + bytes memory encoded = abi.encode(commitConfigs, execConfigs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); CCIPHome.OCR3ConfigWithMeta[] memory storedExecConfigs = diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol index 8cde09c74f..5b00bad0c7 100644 --- a/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol @@ -32,12 +32,6 @@ contract CCIPHomeHelper is CCIPHome { return _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); } - function groupByPluginType( - CCIPHome.OCR3Config[] memory ocr3Configs - ) public pure returns (CCIPHome.OCR3Config[] memory commitConfigs, CCIPHome.OCR3Config[] memory execConfigs) { - return _groupByPluginType(ocr3Configs); - } - function computeConfigDigest( uint32 donId, uint64 configCount, From 4533ed664f7c4110a36ca059401200a9a6149807 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 14:32:54 +0200 Subject: [PATCH 3/7] remove unusual node filling logic --- contracts/src/v0.8/ccip/capability/CCIPHome.sol | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol index ea4bfcc671..200f263fd8 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPHome.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -283,16 +283,8 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { ocr3Config.offrampAddress = newOcr3Config.offrampAddress; ocr3Config.offchainConfig = newOcr3Config.offchainConfig; - // Remove all excess nodes - while (ocr3Config.nodes.length > newOcr3Config.nodes.length) { - ocr3Config.nodes.pop(); - } - - // Assign nodes for (uint256 j = 0; j < newOcr3Config.nodes.length; ++j) { - if (j >= ocr3Config.nodes.length) { - ocr3Config.nodes.push(newOcr3Config.nodes[j]); - } + ocr3Config.nodes.push(newOcr3Config.nodes[j]); } } From 08f2d3511c2bd425831b89fb8d789974e27cdd38 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 14:45:29 +0200 Subject: [PATCH 4/7] don't pass in derivable values --- contracts/gas-snapshots/ccip.gas-snapshot | 63 +++++++++---------- .../src/v0.8/ccip/capability/CCIPHome.sol | 35 ++++------- .../v0.8/ccip/test/capability/CCIPHome.t.sol | 35 ++--------- .../v0.8/ccip/test/helpers/CCIPHomeHelper.sol | 10 +-- 4 files changed, 49 insertions(+), 94 deletions(-) diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 85c1464e3b..8a3d59a418 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -35,43 +35,42 @@ BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244050) BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24170) CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2052431) -CCIPHomeSetup:test_getCapabilityConfiguration_Success() (gas: 9551) +CCIPHomeSetup:test_getCapabilityConfiguration_Success() (gas: 9485) CCIPHome_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83249) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354619) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466942) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433238) -CCIPHome_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11646) -CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8761) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305971) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46117) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 25018) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362446) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 109995) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141578) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362163) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141645) -CCIPHome_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9740) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1698388) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 990917) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 990951) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354552) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466897) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433263) +CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8670) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305949) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46160) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 24996) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362424) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 109973) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141534) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362141) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141601) +CCIPHome_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9652) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1696904) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 990175) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 990209) CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9665) CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 15592) -CCIPHome_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9639) +CCIPHome_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9573) CCIPHome_chainConfig:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 185182) -CCIPHome_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347148) +CCIPHome_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347214) CCIPHome_chainConfig:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 20599) -CCIPHome_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270814) +CCIPHome_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270849) CCIPHome_chainConfig:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14921) -CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9660) -CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370770) -CCIPHome_constructor:test_constructor_Success() (gas: 3016066) -CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61051) -CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 22183) -CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19514) -CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9697) -CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1039323) -CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1923495) -CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1923529) +CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9594) +CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370990) +CCIPHome_constructor:test_constructor_Success() (gas: 2957125) +CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 60980) +CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 19611) +CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19418) +CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9631) +CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1038558) +CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1921768) +CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1921802) CCIPHome_validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 333177) CCIPHome_validateConfig:test__validateConfigSmallerFChain_Success() (gas: 464532) CCIPHome_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 288463) @@ -88,7 +87,7 @@ CCIPHome_validateConfig:test__validateConfig_Success() (gas: 299119) CCIPHome_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 788872) CCIPHome_validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 292418) CCIPHome_validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 292467) -CCIPHome_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9639) +CCIPHome_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9573) CommitStore_constructor:test_Constructor_Success() (gas: 2855567) CommitStore_isUnpausedAndRMNHealthy:test_RMN_Success() (gas: 73954) CommitStore_report:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 28739) diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol index 200f263fd8..993f7f2981 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPHome.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -245,17 +245,14 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { /// @param pluginType The plugin type. /// @param newConfig The new configuration. function _updatePluginConfig(uint32 donId, Internal.OCRPluginType pluginType, OCR3Config[] memory newConfig) internal { + // There can be at most MAX_OCR3_CONFIGS_PER_PLUGIN configurations per plugin type. + if (newConfig.length > MAX_OCR3_CONFIGS_PER_PLUGIN) { + revert InvalidConfigLength(newConfig.length); + } OCR3ConfigWithMeta[] memory currentConfig = s_ocr3Configs[donId][pluginType]; - // Validate the state transition being proposed, which is implicitly defined by the combination - // of lengths of the current and new configurations. - ConfigState currentState = _stateFromConfigLength(currentConfig.length); - ConfigState proposedState = _stateFromConfigLength(newConfig.length); - _validateConfigStateTransition(currentState, proposedState); - // Build the new configuration with metadata and validate that the transition is valid. - OCR3ConfigWithMeta[] memory newConfigWithMeta = - _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, proposedState); + OCR3ConfigWithMeta[] memory newConfigWithMeta = _computeNewConfigWithMeta(donId, currentConfig, newConfig); _validateConfigTransition(currentConfig, newConfigWithMeta); @@ -295,16 +292,6 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { // │ Config State Machine │ // ================================================================ - /// @notice Determine the config state of the configuration from the length of the config. - /// @param configLen The length of the configuration. - /// @return The config state. - function _stateFromConfigLength(uint256 configLen) internal pure returns (ConfigState) { - if (configLen > 2) { - revert InvalidConfigLength(configLen); - } - return ConfigState(configLen); - } - /// @notice Validates the state transition between two config states. /// The only valid state transitions are the following: /// Init -> Running (first ever config) @@ -373,16 +360,18 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { /// @param donId The DON ID. /// @param currentConfig The current configuration, including metadata. /// @param newConfig The new configuration, without metadata. - /// @param currentState The current state of the configuration. - /// @param newState The new state of the configuration. /// @return The new configuration with metadata. function _computeNewConfigWithMeta( uint32 donId, OCR3ConfigWithMeta[] memory currentConfig, - OCR3Config[] memory newConfig, - ConfigState currentState, - ConfigState newState + OCR3Config[] memory newConfig ) internal view returns (OCR3ConfigWithMeta[] memory) { + ConfigState currentState = ConfigState(currentConfig.length); + ConfigState newState = ConfigState(newConfig.length); + // Validate the state transition being proposed, which is implicitly defined by the combination + // of lengths of the current and new configurations. + _validateConfigStateTransition(currentState, newState); + uint64[] memory configCounts = new uint64[](newConfig.length); // Set config counts based on the only valid state transitions. diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol index 9ae93b9dec..187a22e431 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol @@ -550,20 +550,6 @@ contract CCIPHome_validateConfig is CCIPHomeSetup { } contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { - function test__stateFromConfigLength_Success() public view { - uint256 configLen = 0; - CCIPHome.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPHome.ConfigState.Init)); - - configLen = 1; - state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPHome.ConfigState.Running)); - - configLen = 2; - state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPHome.ConfigState.Staging)); - } - function test__validateConfigStateTransition_Success() public view { s_ccipCC.validateConfigStateTransition(CCIPHome.ConfigState.Init, CCIPHome.ConfigState.Running); @@ -633,10 +619,9 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPHome.ConfigState currentState = CCIPHome.ConfigState.Init; - CCIPHome.ConfigState newState = CCIPHome.ConfigState.Running; + CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta = - s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig); assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); assertEq(newConfigWithMeta[0].version, uint64(1), "config count must be 1"); assertEq(uint8(newConfigWithMeta[0].config.pluginType), uint8(newConfig[0].pluginType), "plugin type must match"); @@ -686,11 +671,8 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { // green config next. newConfig[1] = greenConfig; - CCIPHome.ConfigState currentState = CCIPHome.ConfigState.Running; - CCIPHome.ConfigState newState = CCIPHome.ConfigState.Staging; - CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta = - s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig); assertEq(newConfigWithMeta.length, 2, "new config with meta length must be 2"); assertEq(newConfigWithMeta[0].version, uint64(1), "config count of blue must be 1"); @@ -759,11 +741,8 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { CCIPHome.OCR3Config[] memory newConfig = new CCIPHome.OCR3Config[](1); newConfig[0] = greenConfig; - CCIPHome.ConfigState currentState = CCIPHome.ConfigState.Staging; - CCIPHome.ConfigState newState = CCIPHome.ConfigState.Running; - CCIPHome.OCR3ConfigWithMeta[] memory newConfigWithMeta = - s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig); assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); assertEq(newConfigWithMeta[0].version, uint64(2), "config count must be 2"); @@ -891,12 +870,6 @@ contract CCIPHome_ConfigStateMachine is CCIPHomeSetup { // Reverts. - function test_Fuzz__stateFromConfigLength_Reverts(uint256 configLen) public { - vm.assume(configLen > 2); - vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidConfigLength.selector, configLen)); - s_ccipCC.stateFromConfigLength(configLen); - } - function test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() public { uint32 donId = 1; CCIPHome.OCR3Config memory blueConfig = CCIPHome.OCR3Config({ diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol index 5b00bad0c7..88582914a6 100644 --- a/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol @@ -7,10 +7,6 @@ import {Internal} from "../../libraries/Internal.sol"; contract CCIPHomeHelper is CCIPHome { constructor(address capabilitiesRegistry) CCIPHome(capabilitiesRegistry) {} - function stateFromConfigLength(uint256 configLength) public pure returns (CCIPHome.ConfigState) { - return _stateFromConfigLength(configLength); - } - function validateConfigStateTransition(CCIPHome.ConfigState currentState, CCIPHome.ConfigState newState) public pure { _validateConfigStateTransition(currentState, newState); } @@ -25,11 +21,9 @@ contract CCIPHomeHelper is CCIPHome { function computeNewConfigWithMeta( uint32 donId, CCIPHome.OCR3ConfigWithMeta[] memory currentConfig, - CCIPHome.OCR3Config[] memory newConfig, - CCIPHome.ConfigState currentState, - CCIPHome.ConfigState newState + CCIPHome.OCR3Config[] memory newConfig ) public view returns (CCIPHome.OCR3ConfigWithMeta[] memory) { - return _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + return _computeNewConfigWithMeta(donId, currentConfig, newConfig); } function computeConfigDigest( From 1bf03655c0b8b80b5177012451d977c9ee0c6952 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 14:54:36 +0200 Subject: [PATCH 5/7] fix refs and wrapper gen --- .../scripts/native_solc_compile_all_ccip | 4 +- .../src/v0.8/ccip/capability/CCIPHome.sol | 2 +- .../interfaces/ICapabilitiesRegistry.sol | 0 .../interfaces/IOCR3ConfigEncoder.sol | 2 +- .../v0.8/ccip/test/capability/CCIPHome.t.sol | 2 +- .../ccip/generated/ccip_config/ccip_config.go | 1303 ----------------- .../ccip/generated/ccip_home/ccip_home.go | 1279 ++++++++++++++++ .../ocr3_config_encoder.go | 16 +- ...rapper-dependency-versions-do-not-edit.txt | 4 +- core/gethwrappers/ccip/go_generate.go | 2 +- 10 files changed, 1295 insertions(+), 1319 deletions(-) rename contracts/src/v0.8/ccip/{capability => }/interfaces/ICapabilitiesRegistry.sol (100%) rename contracts/src/v0.8/ccip/{capability => }/interfaces/IOCR3ConfigEncoder.sol (88%) delete mode 100644 core/gethwrappers/ccip/generated/ccip_config/ccip_config.go create mode 100644 core/gethwrappers/ccip/generated/ccip_home/ccip_home.go diff --git a/contracts/scripts/native_solc_compile_all_ccip b/contracts/scripts/native_solc_compile_all_ccip index 0696d66115..42b44e36da 100755 --- a/contracts/scripts/native_solc_compile_all_ccip +++ b/contracts/scripts/native_solc_compile_all_ccip @@ -73,8 +73,7 @@ compileContract ccip/RMN.sol compileContract ccip/ARMProxy.sol compileContract ccip/tokenAdminRegistry/TokenAdminRegistry.sol compileContract ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol -compileContract ccip/capability/CCIPConfig.sol -compileContract ccip/capability/interfaces/IOCR3ConfigEncoder.sol +compileContract ccip/capability/CCIPHome.sol compileContract ccip/NonceManager.sol compileContract shared/token/ERC677/BurnMintERC677.sol @@ -105,6 +104,7 @@ compileContract ccip/test/WETH9.sol # Encoding Utils compileContract ccip/CCIPEncodingUtils.sol +compileContract ccip/interfaces/IOCR3ConfigEncoder.sol # Customer contracts compileContract ccip/pools/USDC/USDCTokenPool.sol diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol index 993f7f2981..26700fe3ce 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPHome.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {ICapabilityConfiguration} from "../../keystone/interfaces/ICapabilityConfiguration.sol"; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; -import {ICapabilitiesRegistry} from "./interfaces/ICapabilitiesRegistry.sol"; +import {ICapabilitiesRegistry} from "../interfaces/ICapabilitiesRegistry.sol"; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {Internal} from "../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol b/contracts/src/v0.8/ccip/interfaces/ICapabilitiesRegistry.sol similarity index 100% rename from contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol rename to contracts/src/v0.8/ccip/interfaces/ICapabilitiesRegistry.sol diff --git a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol b/contracts/src/v0.8/ccip/interfaces/IOCR3ConfigEncoder.sol similarity index 88% rename from contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol rename to contracts/src/v0.8/ccip/interfaces/IOCR3ConfigEncoder.sol index 37de759a2f..ffba52707f 100644 --- a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol +++ b/contracts/src/v0.8/ccip/interfaces/IOCR3ConfigEncoder.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; -import {CCIPHome} from "../CCIPHome.sol"; +import {CCIPHome} from "../capability/CCIPHome.sol"; /// @dev This is so that we can generate gethwrappers and easily encode/decode OCR3Config /// in the offchain integration tests. diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol index 187a22e431..4e921295c9 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.24; import {CCIPHome} from "../../capability/CCIPHome.sol"; -import {ICapabilitiesRegistry} from "../../capability/interfaces/ICapabilitiesRegistry.sol"; +import {ICapabilitiesRegistry} from "../../interfaces/ICapabilitiesRegistry.sol"; import {Internal} from "../../libraries/Internal.sol"; import {CCIPHomeHelper} from "../helpers/CCIPHomeHelper.sol"; import {Test} from "forge-std/Test.sol"; diff --git a/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go b/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go deleted file mode 100644 index 990209e958..0000000000 --- a/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go +++ /dev/null @@ -1,1303 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package ccip_config - -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 -) - -type CCIPConfigTypesChainConfig struct { - Readers [][32]byte - FChain uint8 - Config []byte -} - -type CCIPConfigTypesChainConfigInfo struct { - ChainSelector uint64 - ChainConfig CCIPConfigTypesChainConfig -} - -type CCIPConfigTypesOCR3Config struct { - PluginType uint8 - ChainSelector uint64 - FRoleDON uint8 - OffchainConfigVersion uint64 - OfframpAddress []byte - Nodes []CCIPConfigTypesOCR3Node - OffchainConfig []byte -} - -type CCIPConfigTypesOCR3ConfigWithMeta struct { - Config CCIPConfigTypesOCR3Config - ConfigCount uint64 - ConfigDigest [32]byte -} - -type CCIPConfigTypesOCR3Node struct { - P2pId [32]byte - SignerKey []byte - TransmitterKey []byte -} - -var CCIPConfigMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fChain\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FRoleDON\",\"type\":\"uint256\"}],\"name\":\"FChainTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPConfigTypes.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPConfigTypes.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Node\",\"name\":\"node\",\"type\":\"tuple\"}],\"name\":\"InvalidNode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCCIPConfigTypes.OCR3ConfigWithMeta[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"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\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilityRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumChainConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPConfigTypes.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b506040516200410a3803806200410a8339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051613f08620002026000396000818161010301528181610e5c01526110cc0152613f086000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638318ed5d11610081578063f2fde38b1161005b578063f2fde38b14610230578063f442c89a14610243578063fba64a7c1461025657600080fd5b80638318ed5d146101d15780638da5cb5b146101f2578063b74b23561461021057600080fd5b80634bd0473f116100b25780634bd0473f1461019157806379ba5097146101b15780637ac0d41e146101bb57600080fd5b806301ffc9a7146100d9578063020330e614610101578063181f5a7714610148575b600080fd5b6100ec6100e7366004612d37565b610269565b60405190151581526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f8565b6101846040518060400160405280601481526020017f43434950436f6e66696720312e362e302d64657600000000000000000000000081525081565b6040516100f89190612ddd565b6101a461019f366004612e21565b610302565b6040516100f89190612f45565b6101b96106fd565b005b6101c36107ff565b6040519081526020016100f8565b6101846101df3660046130b7565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff16610123565b61022361021e3660046130d4565b610810565b6040516100f89190613164565b6101b961023e3660046131f4565b610a91565b6101b9610251366004613276565b610aa5565b6101b96102643660046132fa565b610e44565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f78bea7210000000000000000000000000000000000000000000000000000000014806102fc57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b63ffffffff8216600090815260056020526040812060609183600181111561032c5761032c612e56565b600181111561033d5761033d612e56565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156106f157600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff1660018111156103b0576103b0612e56565b60018111156103c1576103c1612e56565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a0100000000000000000000909104166060820152600182018054608090920191610419906133b7565b80601f0160208091040260200160405190810160405280929190818152602001828054610445906133b7565b80156104925780601f1061046757610100808354040283529160200191610492565b820191906000526020600020905b81548152906001019060200180831161047557829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156106205783829060005260206000209060030201604051806060016040529081600082015481526020016001820180546104fd906133b7565b80601f0160208091040260200160405190810160405280929190818152602001828054610529906133b7565b80156105765780601f1061054b57610100808354040283529160200191610576565b820191906000526020600020905b81548152906001019060200180831161055957829003601f168201915b5050505050815260200160028201805461058f906133b7565b80601f01602080910402602001604051908101604052809291908181526020018280546105bb906133b7565b80156106085780601f106105dd57610100808354040283529160200191610608565b820191906000526020600020905b8154815290600101906020018083116105eb57829003601f168201915b505050505081525050815260200190600101906104c0565b505050508152602001600382018054610638906133b7565b80601f0160208091040260200160405190810160405280929190818152602001828054610664906133b7565b80156106b15780601f10610686576101008083540402835291602001916106b1565b820191906000526020600020905b81548152906001019060200180831161069457829003601f168201915b505050919092525050508152600482015467ffffffffffffffff16602080830191909152600590920154604090910152908252600192909201910161036b565b50505050905092915050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600061080b6003610eff565b905090565b6060600061081e6003610eff565b9050600061082c8486613439565b905083158061083b5750818110155b1561087b576040805160008082526020820190925290610871565b61085e612b31565b8152602001906001900390816108565790505b50925050506102fc565b6000610887858361347f565b9050828111156108945750815b60006108a08383613492565b67ffffffffffffffff8111156108b8576108b8613450565b6040519080825280602002602001820160405280156108f157816020015b6108de612b31565b8152602001906001900390816108d65790505b50905060006109006003610f09565b9050835b83811015610a84576000828281518110610920576109206134a5565b60209081029190910181015160408051808201825267ffffffffffffffff8316808252600090815260028552829020825181546080818802830181019095526060820181815295975092958601949093919284928491908401828280156109a657602002820191906000526020600020905b815481526020019060010190808311610992575b5050509183525050600182015460ff1660208201526002820180546040909201916109d0906133b7565b80601f01602080910402602001604051908101604052809291908181526020018280546109fc906133b7565b8015610a495780601f10610a1e57610100808354040283529160200191610a49565b820191906000526020600020905b815481529060010190602001808311610a2c57829003601f168201915b50505091909252505050905284610a608885613492565b81518110610a7057610a706134a5565b602090810291909101015250600101610904565b5090979650505050505050565b610a99610f1d565b610aa281610fa0565b50565b610aad610f1d565b60005b83811015610c9357610af4858583818110610acd57610acd6134a5565b9050602002016020810190610ae291906134d4565b60039067ffffffffffffffff16611095565b610b5e57848482818110610b0a57610b0a6134a5565b9050602002016020810190610b1f91906134d4565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161077a565b60026000868684818110610b7457610b746134a5565b9050602002016020810190610b8991906134d4565b67ffffffffffffffff1681526020810191909152604001600090812090610bb08282612b79565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610be8600283016000612b97565b5050610c26858583818110610bff57610bff6134a5565b9050602002016020810190610c1491906134d4565b60039067ffffffffffffffff166110ad565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610c5a57610c5a6134a5565b9050602002016020810190610c6f91906134d4565b60405167ffffffffffffffff909116815260200160405180910390a1600101610ab0565b5060005b81811015610e3d576000838383818110610cb357610cb36134a5565b9050602002810190610cc591906134ef565b610cd390602081019061352d565b610cdc906136bf565b90506000848484818110610cf257610cf26134a5565b9050602002810190610d0491906134ef565b610d129060208101906134d4565b9050610d2182600001516110b9565b816020015160ff16600003610d62576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120835180518593610d92928492910190612bd1565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610ddf90826137e7565b50610df991506003905067ffffffffffffffff8316611205565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051610e2b929190613901565b60405180910390a15050600101610c97565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610eb3576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610eca610ec586880188613a3f565b611211565b8151919350915015610ee257610ee28360008461143e565b805115610ef557610ef58360018361143e565b5050505050505050565b60006102fc825490565b60606000610f1683611c70565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161077a565b565b3373ffffffffffffffffffffffffffffffffffffffff82160361101f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161077a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610f16565b6000610f168383611ccc565b60005b81518110156112015760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe848481518110611118576111186134a5565b60200260200101516040518263ffffffff1660e01b815260040161113e91815260200190565b600060405180830381865afa15801561115b573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526111a19190810190613c44565b60800151036111f9578181815181106111bc576111bc6134a5565b60200260200101516040517f8907a4fa00000000000000000000000000000000000000000000000000000000815260040161077a91815260200190565b6001016110bc565b5050565b6000610f168383611dc6565b606080600460ff1683511115611253576040517f8854586400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160028082526060820190925290816020015b6112c16040805160e081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff1681526020016060815260200160608152602001606081525090565b81526020019060019003908161126957505060408051600280825260608201909252919350602082015b6113436040805160e081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff1681526020016060815260200160608152602001606081525090565b8152602001906001900390816112eb57905050905060008060005b855181101561143157600086828151811061137b5761137b6134a5565b602002602001015160000151600181111561139857611398612e56565b036113e5578581815181106113af576113af6134a5565b60200260200101518584815181106113c9576113c96134a5565b6020026020010181905250826113de90613d1c565b9250611429565b8581815181106113f7576113f76134a5565b6020026020010151848381518110611411576114116134a5565b60200260200101819052508161142690613d1c565b91505b60010161135e565b5090835281529092909150565b63ffffffff831660009081526005602052604081208184600181111561146657611466612e56565b600181111561147757611477612e56565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561182b57600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff1660018111156114ea576114ea612e56565b60018111156114fb576114fb612e56565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a0100000000000000000000909104166060820152600182018054608090920191611553906133b7565b80601f016020809104026020016040519081016040528092919081815260200182805461157f906133b7565b80156115cc5780601f106115a1576101008083540402835291602001916115cc565b820191906000526020600020905b8154815290600101906020018083116115af57829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b8282101561175a578382906000526020600020906003020160405180606001604052908160008201548152602001600182018054611637906133b7565b80601f0160208091040260200160405190810160405280929190818152602001828054611663906133b7565b80156116b05780601f10611685576101008083540402835291602001916116b0565b820191906000526020600020905b81548152906001019060200180831161169357829003601f168201915b505050505081526020016002820180546116c9906133b7565b80601f01602080910402602001604051908101604052809291908181526020018280546116f5906133b7565b80156117425780601f1061171757610100808354040283529160200191611742565b820191906000526020600020905b81548152906001019060200180831161172557829003601f168201915b505050505081525050815260200190600101906115fa565b505050508152602001600382018054611772906133b7565b80601f016020809104026020016040519081016040528092919081815260200182805461179e906133b7565b80156117eb5780601f106117c0576101008083540402835291602001916117eb565b820191906000526020600020905b8154815290600101906020018083116117ce57829003601f168201915b505050919092525050508152600482015467ffffffffffffffff1660208083019190915260059092015460409091015290825260019290920191016114a5565b505050509050600061183d8251611e15565b9050600061184b8451611e15565b90506118578282611e67565b60006118668785878686611f23565b905061187284826122f7565b63ffffffff871660009081526005602052604081209087600181111561189a5761189a612e56565b60018111156118ab576118ab612e56565b815260200190815260200160002060006118c59190612c1c565b60005b8151811015611c135763ffffffff88166000908152600560205260408120818960018111156118f9576118f9612e56565b600181111561190a5761190a612e56565b8152602001908152602001600020600181600181540180825580915050039060005260206000209060060201905082828151811061194a5761194a6134a5565b6020026020010151604001518160050181905550828281518110611970576119706134a5565b6020026020010151602001518160040160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550600081600001905060008484815181106119c2576119c26134a5565b602090810291909101015151805183549192509083907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115611a0d57611a0d612e56565b021790555060208101518254604083015160608401517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a0100000000000000000000929091169190910217825560808101516001830190611adc90826137e7565b5060c08101516003830190611af190826137e7565b505b60a08101515160028301541115611b725781600201805480611b1757611b17613d54565b60008281526020812060037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9093019283020181815590611b5b6001830182612b97565b611b69600283016000612b97565b50509055611af3565b60005b8160a0015151811015611c045760028301548110611bfc57826002018260a001518281518110611ba757611ba76134a5565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519092820190611be390826137e7565b5060408201516002820190611bf890826137e7565b5050505b600101611b75565b505050508060010190506118c8565b50856001811115611c2657611c26612e56565b60ff168763ffffffff167f0fe4c45ffc7f05233ddfee7d79ac01d075176a0aa116068c486a2f7490088a0b83604051611c5f9190612f45565b60405180910390a350505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611cc057602002820191906000526020600020905b815481526020019060010190808311611cac575b50505050509050919050565b60008181526001830160205260408120548015611db5576000611cf0600183613492565b8554909150600090611d0490600190613492565b9050808214611d69576000866000018281548110611d2457611d246134a5565b9060005260206000200154905080876000018481548110611d4757611d476134a5565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611d7a57611d7a613d54565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102fc565b60009150506102fc565b5092915050565b6000818152600183016020526040812054611e0d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102fc565b5060006102fc565b60006002821115611e55576040517f3e4785260000000000000000000000000000000000000000000000000000000081526004810183905260240161077a565b8160028111156102fc576102fc612e56565b6000826002811115611e7b57611e7b612e56565b826002811115611e8d57611e8d612e56565b611e979190613d83565b90508060011480611ee35750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff148015611ee357506002836002811115611ee157611ee1612e56565b145b15611eed57505050565b82826040517f0a6b675b00000000000000000000000000000000000000000000000000000000815260040161077a929190613db3565b60606000845167ffffffffffffffff811115611f4157611f41613450565b604051908082528060200260200182016040528015611f6a578160200160208202803683370190505b5090506000846002811115611f8157611f81612e56565b148015611f9f57506001836002811115611f9d57611f9d612e56565b145b15611fe057600181600081518110611fb957611fb96134a5565b602002602001019067ffffffffffffffff16908167ffffffffffffffff1681525050612148565b6001846002811115611ff457611ff4612e56565b1480156120125750600283600281111561201057612010612e56565b145b156120a9578560008151811061202a5761202a6134a5565b60200260200101516020015181600081518110612049576120496134a5565b602002602001019067ffffffffffffffff16908167ffffffffffffffff16815250508560008151811061207e5761207e6134a5565b60200260200101516020015160016120969190613dce565b81600181518110611fb957611fb96134a5565b60028460028111156120bd576120bd612e56565b1480156120db575060018360028111156120d9576120d9612e56565b145b1561211257856001815181106120f3576120f36134a5565b60200260200101516020015181600081518110611fb957611fb96134a5565b83836040517f0a6b675b00000000000000000000000000000000000000000000000000000000815260040161077a929190613db3565b6000855167ffffffffffffffff81111561216457612164613450565b60405190808252806020026020018201604052801561220257816020015b6040805161014081018252600060608083018281526080840183905260a0840183905260c0840183905260e084018290526101008401829052610120840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816121825790505b50905060005b82518110156122eb57612233878281518110612226576122266134a5565b6020026020010151612676565b6040518060600160405280888381518110612250576122506134a5565b6020026020010151815260200184838151811061226f5761226f6134a5565b602002602001015167ffffffffffffffff1681526020016122c38b86858151811061229c5761229c6134a5565b60200260200101518b86815181106122b6576122b66134a5565b6020026020010151612a70565b8152508282815181106122d8576122d86134a5565b6020908102919091010152600101612208565b50979650505050505050565b81518151811580156123095750806001145b156123ab5782600081518110612321576123216134a5565b60200260200101516020015167ffffffffffffffff166001146123a55782600081518110612351576123516134a5565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001602482015260440161077a565b50505050565b8160011480156123bb5750806002145b1561257157836000815181106123d3576123d36134a5565b602002602001015160400151836000815181106123f2576123f26134a5565b6020026020010151604001511461247e5782600081518110612416576124166134a5565b60200260200101516040015184600081518110612435576124356134a5565b6020026020010151604001516040517fc7ccdd7f00000000000000000000000000000000000000000000000000000000815260040161077a929190918252602082015260400190565b83600081518110612491576124916134a5565b60200260200101516020015160016124a99190613dce565b67ffffffffffffffff16836001815181106124c6576124c66134a5565b60200260200101516020015167ffffffffffffffff16146123a557826001815181106124f4576124f46134a5565b60200260200101516020015184600081518110612513576125136134a5565b602002602001015160200151600161252b9190613dce565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff92831660048201529116602482015260440161077a565b8160021480156125815750806001145b156126445783600181518110612599576125996134a5565b602002602001015160400151836000815181106125b8576125b86134a5565b602002602001015160400151146123a557826000815181106125dc576125dc6134a5565b602002602001015160400151846001815181106125fb576125fb6134a5565b6020026020010151604001516040517f9e97567000000000000000000000000000000000000000000000000000000000815260040161077a929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806020015167ffffffffffffffff166000036126be576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815160018111156126d3576126d3612e56565b141580156126f457506001815160018111156126f1576126f1612e56565b14155b1561272b576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151511580612768575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b1561279f576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516127ba9060039067ffffffffffffffff16611095565b6128025760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161077a565b60408082015160208084015167ffffffffffffffff1660009081526002909152919091206001015460ff918216911681811115612875576040517f2db22040000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161077a565b60a0830151516101008111156128b7576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6128c2836003613439565b81116128fa576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808267ffffffffffffffff81111561291657612916613450565b60405190808252806020026020018201604052801561293f578160200160208202803683370190505b50905060005b838110156129ff5760008760a001518281518110612965576129656134a5565b6020026020010151905080604001515160001461298a578361298681613d1c565b9450505b602081015151158061299b57508051155b156129d457806040517f9fa4031400000000000000000000000000000000000000000000000000000000815260040161077a9190613def565b80600001518383815181106129eb576129eb6134a5565b602090810291909101015250600101612945565b506000612a0d856003613439565b612a1890600161347f565b905080831015612a5e576040517f548dd21f000000000000000000000000000000000000000000000000000000008152600481018490526024810182905260440161077a565b612a67826110b9565b50505050505050565b60008082602001518584600001518560800151878760a00151886040015189606001518a60c00151604051602001612ab099989796959493929190613e02565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a000000000000000000000000000000000000000000000000000000000000179150509392505050565b6040518060400160405280600067ffffffffffffffff168152602001612b74604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b5080546000825590600052602060002090810190610aa29190612c3d565b508054612ba3906133b7565b6000825580601f10612bb3575050565b601f016020900490600052602060002090810190610aa29190612c3d565b828054828255906000526020600020908101928215612c0c579160200282015b82811115612c0c578251825591602001919060010190612bf1565b50612c18929150612c3d565b5090565b5080546000825560060290600052602060002090810190610aa29190612c52565b5b80821115612c185760008155600101612c3e565b80821115612c185780547fffffffffffffffffffffffffffff00000000000000000000000000000000000016815560008181612c916001830182612b97565b612c9f600283016000612ce9565b612cad600383016000612b97565b5050506004810180547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016905560006005820155600601612c52565b5080546000825560030290600052602060002090810190610aa291905b80821115612c18576000808255612d206001830182612b97565b612d2e600283016000612b97565b50600301612d06565b600060208284031215612d4957600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f1657600080fd5b6000815180845260005b81811015612d9f57602081850181015186830182015201612d83565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610f166020830184612d79565b63ffffffff81168114610aa257600080fd5b8035612e0d81612df0565b919050565b803560028110612e0d57600080fd5b60008060408385031215612e3457600080fd5b8235612e3f81612df0565b9150612e4d60208401612e12565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110612e9557612e95612e56565b9052565b805182526000602082015160606020850152612eb86060850182612d79565b905060408301518482036040860152612ed18282612d79565b95945050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015610a84577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612f33838351612e99565b98840198925090830190600101612ef9565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b838110156130a9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160608151818652612fb38287018251612e85565b89810151608067ffffffffffffffff8216818901528a830151915060a060ff8316818a015284840151945060c09250612ff7838a018667ffffffffffffffff169052565b81840151945060e0915081828a01526130146101408a0186612d79565b9450808401519150507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa080898603016101008a01526130538583612eda565b92909301518883039093016101208901525091506130718282612d79565b9150508882015161308d8a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101612f6e565b509098975050505050505050565b6000602082840312156130c957600080fd5b8135610f1681612df0565b600080604083850312156130e757600080fd5b50508035926020909101359150565b805160608084528151908401819052600091602091908201906080860190845b8181101561313257835183529284019291840191600101613116565b505060ff602086015116602087015260408501519250858103604087015261315a8184612d79565b9695505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b838110156130a9578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff1684528701518784018790526131e1878501826130f6565b958801959350509086019060010161318d565b60006020828403121561320657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610f1657600080fd5b60008083601f84011261323c57600080fd5b50813567ffffffffffffffff81111561325457600080fd5b6020830191508360208260051b850101111561326f57600080fd5b9250929050565b6000806000806040858703121561328c57600080fd5b843567ffffffffffffffff808211156132a457600080fd5b6132b08883890161322a565b909650945060208701359150808211156132c957600080fd5b506132d68782880161322a565b95989497509550505050565b803567ffffffffffffffff81168114612e0d57600080fd5b6000806000806000806080878903121561331357600080fd5b863567ffffffffffffffff8082111561332b57600080fd5b6133378a838b0161322a565b9098509650602089013591508082111561335057600080fd5b818901915089601f83011261336457600080fd5b81358181111561337357600080fd5b8a602082850101111561338557600080fd5b60208301965080955050505061339d604088016132e2565b91506133ab60608801612e02565b90509295509295509295565b600181811c908216806133cb57607f821691505b602082108103613404577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176102fc576102fc61340a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b808201808211156102fc576102fc61340a565b818103818111156102fc576102fc61340a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156134e657600080fd5b610f16826132e2565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261352357600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261352357600080fd5b6040516060810167ffffffffffffffff8111828210171561358457613584613450565b60405290565b60405160e0810167ffffffffffffffff8111828210171561358457613584613450565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156135f4576135f4613450565b604052919050565b600067ffffffffffffffff82111561361657613616613450565b5060051b60200190565b803560ff81168114612e0d57600080fd5b600082601f83011261364257600080fd5b813567ffffffffffffffff81111561365c5761365c613450565b61368d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016135ad565b8181528460208386010111156136a257600080fd5b816020850160208301376000918101602001919091529392505050565b6000606082360312156136d157600080fd5b6136d9613561565b823567ffffffffffffffff808211156136f157600080fd5b9084019036601f83011261370457600080fd5b81356020613719613714836135fc565b6135ad565b82815260059290921b8401810191818101903684111561373857600080fd5b948201945b838610156137565785358252948201949082019061373d565b865250613764878201613620565b9085015250604085013591508082111561377d57600080fd5b5061378a36828601613631565b60408301525092915050565b601f8211156137e2576000816000526020600020601f850160051c810160208610156137bf5750805b601f850160051c820191505b818110156137de578281556001016137cb565b5050505b505050565b815167ffffffffffffffff81111561380157613801613450565b6138158161380f84546133b7565b84613796565b602080601f83116001811461386857600084156138325750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556137de565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156138b557888601518255948401946001909101908401613896565b50858210156138f157878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff8316815260406020820152600061392460408301846130f6565b949350505050565b600082601f83011261393d57600080fd5b8135602061394d613714836135fc565b82815260059290921b8401810191818101908684111561396c57600080fd5b8286015b84811015613a3457803567ffffffffffffffff808211156139915760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156139ca5760008081fd5b6139d2613561565b878401358152604080850135848111156139ec5760008081fd5b6139fa8e8b83890101613631565b838b015250918401359183831115613a125760008081fd5b613a208d8a85880101613631565b908201528652505050918301918301613970565b509695505050505050565b60006020808385031215613a5257600080fd5b823567ffffffffffffffff80821115613a6a57600080fd5b818501915085601f830112613a7e57600080fd5b8135613a8c613714826135fc565b81815260059190911b83018401908481019088831115613aab57600080fd5b8585015b83811015613bcd57803585811115613ac657600080fd5b860160e0818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0011215613afb5760008081fd5b613b0361358a565b613b0e898301612e12565b81526040613b1d8184016132e2565b8a8301526060613b2e818501613620565b8284015260809150613b418285016132e2565b9083015260a08381013589811115613b595760008081fd5b613b678f8d83880101613631565b838501525060c091508184013589811115613b825760008081fd5b613b908f8d8388010161392c565b82850152505060e083013588811115613ba95760008081fd5b613bb78e8c83870101613631565b9183019190915250845250918601918601613aaf565b5098975050505050505050565b8051612e0d81612df0565b600082601f830112613bf657600080fd5b81516020613c06613714836135fc565b8083825260208201915060208460051b870101935086841115613c2857600080fd5b602086015b84811015613a345780518352918301918301613c2d565b600060208284031215613c5657600080fd5b815167ffffffffffffffff80821115613c6e57600080fd5b9083019060e08286031215613c8257600080fd5b613c8a61358a565b613c9383613bda565b8152613ca160208401613bda565b6020820152613cb260408401613bda565b6040820152606083015160608201526080830151608082015260a083015182811115613cdd57600080fd5b613ce987828601613be5565b60a08301525060c083015182811115613d0157600080fd5b613d0d87828601613be5565b60c08301525095945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613d4d57613d4d61340a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b8181036000831280158383131683831282161715611dbf57611dbf61340a565b60038110612e9557612e95612e56565b60408101613dc18285613da3565b610f166020830184613da3565b67ffffffffffffffff818116838216019080821115611dbf57611dbf61340a565b602081526000610f166020830184612e99565b600061012067ffffffffffffffff808d168452602063ffffffff8d1681860152613e2f604086018d612e85565b826060860152613e418386018c612d79565b918a16608086015284820360a0860152885180835291925080830191600581901b84018201828b0160005b83811015613eb8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0878403018652613ea6838351612e99565b95850195925090840190600101613e6c565b505060ff8a1660c088015267ffffffffffffffff891660e0880152868103610100880152613ee68189612d79565b955050505050509a995050505050505050505056fea164736f6c6343000818000a", -} - -var CCIPConfigABI = CCIPConfigMetaData.ABI - -var CCIPConfigBin = CCIPConfigMetaData.Bin - -func DeployCCIPConfig(auth *bind.TransactOpts, backend bind.ContractBackend, capabilitiesRegistry common.Address) (common.Address, *types.Transaction, *CCIPConfig, error) { - parsed, err := CCIPConfigMetaData.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(CCIPConfigBin), backend, capabilitiesRegistry) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &CCIPConfig{address: address, abi: *parsed, CCIPConfigCaller: CCIPConfigCaller{contract: contract}, CCIPConfigTransactor: CCIPConfigTransactor{contract: contract}, CCIPConfigFilterer: CCIPConfigFilterer{contract: contract}}, nil -} - -type CCIPConfig struct { - address common.Address - abi abi.ABI - CCIPConfigCaller - CCIPConfigTransactor - CCIPConfigFilterer -} - -type CCIPConfigCaller struct { - contract *bind.BoundContract -} - -type CCIPConfigTransactor struct { - contract *bind.BoundContract -} - -type CCIPConfigFilterer struct { - contract *bind.BoundContract -} - -type CCIPConfigSession struct { - Contract *CCIPConfig - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type CCIPConfigCallerSession struct { - Contract *CCIPConfigCaller - CallOpts bind.CallOpts -} - -type CCIPConfigTransactorSession struct { - Contract *CCIPConfigTransactor - TransactOpts bind.TransactOpts -} - -type CCIPConfigRaw struct { - Contract *CCIPConfig -} - -type CCIPConfigCallerRaw struct { - Contract *CCIPConfigCaller -} - -type CCIPConfigTransactorRaw struct { - Contract *CCIPConfigTransactor -} - -func NewCCIPConfig(address common.Address, backend bind.ContractBackend) (*CCIPConfig, error) { - abi, err := abi.JSON(strings.NewReader(CCIPConfigABI)) - if err != nil { - return nil, err - } - contract, err := bindCCIPConfig(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &CCIPConfig{address: address, abi: abi, CCIPConfigCaller: CCIPConfigCaller{contract: contract}, CCIPConfigTransactor: CCIPConfigTransactor{contract: contract}, CCIPConfigFilterer: CCIPConfigFilterer{contract: contract}}, nil -} - -func NewCCIPConfigCaller(address common.Address, caller bind.ContractCaller) (*CCIPConfigCaller, error) { - contract, err := bindCCIPConfig(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &CCIPConfigCaller{contract: contract}, nil -} - -func NewCCIPConfigTransactor(address common.Address, transactor bind.ContractTransactor) (*CCIPConfigTransactor, error) { - contract, err := bindCCIPConfig(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &CCIPConfigTransactor{contract: contract}, nil -} - -func NewCCIPConfigFilterer(address common.Address, filterer bind.ContractFilterer) (*CCIPConfigFilterer, error) { - contract, err := bindCCIPConfig(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &CCIPConfigFilterer{contract: contract}, nil -} - -func bindCCIPConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := CCIPConfigMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_CCIPConfig *CCIPConfigRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _CCIPConfig.Contract.CCIPConfigCaller.contract.Call(opts, result, method, params...) -} - -func (_CCIPConfig *CCIPConfigRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _CCIPConfig.Contract.CCIPConfigTransactor.contract.Transfer(opts) -} - -func (_CCIPConfig *CCIPConfigRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _CCIPConfig.Contract.CCIPConfigTransactor.contract.Transact(opts, method, params...) -} - -func (_CCIPConfig *CCIPConfigCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _CCIPConfig.Contract.contract.Call(opts, result, method, params...) -} - -func (_CCIPConfig *CCIPConfigTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _CCIPConfig.Contract.contract.Transfer(opts) -} - -func (_CCIPConfig *CCIPConfigTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _CCIPConfig.Contract.contract.Transact(opts, method, params...) -} - -func (_CCIPConfig *CCIPConfigCaller) GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "getAllChainConfigs", pageIndex, pageSize) - - if err != nil { - return *new([]CCIPConfigTypesChainConfigInfo), err - } - - out0 := *abi.ConvertType(out[0], new([]CCIPConfigTypesChainConfigInfo)).(*[]CCIPConfigTypesChainConfigInfo) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) { - return _CCIPConfig.Contract.GetAllChainConfigs(&_CCIPConfig.CallOpts, pageIndex, pageSize) -} - -func (_CCIPConfig *CCIPConfigCallerSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) { - return _CCIPConfig.Contract.GetAllChainConfigs(&_CCIPConfig.CallOpts, pageIndex, pageSize) -} - -func (_CCIPConfig *CCIPConfigCaller) GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "getCapabilityConfiguration", arg0) - - if err != nil { - return *new([]byte), err - } - - out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) GetCapabilityConfiguration(arg0 uint32) ([]byte, error) { - return _CCIPConfig.Contract.GetCapabilityConfiguration(&_CCIPConfig.CallOpts, arg0) -} - -func (_CCIPConfig *CCIPConfigCallerSession) GetCapabilityConfiguration(arg0 uint32) ([]byte, error) { - return _CCIPConfig.Contract.GetCapabilityConfiguration(&_CCIPConfig.CallOpts, arg0) -} - -func (_CCIPConfig *CCIPConfigCaller) GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "getCapabilityRegistry") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) GetCapabilityRegistry() (common.Address, error) { - return _CCIPConfig.Contract.GetCapabilityRegistry(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCallerSession) GetCapabilityRegistry() (common.Address, error) { - return _CCIPConfig.Contract.GetCapabilityRegistry(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCaller) GetNumChainConfigurations(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "getNumChainConfigurations") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) GetNumChainConfigurations() (*big.Int, error) { - return _CCIPConfig.Contract.GetNumChainConfigurations(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCallerSession) GetNumChainConfigurations() (*big.Int, error) { - return _CCIPConfig.Contract.GetNumChainConfigurations(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCaller) GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "getOCRConfig", donId, pluginType) - - if err != nil { - return *new([]CCIPConfigTypesOCR3ConfigWithMeta), err - } - - out0 := *abi.ConvertType(out[0], new([]CCIPConfigTypesOCR3ConfigWithMeta)).(*[]CCIPConfigTypesOCR3ConfigWithMeta) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { - return _CCIPConfig.Contract.GetOCRConfig(&_CCIPConfig.CallOpts, donId, pluginType) -} - -func (_CCIPConfig *CCIPConfigCallerSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { - return _CCIPConfig.Contract.GetOCRConfig(&_CCIPConfig.CallOpts, donId, pluginType) -} - -func (_CCIPConfig *CCIPConfigCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _CCIPConfig.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 (_CCIPConfig *CCIPConfigSession) Owner() (common.Address, error) { - return _CCIPConfig.Contract.Owner(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCallerSession) Owner() (common.Address, error) { - return _CCIPConfig.Contract.Owner(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _CCIPConfig.Contract.SupportsInterface(&_CCIPConfig.CallOpts, interfaceId) -} - -func (_CCIPConfig *CCIPConfigCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _CCIPConfig.Contract.SupportsInterface(&_CCIPConfig.CallOpts, interfaceId) -} - -func (_CCIPConfig *CCIPConfigCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _CCIPConfig.contract.Call(opts, &out, "typeAndVersion") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -func (_CCIPConfig *CCIPConfigSession) TypeAndVersion() (string, error) { - return _CCIPConfig.Contract.TypeAndVersion(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigCallerSession) TypeAndVersion() (string, error) { - return _CCIPConfig.Contract.TypeAndVersion(&_CCIPConfig.CallOpts) -} - -func (_CCIPConfig *CCIPConfigTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _CCIPConfig.contract.Transact(opts, "acceptOwnership") -} - -func (_CCIPConfig *CCIPConfigSession) AcceptOwnership() (*types.Transaction, error) { - return _CCIPConfig.Contract.AcceptOwnership(&_CCIPConfig.TransactOpts) -} - -func (_CCIPConfig *CCIPConfigTransactorSession) AcceptOwnership() (*types.Transaction, error) { - return _CCIPConfig.Contract.AcceptOwnership(&_CCIPConfig.TransactOpts) -} - -func (_CCIPConfig *CCIPConfigTransactor) ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { - return _CCIPConfig.contract.Transact(opts, "applyChainConfigUpdates", chainSelectorRemoves, chainConfigAdds) -} - -func (_CCIPConfig *CCIPConfigSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { - return _CCIPConfig.Contract.ApplyChainConfigUpdates(&_CCIPConfig.TransactOpts, chainSelectorRemoves, chainConfigAdds) -} - -func (_CCIPConfig *CCIPConfigTransactorSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { - return _CCIPConfig.Contract.ApplyChainConfigUpdates(&_CCIPConfig.TransactOpts, chainSelectorRemoves, chainConfigAdds) -} - -func (_CCIPConfig *CCIPConfigTransactor) BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { - return _CCIPConfig.contract.Transact(opts, "beforeCapabilityConfigSet", arg0, config, arg2, donId) -} - -func (_CCIPConfig *CCIPConfigSession) BeforeCapabilityConfigSet(arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { - return _CCIPConfig.Contract.BeforeCapabilityConfigSet(&_CCIPConfig.TransactOpts, arg0, config, arg2, donId) -} - -func (_CCIPConfig *CCIPConfigTransactorSession) BeforeCapabilityConfigSet(arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { - return _CCIPConfig.Contract.BeforeCapabilityConfigSet(&_CCIPConfig.TransactOpts, arg0, config, arg2, donId) -} - -func (_CCIPConfig *CCIPConfigTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _CCIPConfig.contract.Transact(opts, "transferOwnership", to) -} - -func (_CCIPConfig *CCIPConfigSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _CCIPConfig.Contract.TransferOwnership(&_CCIPConfig.TransactOpts, to) -} - -func (_CCIPConfig *CCIPConfigTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _CCIPConfig.Contract.TransferOwnership(&_CCIPConfig.TransactOpts, to) -} - -type CCIPConfigCapabilityConfigurationSetIterator struct { - Event *CCIPConfigCapabilityConfigurationSet - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *CCIPConfigCapabilityConfigurationSetIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(CCIPConfigCapabilityConfigurationSet) - 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(CCIPConfigCapabilityConfigurationSet) - 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 *CCIPConfigCapabilityConfigurationSetIterator) Error() error { - return it.fail -} - -func (it *CCIPConfigCapabilityConfigurationSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type CCIPConfigCapabilityConfigurationSet struct { - Raw types.Log -} - -func (_CCIPConfig *CCIPConfigFilterer) FilterCapabilityConfigurationSet(opts *bind.FilterOpts) (*CCIPConfigCapabilityConfigurationSetIterator, error) { - - logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "CapabilityConfigurationSet") - if err != nil { - return nil, err - } - return &CCIPConfigCapabilityConfigurationSetIterator{contract: _CCIPConfig.contract, event: "CapabilityConfigurationSet", logs: logs, sub: sub}, nil -} - -func (_CCIPConfig *CCIPConfigFilterer) WatchCapabilityConfigurationSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigCapabilityConfigurationSet) (event.Subscription, error) { - - logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "CapabilityConfigurationSet") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(CCIPConfigCapabilityConfigurationSet) - if err := _CCIPConfig.contract.UnpackLog(event, "CapabilityConfigurationSet", 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 (_CCIPConfig *CCIPConfigFilterer) ParseCapabilityConfigurationSet(log types.Log) (*CCIPConfigCapabilityConfigurationSet, error) { - event := new(CCIPConfigCapabilityConfigurationSet) - if err := _CCIPConfig.contract.UnpackLog(event, "CapabilityConfigurationSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type CCIPConfigChainConfigRemovedIterator struct { - Event *CCIPConfigChainConfigRemoved - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *CCIPConfigChainConfigRemovedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(CCIPConfigChainConfigRemoved) - 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(CCIPConfigChainConfigRemoved) - 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 *CCIPConfigChainConfigRemovedIterator) Error() error { - return it.fail -} - -func (it *CCIPConfigChainConfigRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type CCIPConfigChainConfigRemoved struct { - ChainSelector uint64 - Raw types.Log -} - -func (_CCIPConfig *CCIPConfigFilterer) FilterChainConfigRemoved(opts *bind.FilterOpts) (*CCIPConfigChainConfigRemovedIterator, error) { - - logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "ChainConfigRemoved") - if err != nil { - return nil, err - } - return &CCIPConfigChainConfigRemovedIterator{contract: _CCIPConfig.contract, event: "ChainConfigRemoved", logs: logs, sub: sub}, nil -} - -func (_CCIPConfig *CCIPConfigFilterer) WatchChainConfigRemoved(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigRemoved) (event.Subscription, error) { - - logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "ChainConfigRemoved") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(CCIPConfigChainConfigRemoved) - if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigRemoved", 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 (_CCIPConfig *CCIPConfigFilterer) ParseChainConfigRemoved(log types.Log) (*CCIPConfigChainConfigRemoved, error) { - event := new(CCIPConfigChainConfigRemoved) - if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type CCIPConfigChainConfigSetIterator struct { - Event *CCIPConfigChainConfigSet - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *CCIPConfigChainConfigSetIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(CCIPConfigChainConfigSet) - 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(CCIPConfigChainConfigSet) - 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 *CCIPConfigChainConfigSetIterator) Error() error { - return it.fail -} - -func (it *CCIPConfigChainConfigSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type CCIPConfigChainConfigSet struct { - ChainSelector uint64 - ChainConfig CCIPConfigTypesChainConfig - Raw types.Log -} - -func (_CCIPConfig *CCIPConfigFilterer) FilterChainConfigSet(opts *bind.FilterOpts) (*CCIPConfigChainConfigSetIterator, error) { - - logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "ChainConfigSet") - if err != nil { - return nil, err - } - return &CCIPConfigChainConfigSetIterator{contract: _CCIPConfig.contract, event: "ChainConfigSet", logs: logs, sub: sub}, nil -} - -func (_CCIPConfig *CCIPConfigFilterer) WatchChainConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigSet) (event.Subscription, error) { - - logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "ChainConfigSet") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(CCIPConfigChainConfigSet) - if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigSet", 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 (_CCIPConfig *CCIPConfigFilterer) ParseChainConfigSet(log types.Log) (*CCIPConfigChainConfigSet, error) { - event := new(CCIPConfigChainConfigSet) - if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type CCIPConfigConfigSetIterator struct { - Event *CCIPConfigConfigSet - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *CCIPConfigConfigSetIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(CCIPConfigConfigSet) - 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(CCIPConfigConfigSet) - 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 *CCIPConfigConfigSetIterator) Error() error { - return it.fail -} - -func (it *CCIPConfigConfigSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type CCIPConfigConfigSet struct { - DonId uint32 - PluginType uint8 - Config []CCIPConfigTypesOCR3ConfigWithMeta - Raw types.Log -} - -func (_CCIPConfig *CCIPConfigFilterer) FilterConfigSet(opts *bind.FilterOpts, donId []uint32, pluginType []uint8) (*CCIPConfigConfigSetIterator, error) { - - var donIdRule []interface{} - for _, donIdItem := range donId { - donIdRule = append(donIdRule, donIdItem) - } - var pluginTypeRule []interface{} - for _, pluginTypeItem := range pluginType { - pluginTypeRule = append(pluginTypeRule, pluginTypeItem) - } - - logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "ConfigSet", donIdRule, pluginTypeRule) - if err != nil { - return nil, err - } - return &CCIPConfigConfigSetIterator{contract: _CCIPConfig.contract, event: "ConfigSet", logs: logs, sub: sub}, nil -} - -func (_CCIPConfig *CCIPConfigFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigConfigSet, donId []uint32, pluginType []uint8) (event.Subscription, error) { - - var donIdRule []interface{} - for _, donIdItem := range donId { - donIdRule = append(donIdRule, donIdItem) - } - var pluginTypeRule []interface{} - for _, pluginTypeItem := range pluginType { - pluginTypeRule = append(pluginTypeRule, pluginTypeItem) - } - - logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "ConfigSet", donIdRule, pluginTypeRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(CCIPConfigConfigSet) - if err := _CCIPConfig.contract.UnpackLog(event, "ConfigSet", 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 (_CCIPConfig *CCIPConfigFilterer) ParseConfigSet(log types.Log) (*CCIPConfigConfigSet, error) { - event := new(CCIPConfigConfigSet) - if err := _CCIPConfig.contract.UnpackLog(event, "ConfigSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type CCIPConfigOwnershipTransferRequestedIterator struct { - Event *CCIPConfigOwnershipTransferRequested - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *CCIPConfigOwnershipTransferRequestedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(CCIPConfigOwnershipTransferRequested) - 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(CCIPConfigOwnershipTransferRequested) - 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 *CCIPConfigOwnershipTransferRequestedIterator) Error() error { - return it.fail -} - -func (it *CCIPConfigOwnershipTransferRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type CCIPConfigOwnershipTransferRequested struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_CCIPConfig *CCIPConfigFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferRequestedIterator, 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 := _CCIPConfig.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return &CCIPConfigOwnershipTransferRequestedIterator{contract: _CCIPConfig.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil -} - -func (_CCIPConfig *CCIPConfigFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferRequested, 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 := _CCIPConfig.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(CCIPConfigOwnershipTransferRequested) - if err := _CCIPConfig.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 (_CCIPConfig *CCIPConfigFilterer) ParseOwnershipTransferRequested(log types.Log) (*CCIPConfigOwnershipTransferRequested, error) { - event := new(CCIPConfigOwnershipTransferRequested) - if err := _CCIPConfig.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type CCIPConfigOwnershipTransferredIterator struct { - Event *CCIPConfigOwnershipTransferred - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *CCIPConfigOwnershipTransferredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(CCIPConfigOwnershipTransferred) - 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(CCIPConfigOwnershipTransferred) - 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 *CCIPConfigOwnershipTransferredIterator) Error() error { - return it.fail -} - -func (it *CCIPConfigOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type CCIPConfigOwnershipTransferred struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_CCIPConfig *CCIPConfigFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferredIterator, 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 := _CCIPConfig.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return &CCIPConfigOwnershipTransferredIterator{contract: _CCIPConfig.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -func (_CCIPConfig *CCIPConfigFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferred, 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 := _CCIPConfig.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(CCIPConfigOwnershipTransferred) - if err := _CCIPConfig.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 (_CCIPConfig *CCIPConfigFilterer) ParseOwnershipTransferred(log types.Log) (*CCIPConfigOwnershipTransferred, error) { - event := new(CCIPConfigOwnershipTransferred) - if err := _CCIPConfig.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -func (_CCIPConfig *CCIPConfig) ParseLog(log types.Log) (generated.AbigenLog, error) { - switch log.Topics[0] { - case _CCIPConfig.abi.Events["CapabilityConfigurationSet"].ID: - return _CCIPConfig.ParseCapabilityConfigurationSet(log) - case _CCIPConfig.abi.Events["ChainConfigRemoved"].ID: - return _CCIPConfig.ParseChainConfigRemoved(log) - case _CCIPConfig.abi.Events["ChainConfigSet"].ID: - return _CCIPConfig.ParseChainConfigSet(log) - case _CCIPConfig.abi.Events["ConfigSet"].ID: - return _CCIPConfig.ParseConfigSet(log) - case _CCIPConfig.abi.Events["OwnershipTransferRequested"].ID: - return _CCIPConfig.ParseOwnershipTransferRequested(log) - case _CCIPConfig.abi.Events["OwnershipTransferred"].ID: - return _CCIPConfig.ParseOwnershipTransferred(log) - - default: - return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) - } -} - -func (CCIPConfigCapabilityConfigurationSet) Topic() common.Hash { - return common.HexToHash("0x84ad7751b744c9e2ee77da1d902b428aec7f0a343d67a24bbe2142e6f58a8d0f") -} - -func (CCIPConfigChainConfigRemoved) Topic() common.Hash { - return common.HexToHash("0x2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0") -} - -func (CCIPConfigChainConfigSet) Topic() common.Hash { - return common.HexToHash("0x05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e0") -} - -func (CCIPConfigConfigSet) Topic() common.Hash { - return common.HexToHash("0x0fe4c45ffc7f05233ddfee7d79ac01d075176a0aa116068c486a2f7490088a0b") -} - -func (CCIPConfigOwnershipTransferRequested) Topic() common.Hash { - return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") -} - -func (CCIPConfigOwnershipTransferred) Topic() common.Hash { - return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") -} - -func (_CCIPConfig *CCIPConfig) Address() common.Address { - return _CCIPConfig.address -} - -type CCIPConfigInterface interface { - GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) - - GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) - - GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) - - GetNumChainConfigurations(opts *bind.CallOpts) (*big.Int, error) - - GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) - - Owner(opts *bind.CallOpts) (common.Address, error) - - SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) - - TypeAndVersion(opts *bind.CallOpts) (string, error) - - AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - - ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) - - BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) - - TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - - FilterCapabilityConfigurationSet(opts *bind.FilterOpts) (*CCIPConfigCapabilityConfigurationSetIterator, error) - - WatchCapabilityConfigurationSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigCapabilityConfigurationSet) (event.Subscription, error) - - ParseCapabilityConfigurationSet(log types.Log) (*CCIPConfigCapabilityConfigurationSet, error) - - FilterChainConfigRemoved(opts *bind.FilterOpts) (*CCIPConfigChainConfigRemovedIterator, error) - - WatchChainConfigRemoved(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigRemoved) (event.Subscription, error) - - ParseChainConfigRemoved(log types.Log) (*CCIPConfigChainConfigRemoved, error) - - FilterChainConfigSet(opts *bind.FilterOpts) (*CCIPConfigChainConfigSetIterator, error) - - WatchChainConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigSet) (event.Subscription, error) - - ParseChainConfigSet(log types.Log) (*CCIPConfigChainConfigSet, error) - - FilterConfigSet(opts *bind.FilterOpts, donId []uint32, pluginType []uint8) (*CCIPConfigConfigSetIterator, error) - - WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigConfigSet, donId []uint32, pluginType []uint8) (event.Subscription, error) - - ParseConfigSet(log types.Log) (*CCIPConfigConfigSet, error) - - FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferRequestedIterator, error) - - WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferRequested(log types.Log) (*CCIPConfigOwnershipTransferRequested, error) - - FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferredIterator, error) - - WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferred(log types.Log) (*CCIPConfigOwnershipTransferred, error) - - ParseLog(log types.Log) (generated.AbigenLog, error) - - Address() common.Address -} diff --git a/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go b/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go new file mode 100644 index 0000000000..8fa145729c --- /dev/null +++ b/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go @@ -0,0 +1,1279 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ccip_home + +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 +) + +type CCIPHomeChainConfig struct { + Readers [][32]byte + FChain uint8 + Config []byte +} + +type CCIPHomeChainConfigInfo struct { + ChainSelector uint64 + ChainConfig CCIPHomeChainConfig +} + +type CCIPHomeOCR3Config struct { + PluginType uint8 + ChainSelector uint64 + FRoleDON uint8 + OffchainConfigVersion uint64 + OfframpAddress []byte + Nodes []CCIPHomeOCR3Node + OffchainConfig []byte +} + +type CCIPHomeOCR3ConfigWithMeta struct { + Config CCIPHomeOCR3Config + Version uint64 + ConfigDigest [32]byte +} + +type CCIPHomeOCR3Node struct { + P2pId [32]byte + SignerKey []byte + TransmitterKey []byte +} + +var CCIPHomeMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fChain\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FRoleDON\",\"type\":\"uint256\"}],\"name\":\"FChainTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPHome.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPHome.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node\",\"name\":\"node\",\"type\":\"tuple\"}],\"name\":\"InvalidNode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"expectedPluginType\",\"type\":\"uint8\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"gotPluginType\",\"type\":\"uint8\"}],\"name\":\"PluginTypeMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.OCR3ConfigWithMeta[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"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\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPHome.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPHome.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilityRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumChainConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPHome.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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: "0x60a06040523480156200001157600080fd5b5060405162003df038038062003df08339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051613bef620002016000396000818160d001528181610d960152610ffe0152613bef6000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638318ed5d11610081578063f2fde38b1161005b578063f2fde38b14610202578063f442c89a14610215578063fba64a7c1461022857600080fd5b80638318ed5d146101a35780638da5cb5b146101c4578063b74b2356146101e257600080fd5b80634bd0473f116100b25780634bd0473f1461016357806379ba5097146101835780637ac0d41e1461018d57600080fd5b8063020330e6146100ce578063181f5a771461011a575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101566040518060400160405280601281526020017f43434950486f6d6520312e362e302d646576000000000000000000000000000081525081565b6040516101119190612a6b565b610176610171366004612aaf565b61023b565b6040516101119190612bd3565b61018b610637565b005b610195610739565b604051908152602001610111565b6101566101b1366004612d45565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff166100f0565b6101f56101f0366004612d62565b61074a565b6040516101119190612df2565b61018b610210366004612e82565b6109cb565b61018b610223366004612f04565b6109df565b61018b610236366004612f88565b610d7e565b63ffffffff8216600090815260056020526040812060609183600181111561026557610265612ae4565b600181111561027657610276612ae4565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561062a57600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff1660018111156102e9576102e9612ae4565b60018111156102fa576102fa612ae4565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a010000000000000000000090910416606082015260018201805460809092019161035290613045565b80601f016020809104026020016040519081016040528092919081815260200182805461037e90613045565b80156103cb5780601f106103a0576101008083540402835291602001916103cb565b820191906000526020600020905b8154815290600101906020018083116103ae57829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b8282101561055957838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461043690613045565b80601f016020809104026020016040519081016040528092919081815260200182805461046290613045565b80156104af5780601f10610484576101008083540402835291602001916104af565b820191906000526020600020905b81548152906001019060200180831161049257829003601f168201915b505050505081526020016002820180546104c890613045565b80601f01602080910402602001604051908101604052809291908181526020018280546104f490613045565b80156105415780601f1061051657610100808354040283529160200191610541565b820191906000526020600020905b81548152906001019060200180831161052457829003601f168201915b505050505081525050815260200190600101906103f9565b50505050815260200160038201805461057190613045565b80601f016020809104026020016040519081016040528092919081815260200182805461059d90613045565b80156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b505050919092525050508152600482015467ffffffffffffffff1660208083019190915260059092015460409091015290825260019290920191016102a4565b5050505090505b92915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146106bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60006107456003610e31565b905090565b606060006107586003610e31565b9050600061076684866130c7565b90508315806107755750818110155b156107b55760408051600080825260208201909252906107ab565b610798612801565b8152602001906001900390816107905790505b5092505050610631565b60006107c1858361310d565b9050828111156107ce5750815b60006107da8383613120565b67ffffffffffffffff8111156107f2576107f26130de565b60405190808252806020026020018201604052801561082b57816020015b610818612801565b8152602001906001900390816108105790505b509050600061083a6003610e3b565b9050835b838110156109be57600082828151811061085a5761085a613133565b60209081029190910181015160408051808201825267ffffffffffffffff8316808252600090815260028552829020825181546080818802830181019095526060820181815295975092958601949093919284928491908401828280156108e057602002820191906000526020600020905b8154815260200190600101908083116108cc575b5050509183525050600182015460ff16602082015260028201805460409092019161090a90613045565b80601f016020809104026020016040519081016040528092919081815260200182805461093690613045565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b5050509190925250505090528461099a8885613120565b815181106109aa576109aa613133565b60209081029190910101525060010161083e565b5090979650505050505050565b6109d3610e4f565b6109dc81610ed2565b50565b6109e7610e4f565b60005b83811015610bcd57610a2e858583818110610a0757610a07613133565b9050602002016020810190610a1c9190613162565b60039067ffffffffffffffff16610fc7565b610a9857848482818110610a4457610a44613133565b9050602002016020810190610a599190613162565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016106b4565b60026000868684818110610aae57610aae613133565b9050602002016020810190610ac39190613162565b67ffffffffffffffff1681526020810191909152604001600090812090610aea8282612849565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610b22600283016000612867565b5050610b60858583818110610b3957610b39613133565b9050602002016020810190610b4e9190613162565b60039067ffffffffffffffff16610fdf565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610b9457610b94613133565b9050602002016020810190610ba99190613162565b60405167ffffffffffffffff909116815260200160405180910390a16001016109ea565b5060005b81811015610d77576000838383818110610bed57610bed613133565b9050602002810190610bff919061317d565b610c0d9060208101906131bb565b610c169061334d565b90506000848484818110610c2c57610c2c613133565b9050602002810190610c3e919061317d565b610c4c906020810190613162565b9050610c5b8260000151610feb565b816020015160ff16600003610c9c576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120835180518593610ccc9284929101906128a1565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610d199082613475565b50610d3391506003905067ffffffffffffffff8316611137565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051610d6592919061358f565b60405180910390a15050600101610bd1565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610ded576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610dfc8587018761383c565b8151919350915015610e1457610e1483600084611143565b805115610e2757610e2783600183611143565b5050505050505050565b6000610631825490565b60606000610e4883611991565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ed0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016106b4565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016106b4565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610e48565b6000610e4883836119ed565b60005b81518110156111335760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe84848151811061104a5761104a613133565b60200260200101516040518263ffffffff1660e01b815260040161107091815260200190565b600060405180830381865afa15801561108d573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526110d3919081019061390a565b608001510361112b578181815181106110ee576110ee613133565b60200260200101516040517f8907a4fa0000000000000000000000000000000000000000000000000000000081526004016106b491815260200190565b600101610fee565b5050565b6000610e488383611ae7565b8051600210156111845780516040517f3e4785260000000000000000000000000000000000000000000000000000000081526004016106b491815260200190565b63ffffffff83166000908152600560205260408120818460018111156111ac576111ac612ae4565b60018111156111bd576111bd612ae4565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561157157600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff16600181111561123057611230612ae4565b600181111561124157611241612ae4565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a010000000000000000000090910416606082015260018201805460809092019161129990613045565b80601f01602080910402602001604051908101604052809291908181526020018280546112c590613045565b80156113125780601f106112e757610100808354040283529160200191611312565b820191906000526020600020905b8154815290600101906020018083116112f557829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156114a057838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461137d90613045565b80601f01602080910402602001604051908101604052809291908181526020018280546113a990613045565b80156113f65780601f106113cb576101008083540402835291602001916113f6565b820191906000526020600020905b8154815290600101906020018083116113d957829003601f168201915b5050505050815260200160028201805461140f90613045565b80601f016020809104026020016040519081016040528092919081815260200182805461143b90613045565b80156114885780601f1061145d57610100808354040283529160200191611488565b820191906000526020600020905b81548152906001019060200180831161146b57829003601f168201915b50505050508152505081526020019060010190611340565b5050505081526020016003820180546114b890613045565b80601f01602080910402602001604051908101604052809291908181526020018280546114e490613045565b80156115315780601f1061150657610100808354040283529160200191611531565b820191906000526020600020905b81548152906001019060200180831161151457829003601f168201915b505050919092525050508152600482015467ffffffffffffffff1660208083019190915260059092015460409091015290825260019290920191016111eb565b5050505090506000611584858385611b36565b90506115908282611f42565b63ffffffff85166000908152600560205260408120908560018111156115b8576115b8612ae4565b60018111156115c9576115c9612ae4565b815260200190815260200160002060006115e391906128ec565b60005b815181101561193657600082828151811061160357611603613133565b602002602001015160000151905085600181111561162357611623612ae4565b8151600181111561163657611636612ae4565b146116945782828151811061164d5761164d613133565b6020026020010151604001518682600001516040517f4e9bea2d0000000000000000000000000000000000000000000000000000000081526004016106b4939291906139e2565b63ffffffff87166000908152600560205260408120818860018111156116bc576116bc612ae4565b60018111156116cd576116cd612ae4565b8152602001908152602001600020600181600181540180825580915050039060005260206000209060060201905083838151811061170d5761170d613133565b602002602001015160400151816005018190555083838151811061173357611733613133565b60209081029190910181015101516004820180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9092169190911790558151815482919082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183818111156117b9576117b9612ae4565b021790555060208301518154604085015160608601517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a01000000000000000000009290911691909102178155608083015160018201906118889082613475565b5060c0830151600382019061189d9082613475565b5060005b8360a001515181101561192757816002018460a0015182815181106118c8576118c8613133565b60209081029190910181015182546001818101855560009485529383902082516003909202019081559181015190928201906119049082613475565b50604082015160028201906119199082613475565b5050508060010190506118a1565b505050508060010190506115e6565b5083600181111561194957611949612ae4565b60ff168563ffffffff167f0fe4c45ffc7f05233ddfee7d79ac01d075176a0aa116068c486a2f7490088a0b836040516119829190612bd3565b60405180910390a35050505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156119e157602002820191906000526020600020905b8154815260200190600101908083116119cd575b50505050509050919050565b60008181526001830160205260408120548015611ad6576000611a11600183613120565b8554909150600090611a2590600190613120565b9050808214611a8a576000866000018281548110611a4557611a45613133565b9060005260206000200154905080876000018481548110611a6857611a68613133565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a9b57611a9b613a03565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610631565b6000915050610631565b5092915050565b6000818152600183016020526040812054611b2e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610631565b506000610631565b6060600083516002811115611b4d57611b4d612ae4565b9050600083516002811115611b6457611b64612ae4565b9050611b7082826122c1565b6000845167ffffffffffffffff811115611b8c57611b8c6130de565b604051908082528060200260200182016040528015611bb5578160200160208202803683370190505b5090506000836002811115611bcc57611bcc612ae4565b148015611bea57506001826002811115611be857611be8612ae4565b145b15611c2b57600181600081518110611c0457611c04613133565b602002602001019067ffffffffffffffff16908167ffffffffffffffff1681525050611d93565b6001836002811115611c3f57611c3f612ae4565b148015611c5d57506002826002811115611c5b57611c5b612ae4565b145b15611cf45785600081518110611c7557611c75613133565b60200260200101516020015181600081518110611c9457611c94613133565b602002602001019067ffffffffffffffff16908167ffffffffffffffff168152505085600081518110611cc957611cc9613133565b6020026020010151602001516001611ce19190613a32565b81600181518110611c0457611c04613133565b6002836002811115611d0857611d08612ae4565b148015611d2657506001826002811115611d2457611d24612ae4565b145b15611d5d5785600181518110611d3e57611d3e613133565b60200260200101516020015181600081518110611c0457611c04613133565b82826040517f0a6b675b0000000000000000000000000000000000000000000000000000000081526004016106b4929190613a63565b6000855167ffffffffffffffff811115611daf57611daf6130de565b604051908082528060200260200182016040528015611e4d57816020015b6040805161014081018252600060608083018281526080840183905260a0840183905260c0840183905260e084018290526101008401829052610120840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181611dcd5790505b50905060005b8251811015611f3657611e7e878281518110611e7157611e71613133565b6020026020010151612347565b6040518060600160405280888381518110611e9b57611e9b613133565b60200260200101518152602001848381518110611eba57611eba613133565b602002602001015167ffffffffffffffff168152602001611f0e8b868581518110611ee757611ee7613133565b60200260200101518b8681518110611f0157611f01613133565b6020026020010151612741565b815250828281518110611f2357611f23613133565b6020908102919091010152600101611e53565b50979650505050505050565b8151815181158015611f545750806001145b15611ff65782600081518110611f6c57611f6c613133565b60200260200101516020015167ffffffffffffffff16600114611ff05782600081518110611f9c57611f9c613133565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152600160248201526044016106b4565b50505050565b8160011480156120065750806002145b156121bc578360008151811061201e5761201e613133565b6020026020010151604001518360008151811061203d5761203d613133565b602002602001015160400151146120c9578260008151811061206157612061613133565b6020026020010151604001518460008151811061208057612080613133565b6020026020010151604001516040517fc7ccdd7f0000000000000000000000000000000000000000000000000000000081526004016106b4929190918252602082015260400190565b836000815181106120dc576120dc613133565b60200260200101516020015160016120f49190613a32565b67ffffffffffffffff168360018151811061211157612111613133565b60200260200101516020015167ffffffffffffffff1614611ff0578260018151811061213f5761213f613133565b6020026020010151602001518460008151811061215e5761215e613133565b60200260200101516020015160016121769190613a32565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9283166004820152911660248201526044016106b4565b8160021480156121cc5750806001145b1561228f57836001815181106121e4576121e4613133565b6020026020010151604001518360008151811061220357612203613133565b60200260200101516040015114611ff0578260008151811061222757612227613133565b6020026020010151604001518460018151811061224657612246613133565b6020026020010151604001516040517f9e9756700000000000000000000000000000000000000000000000000000000081526004016106b4929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260028111156122d5576122d5612ae4565b8260028111156122e7576122e7612ae4565b6122f19190613a7e565b9050806001148061233d5750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14801561233d5750600283600281111561233b5761233b612ae4565b145b15611d5d57505050565b806020015167ffffffffffffffff1660000361238f576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815160018111156123a4576123a4612ae4565b141580156123c557506001815160018111156123c2576123c2612ae4565b14155b156123fc576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151511580612439575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b15612470576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602081015161248b9060039067ffffffffffffffff16610fc7565b6124d35760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016106b4565b60408082015160208084015167ffffffffffffffff1660009081526002909152919091206001015460ff918216911681811115612546576040517f2db2204000000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016106b4565b60a083015151610100811115612588576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6125938360036130c7565b81116125cb576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808267ffffffffffffffff8111156125e7576125e76130de565b604051908082528060200260200182016040528015612610578160200160208202803683370190505b50905060005b838110156126d05760008760a00151828151811061263657612636613133565b6020026020010151905080604001515160001461265b578361265781613a9e565b9450505b602081015151158061266c57508051155b156126a557806040517f9fa403140000000000000000000000000000000000000000000000000000000081526004016106b49190613ad6565b80600001518383815181106126bc576126bc613133565b602090810291909101015250600101612616565b5060006126de8560036130c7565b6126e990600161310d565b90508083101561272f576040517f548dd21f00000000000000000000000000000000000000000000000000000000815260048101849052602481018290526044016106b4565b61273882610feb565b50505050505050565b60008082602001518584600001518560800151878760a00151886040015189606001518a60c0015160405160200161278199989796959493929190613ae9565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a0000000000000000000000000000000000000000000000000000000000001795945050505050565b6040518060400160405280600067ffffffffffffffff168152602001612844604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b50805460008255906000526020600020908101906109dc919061290d565b50805461287390613045565b6000825580601f10612883575050565b601f0160209004906000526020600020908101906109dc919061290d565b8280548282559060005260206000209081019282156128dc579160200282015b828111156128dc5782518255916020019190600101906128c1565b506128e892915061290d565b5090565b50805460008255600602906000526020600020908101906109dc9190612922565b5b808211156128e8576000815560010161290e565b808211156128e85780547fffffffffffffffffffffffffffff000000000000000000000000000000000000168155600081816129616001830182612867565b61296f6002830160006129b9565b61297d600383016000612867565b5050506004810180547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016905560006005820155600601612922565b50805460008255600302906000526020600020908101906109dc91905b808211156128e85760008082556129f06001830182612867565b6129fe600283016000612867565b506003016129d6565b6000815180845260005b81811015612a2d57602081850181015186830182015201612a11565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610e486020830184612a07565b63ffffffff811681146109dc57600080fd5b8035612a9b81612a7e565b919050565b803560028110612a9b57600080fd5b60008060408385031215612ac257600080fd5b8235612acd81612a7e565b9150612adb60208401612aa0565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110612b2357612b23612ae4565b9052565b805182526000602082015160606020850152612b466060850182612a07565b905060408301518482036040860152612b5f8282612a07565b95945050505050565b60008282518085526020808601955060208260051b8401016020860160005b848110156109be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612bc1838351612b27565b98840198925090830190600101612b87565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015612d37577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160608151818652612c418287018251612b13565b89810151608067ffffffffffffffff8216818901528a830151915060a060ff8316818a015284840151945060c09250612c85838a018667ffffffffffffffff169052565b81840151945060e0915081828a0152612ca26101408a0186612a07565b9450808401519150507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa080898603016101008a0152612ce18583612b68565b9290930151888303909301610120890152509150612cff8282612a07565b91505088820151612d1b8a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101612bfc565b509098975050505050505050565b600060208284031215612d5757600080fd5b8135610e4881612a7e565b60008060408385031215612d7557600080fd5b50508035926020909101359150565b805160608084528151908401819052600091602091908201906080860190845b81811015612dc057835183529284019291840191600101612da4565b505060ff6020860151166020870152604085015192508581036040870152612de88184612a07565b9695505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015612d37578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff168452870151878401879052612e6f87850182612d84565b9588019593505090860190600101612e1b565b600060208284031215612e9457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610e4857600080fd5b60008083601f840112612eca57600080fd5b50813567ffffffffffffffff811115612ee257600080fd5b6020830191508360208260051b8501011115612efd57600080fd5b9250929050565b60008060008060408587031215612f1a57600080fd5b843567ffffffffffffffff80821115612f3257600080fd5b612f3e88838901612eb8565b90965094506020870135915080821115612f5757600080fd5b50612f6487828801612eb8565b95989497509550505050565b803567ffffffffffffffff81168114612a9b57600080fd5b60008060008060008060808789031215612fa157600080fd5b863567ffffffffffffffff80821115612fb957600080fd5b612fc58a838b01612eb8565b90985096506020890135915080821115612fde57600080fd5b818901915089601f830112612ff257600080fd5b81358181111561300157600080fd5b8a602082850101111561301357600080fd5b60208301965080955050505061302b60408801612f70565b915061303960608801612a90565b90509295509295509295565b600181811c9082168061305957607f821691505b602082108103613092577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761063157610631613098565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8082018082111561063157610631613098565b8181038181111561063157610631613098565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561317457600080fd5b610e4882612f70565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126131b157600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126131b157600080fd5b6040516060810167ffffffffffffffff81118282101715613212576132126130de565b60405290565b60405160e0810167ffffffffffffffff81118282101715613212576132126130de565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613282576132826130de565b604052919050565b600067ffffffffffffffff8211156132a4576132a46130de565b5060051b60200190565b803560ff81168114612a9b57600080fd5b600082601f8301126132d057600080fd5b813567ffffffffffffffff8111156132ea576132ea6130de565b61331b60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161323b565b81815284602083860101111561333057600080fd5b816020850160208301376000918101602001919091529392505050565b60006060823603121561335f57600080fd5b6133676131ef565b823567ffffffffffffffff8082111561337f57600080fd5b9084019036601f83011261339257600080fd5b813560206133a76133a28361328a565b61323b565b82815260059290921b840181019181810190368411156133c657600080fd5b948201945b838610156133e4578535825294820194908201906133cb565b8652506133f28782016132ae565b9085015250604085013591508082111561340b57600080fd5b50613418368286016132bf565b60408301525092915050565b601f821115613470576000816000526020600020601f850160051c8101602086101561344d5750805b601f850160051c820191505b8181101561346c57828155600101613459565b5050505b505050565b815167ffffffffffffffff81111561348f5761348f6130de565b6134a38161349d8454613045565b84613424565b602080601f8311600181146134f657600084156134c05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561346c565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561354357888601518255948401946001909101908401613524565b508582101561357f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff831681526040602082015260006135b26040830184612d84565b949350505050565b600082601f8301126135cb57600080fd5b813560206135db6133a28361328a565b82815260059290921b840181019181810190868411156135fa57600080fd5b8286015b848110156136c257803567ffffffffffffffff8082111561361f5760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156136585760008081fd5b6136606131ef565b8784013581526040808501358481111561367a5760008081fd5b6136888e8b838901016132bf565b838b0152509184013591838311156136a05760008081fd5b6136ae8d8a858801016132bf565b9082015286525050509183019183016135fe565b509695505050505050565b600082601f8301126136de57600080fd5b813560206136ee6133a28361328a565b82815260059290921b8401810191818101908684111561370d57600080fd5b8286015b848110156136c257803567ffffffffffffffff808211156137325760008081fd5b818901915060e0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d0301121561376b5760008081fd5b613773613218565b61377e888501612aa0565b8152604061378d818601612f70565b89830152606061379e8187016132ae565b82840152608091506137b1828701612f70565b9083015260a085810135858111156137c95760008081fd5b6137d78f8c838a01016132bf565b838501525060c0915081860135858111156137f25760008081fd5b6138008f8c838a01016135ba565b8285015250508285013592508383111561381a5760008081fd5b6138288d8a858801016132bf565b908201528652505050918301918301613711565b6000806040838503121561384f57600080fd5b823567ffffffffffffffff8082111561386757600080fd5b613873868387016136cd565b9350602085013591508082111561388957600080fd5b50613896858286016136cd565b9150509250929050565b8051612a9b81612a7e565b600082601f8301126138bc57600080fd5b815160206138cc6133a28361328a565b8083825260208201915060208460051b8701019350868411156138ee57600080fd5b602086015b848110156136c257805183529183019183016138f3565b60006020828403121561391c57600080fd5b815167ffffffffffffffff8082111561393457600080fd5b9083019060e0828603121561394857600080fd5b613950613218565b613959836138a0565b8152613967602084016138a0565b6020820152613978604084016138a0565b6040820152606083015160608201526080830151608082015260a0830151828111156139a357600080fd5b6139af878286016138ab565b60a08301525060c0830151828111156139c757600080fd5b6139d3878286016138ab565b60c08301525095945050505050565b838152606081016139f66020830185612b13565b6135b26040830184612b13565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b67ffffffffffffffff818116838216019080821115611ae057611ae0613098565b60038110612b2357612b23612ae4565b60408101613a718285613a53565b610e486020830184613a53565b8181036000831280158383131683831282161715611ae057611ae0613098565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613acf57613acf613098565b5060010190565b602081526000610e486020830184612b27565b600061012067ffffffffffffffff808d168452602063ffffffff8d1681860152613b16604086018d612b13565b826060860152613b288386018c612a07565b918a16608086015284820360a0860152885180835291925080830191600581901b84018201828b0160005b83811015613b9f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0878403018652613b8d838351612b27565b95850195925090840190600101613b53565b505060ff8a1660c088015267ffffffffffffffff891660e0880152868103610100880152613bcd8189612a07565b955050505050509a995050505050505050505056fea164736f6c6343000818000a", +} + +var CCIPHomeABI = CCIPHomeMetaData.ABI + +var CCIPHomeBin = CCIPHomeMetaData.Bin + +func DeployCCIPHome(auth *bind.TransactOpts, backend bind.ContractBackend, capabilitiesRegistry common.Address) (common.Address, *types.Transaction, *CCIPHome, error) { + parsed, err := CCIPHomeMetaData.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(CCIPHomeBin), backend, capabilitiesRegistry) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CCIPHome{address: address, abi: *parsed, CCIPHomeCaller: CCIPHomeCaller{contract: contract}, CCIPHomeTransactor: CCIPHomeTransactor{contract: contract}, CCIPHomeFilterer: CCIPHomeFilterer{contract: contract}}, nil +} + +type CCIPHome struct { + address common.Address + abi abi.ABI + CCIPHomeCaller + CCIPHomeTransactor + CCIPHomeFilterer +} + +type CCIPHomeCaller struct { + contract *bind.BoundContract +} + +type CCIPHomeTransactor struct { + contract *bind.BoundContract +} + +type CCIPHomeFilterer struct { + contract *bind.BoundContract +} + +type CCIPHomeSession struct { + Contract *CCIPHome + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CCIPHomeCallerSession struct { + Contract *CCIPHomeCaller + CallOpts bind.CallOpts +} + +type CCIPHomeTransactorSession struct { + Contract *CCIPHomeTransactor + TransactOpts bind.TransactOpts +} + +type CCIPHomeRaw struct { + Contract *CCIPHome +} + +type CCIPHomeCallerRaw struct { + Contract *CCIPHomeCaller +} + +type CCIPHomeTransactorRaw struct { + Contract *CCIPHomeTransactor +} + +func NewCCIPHome(address common.Address, backend bind.ContractBackend) (*CCIPHome, error) { + abi, err := abi.JSON(strings.NewReader(CCIPHomeABI)) + if err != nil { + return nil, err + } + contract, err := bindCCIPHome(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CCIPHome{address: address, abi: abi, CCIPHomeCaller: CCIPHomeCaller{contract: contract}, CCIPHomeTransactor: CCIPHomeTransactor{contract: contract}, CCIPHomeFilterer: CCIPHomeFilterer{contract: contract}}, nil +} + +func NewCCIPHomeCaller(address common.Address, caller bind.ContractCaller) (*CCIPHomeCaller, error) { + contract, err := bindCCIPHome(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CCIPHomeCaller{contract: contract}, nil +} + +func NewCCIPHomeTransactor(address common.Address, transactor bind.ContractTransactor) (*CCIPHomeTransactor, error) { + contract, err := bindCCIPHome(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CCIPHomeTransactor{contract: contract}, nil +} + +func NewCCIPHomeFilterer(address common.Address, filterer bind.ContractFilterer) (*CCIPHomeFilterer, error) { + contract, err := bindCCIPHome(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CCIPHomeFilterer{contract: contract}, nil +} + +func bindCCIPHome(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CCIPHomeMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CCIPHome *CCIPHomeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CCIPHome.Contract.CCIPHomeCaller.contract.Call(opts, result, method, params...) +} + +func (_CCIPHome *CCIPHomeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPHome.Contract.CCIPHomeTransactor.contract.Transfer(opts) +} + +func (_CCIPHome *CCIPHomeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CCIPHome.Contract.CCIPHomeTransactor.contract.Transact(opts, method, params...) +} + +func (_CCIPHome *CCIPHomeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CCIPHome.Contract.contract.Call(opts, result, method, params...) +} + +func (_CCIPHome *CCIPHomeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPHome.Contract.contract.Transfer(opts) +} + +func (_CCIPHome *CCIPHomeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CCIPHome.Contract.contract.Transact(opts, method, params...) +} + +func (_CCIPHome *CCIPHomeCaller) GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigInfo, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getAllChainConfigs", pageIndex, pageSize) + + if err != nil { + return *new([]CCIPHomeChainConfigInfo), err + } + + out0 := *abi.ConvertType(out[0], new([]CCIPHomeChainConfigInfo)).(*[]CCIPHomeChainConfigInfo) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigInfo, error) { + return _CCIPHome.Contract.GetAllChainConfigs(&_CCIPHome.CallOpts, pageIndex, pageSize) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigInfo, error) { + return _CCIPHome.Contract.GetAllChainConfigs(&_CCIPHome.CallOpts, pageIndex, pageSize) +} + +func (_CCIPHome *CCIPHomeCaller) GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getCapabilityConfiguration", arg0) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetCapabilityConfiguration(arg0 uint32) ([]byte, error) { + return _CCIPHome.Contract.GetCapabilityConfiguration(&_CCIPHome.CallOpts, arg0) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetCapabilityConfiguration(arg0 uint32) ([]byte, error) { + return _CCIPHome.Contract.GetCapabilityConfiguration(&_CCIPHome.CallOpts, arg0) +} + +func (_CCIPHome *CCIPHomeCaller) GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getCapabilityRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetCapabilityRegistry() (common.Address, error) { + return _CCIPHome.Contract.GetCapabilityRegistry(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetCapabilityRegistry() (common.Address, error) { + return _CCIPHome.Contract.GetCapabilityRegistry(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCaller) GetNumChainConfigurations(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getNumChainConfigurations") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetNumChainConfigurations() (*big.Int, error) { + return _CCIPHome.Contract.GetNumChainConfigurations(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetNumChainConfigurations() (*big.Int, error) { + return _CCIPHome.Contract.GetNumChainConfigurations(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCaller) GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPHomeOCR3ConfigWithMeta, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getOCRConfig", donId, pluginType) + + if err != nil { + return *new([]CCIPHomeOCR3ConfigWithMeta), err + } + + out0 := *abi.ConvertType(out[0], new([]CCIPHomeOCR3ConfigWithMeta)).(*[]CCIPHomeOCR3ConfigWithMeta) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPHomeOCR3ConfigWithMeta, error) { + return _CCIPHome.Contract.GetOCRConfig(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPHomeOCR3ConfigWithMeta, error) { + return _CCIPHome.Contract.GetOCRConfig(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CCIPHome.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 (_CCIPHome *CCIPHomeSession) Owner() (common.Address, error) { + return _CCIPHome.Contract.Owner(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCallerSession) Owner() (common.Address, error) { + return _CCIPHome.Contract.Owner(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) TypeAndVersion() (string, error) { + return _CCIPHome.Contract.TypeAndVersion(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeCallerSession) TypeAndVersion() (string, error) { + return _CCIPHome.Contract.TypeAndVersion(&_CCIPHome.CallOpts) +} + +func (_CCIPHome *CCIPHomeTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "acceptOwnership") +} + +func (_CCIPHome *CCIPHomeSession) AcceptOwnership() (*types.Transaction, error) { + return _CCIPHome.Contract.AcceptOwnership(&_CCIPHome.TransactOpts) +} + +func (_CCIPHome *CCIPHomeTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CCIPHome.Contract.AcceptOwnership(&_CCIPHome.TransactOpts) +} + +func (_CCIPHome *CCIPHomeTransactor) ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPHomeChainConfigInfo) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "applyChainConfigUpdates", chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPHome *CCIPHomeSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPHomeChainConfigInfo) (*types.Transaction, error) { + return _CCIPHome.Contract.ApplyChainConfigUpdates(&_CCIPHome.TransactOpts, chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPHome *CCIPHomeTransactorSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPHomeChainConfigInfo) (*types.Transaction, error) { + return _CCIPHome.Contract.ApplyChainConfigUpdates(&_CCIPHome.TransactOpts, chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPHome *CCIPHomeTransactor) BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "beforeCapabilityConfigSet", arg0, config, arg2, donId) +} + +func (_CCIPHome *CCIPHomeSession) BeforeCapabilityConfigSet(arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPHome.Contract.BeforeCapabilityConfigSet(&_CCIPHome.TransactOpts, arg0, config, arg2, donId) +} + +func (_CCIPHome *CCIPHomeTransactorSession) BeforeCapabilityConfigSet(arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPHome.Contract.BeforeCapabilityConfigSet(&_CCIPHome.TransactOpts, arg0, config, arg2, donId) +} + +func (_CCIPHome *CCIPHomeTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "transferOwnership", to) +} + +func (_CCIPHome *CCIPHomeSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CCIPHome.Contract.TransferOwnership(&_CCIPHome.TransactOpts, to) +} + +func (_CCIPHome *CCIPHomeTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CCIPHome.Contract.TransferOwnership(&_CCIPHome.TransactOpts, to) +} + +type CCIPHomeCapabilityConfigurationSetIterator struct { + Event *CCIPHomeCapabilityConfigurationSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeCapabilityConfigurationSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeCapabilityConfigurationSet) + 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(CCIPHomeCapabilityConfigurationSet) + 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 *CCIPHomeCapabilityConfigurationSetIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeCapabilityConfigurationSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeCapabilityConfigurationSet struct { + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterCapabilityConfigurationSet(opts *bind.FilterOpts) (*CCIPHomeCapabilityConfigurationSetIterator, error) { + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "CapabilityConfigurationSet") + if err != nil { + return nil, err + } + return &CCIPHomeCapabilityConfigurationSetIterator{contract: _CCIPHome.contract, event: "CapabilityConfigurationSet", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchCapabilityConfigurationSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeCapabilityConfigurationSet) (event.Subscription, error) { + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "CapabilityConfigurationSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeCapabilityConfigurationSet) + if err := _CCIPHome.contract.UnpackLog(event, "CapabilityConfigurationSet", 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 (_CCIPHome *CCIPHomeFilterer) ParseCapabilityConfigurationSet(log types.Log) (*CCIPHomeCapabilityConfigurationSet, error) { + event := new(CCIPHomeCapabilityConfigurationSet) + if err := _CCIPHome.contract.UnpackLog(event, "CapabilityConfigurationSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPHomeChainConfigRemovedIterator struct { + Event *CCIPHomeChainConfigRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeChainConfigRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeChainConfigRemoved) + 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(CCIPHomeChainConfigRemoved) + 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 *CCIPHomeChainConfigRemovedIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeChainConfigRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeChainConfigRemoved struct { + ChainSelector uint64 + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterChainConfigRemoved(opts *bind.FilterOpts) (*CCIPHomeChainConfigRemovedIterator, error) { + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "ChainConfigRemoved") + if err != nil { + return nil, err + } + return &CCIPHomeChainConfigRemovedIterator{contract: _CCIPHome.contract, event: "ChainConfigRemoved", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchChainConfigRemoved(opts *bind.WatchOpts, sink chan<- *CCIPHomeChainConfigRemoved) (event.Subscription, error) { + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "ChainConfigRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeChainConfigRemoved) + if err := _CCIPHome.contract.UnpackLog(event, "ChainConfigRemoved", 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 (_CCIPHome *CCIPHomeFilterer) ParseChainConfigRemoved(log types.Log) (*CCIPHomeChainConfigRemoved, error) { + event := new(CCIPHomeChainConfigRemoved) + if err := _CCIPHome.contract.UnpackLog(event, "ChainConfigRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPHomeChainConfigSetIterator struct { + Event *CCIPHomeChainConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeChainConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeChainConfigSet) + 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(CCIPHomeChainConfigSet) + 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 *CCIPHomeChainConfigSetIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeChainConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeChainConfigSet struct { + ChainSelector uint64 + ChainConfig CCIPHomeChainConfig + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterChainConfigSet(opts *bind.FilterOpts) (*CCIPHomeChainConfigSetIterator, error) { + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "ChainConfigSet") + if err != nil { + return nil, err + } + return &CCIPHomeChainConfigSetIterator{contract: _CCIPHome.contract, event: "ChainConfigSet", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchChainConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeChainConfigSet) (event.Subscription, error) { + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "ChainConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeChainConfigSet) + if err := _CCIPHome.contract.UnpackLog(event, "ChainConfigSet", 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 (_CCIPHome *CCIPHomeFilterer) ParseChainConfigSet(log types.Log) (*CCIPHomeChainConfigSet, error) { + event := new(CCIPHomeChainConfigSet) + if err := _CCIPHome.contract.UnpackLog(event, "ChainConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPHomeConfigSetIterator struct { + Event *CCIPHomeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeConfigSet) + 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(CCIPHomeConfigSet) + 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 *CCIPHomeConfigSetIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeConfigSet struct { + DonId uint32 + PluginType uint8 + Config []CCIPHomeOCR3ConfigWithMeta + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterConfigSet(opts *bind.FilterOpts, donId []uint32, pluginType []uint8) (*CCIPHomeConfigSetIterator, error) { + + var donIdRule []interface{} + for _, donIdItem := range donId { + donIdRule = append(donIdRule, donIdItem) + } + var pluginTypeRule []interface{} + for _, pluginTypeItem := range pluginType { + pluginTypeRule = append(pluginTypeRule, pluginTypeItem) + } + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "ConfigSet", donIdRule, pluginTypeRule) + if err != nil { + return nil, err + } + return &CCIPHomeConfigSetIterator{contract: _CCIPHome.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeConfigSet, donId []uint32, pluginType []uint8) (event.Subscription, error) { + + var donIdRule []interface{} + for _, donIdItem := range donId { + donIdRule = append(donIdRule, donIdItem) + } + var pluginTypeRule []interface{} + for _, pluginTypeItem := range pluginType { + pluginTypeRule = append(pluginTypeRule, pluginTypeItem) + } + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "ConfigSet", donIdRule, pluginTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeConfigSet) + if err := _CCIPHome.contract.UnpackLog(event, "ConfigSet", 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 (_CCIPHome *CCIPHomeFilterer) ParseConfigSet(log types.Log) (*CCIPHomeConfigSet, error) { + event := new(CCIPHomeConfigSet) + if err := _CCIPHome.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPHomeOwnershipTransferRequestedIterator struct { + Event *CCIPHomeOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeOwnershipTransferRequested) + 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(CCIPHomeOwnershipTransferRequested) + 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 *CCIPHomeOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPHomeOwnershipTransferRequestedIterator, 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 := _CCIPHome.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CCIPHomeOwnershipTransferRequestedIterator{contract: _CCIPHome.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CCIPHomeOwnershipTransferRequested, 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 := _CCIPHome.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(CCIPHomeOwnershipTransferRequested) + if err := _CCIPHome.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 (_CCIPHome *CCIPHomeFilterer) ParseOwnershipTransferRequested(log types.Log) (*CCIPHomeOwnershipTransferRequested, error) { + event := new(CCIPHomeOwnershipTransferRequested) + if err := _CCIPHome.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPHomeOwnershipTransferredIterator struct { + Event *CCIPHomeOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeOwnershipTransferred) + 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(CCIPHomeOwnershipTransferred) + 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 *CCIPHomeOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPHomeOwnershipTransferredIterator, 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 := _CCIPHome.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CCIPHomeOwnershipTransferredIterator{contract: _CCIPHome.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CCIPHomeOwnershipTransferred, 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 := _CCIPHome.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(CCIPHomeOwnershipTransferred) + if err := _CCIPHome.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 (_CCIPHome *CCIPHomeFilterer) ParseOwnershipTransferred(log types.Log) (*CCIPHomeOwnershipTransferred, error) { + event := new(CCIPHomeOwnershipTransferred) + if err := _CCIPHome.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_CCIPHome *CCIPHome) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CCIPHome.abi.Events["CapabilityConfigurationSet"].ID: + return _CCIPHome.ParseCapabilityConfigurationSet(log) + case _CCIPHome.abi.Events["ChainConfigRemoved"].ID: + return _CCIPHome.ParseChainConfigRemoved(log) + case _CCIPHome.abi.Events["ChainConfigSet"].ID: + return _CCIPHome.ParseChainConfigSet(log) + case _CCIPHome.abi.Events["ConfigSet"].ID: + return _CCIPHome.ParseConfigSet(log) + case _CCIPHome.abi.Events["OwnershipTransferRequested"].ID: + return _CCIPHome.ParseOwnershipTransferRequested(log) + case _CCIPHome.abi.Events["OwnershipTransferred"].ID: + return _CCIPHome.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CCIPHomeCapabilityConfigurationSet) Topic() common.Hash { + return common.HexToHash("0x84ad7751b744c9e2ee77da1d902b428aec7f0a343d67a24bbe2142e6f58a8d0f") +} + +func (CCIPHomeChainConfigRemoved) Topic() common.Hash { + return common.HexToHash("0x2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0") +} + +func (CCIPHomeChainConfigSet) Topic() common.Hash { + return common.HexToHash("0x05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e0") +} + +func (CCIPHomeConfigSet) Topic() common.Hash { + return common.HexToHash("0x0fe4c45ffc7f05233ddfee7d79ac01d075176a0aa116068c486a2f7490088a0b") +} + +func (CCIPHomeOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CCIPHomeOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_CCIPHome *CCIPHome) Address() common.Address { + return _CCIPHome.address +} + +type CCIPHomeInterface interface { + GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigInfo, error) + + GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) + + GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) + + GetNumChainConfigurations(opts *bind.CallOpts) (*big.Int, error) + + GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPHomeOCR3ConfigWithMeta, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPHomeChainConfigInfo) (*types.Transaction, error) + + BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterCapabilityConfigurationSet(opts *bind.FilterOpts) (*CCIPHomeCapabilityConfigurationSetIterator, error) + + WatchCapabilityConfigurationSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeCapabilityConfigurationSet) (event.Subscription, error) + + ParseCapabilityConfigurationSet(log types.Log) (*CCIPHomeCapabilityConfigurationSet, error) + + FilterChainConfigRemoved(opts *bind.FilterOpts) (*CCIPHomeChainConfigRemovedIterator, error) + + WatchChainConfigRemoved(opts *bind.WatchOpts, sink chan<- *CCIPHomeChainConfigRemoved) (event.Subscription, error) + + ParseChainConfigRemoved(log types.Log) (*CCIPHomeChainConfigRemoved, error) + + FilterChainConfigSet(opts *bind.FilterOpts) (*CCIPHomeChainConfigSetIterator, error) + + WatchChainConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeChainConfigSet) (event.Subscription, error) + + ParseChainConfigSet(log types.Log) (*CCIPHomeChainConfigSet, error) + + FilterConfigSet(opts *bind.FilterOpts, donId []uint32, pluginType []uint8) (*CCIPHomeConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeConfigSet, donId []uint32, pluginType []uint8) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CCIPHomeConfigSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPHomeOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CCIPHomeOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CCIPHomeOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPHomeOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CCIPHomeOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CCIPHomeOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go b/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go index 5056db1005..012c66daae 100644 --- a/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go +++ b/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go @@ -28,24 +28,24 @@ var ( _ = abi.ConvertType ) -type CCIPConfigTypesOCR3Config struct { +type CCIPHomeOCR3Config struct { PluginType uint8 ChainSelector uint64 FRoleDON uint8 OffchainConfigVersion uint64 OfframpAddress []byte - Nodes []CCIPConfigTypesOCR3Node + Nodes []CCIPHomeOCR3Node OffchainConfig []byte } -type CCIPConfigTypesOCR3Node struct { +type CCIPHomeOCR3Node struct { P2pId [32]byte SignerKey []byte TransmitterKey []byte } var IOCR3ConfigEncoderMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"name\":\"exposeOCR3Config\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"name\":\"exposeOCR3Config\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } var IOCR3ConfigEncoderABI = IOCR3ConfigEncoderMetaData.ABI @@ -166,7 +166,7 @@ func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transact(opts *bind. return _IOCR3ConfigEncoder.Contract.contract.Transact(opts, method, params...) } -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCaller) ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) { +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCaller) ExposeOCR3Config(opts *bind.CallOpts, config []CCIPHomeOCR3Config) ([]byte, error) { var out []interface{} err := _IOCR3ConfigEncoder.contract.Call(opts, &out, "exposeOCR3Config", config) @@ -180,11 +180,11 @@ func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCaller) ExposeOCR3Config(opts *bind } -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderSession) ExposeOCR3Config(config []CCIPHomeOCR3Config) ([]byte, error) { return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) } -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerSession) ExposeOCR3Config(config []CCIPHomeOCR3Config) ([]byte, error) { return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) } @@ -193,7 +193,7 @@ func (_IOCR3ConfigEncoder *IOCR3ConfigEncoder) Address() common.Address { } type IOCR3ConfigEncoderInterface interface { - ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) + ExposeOCR3Config(opts *bind.CallOpts, config []CCIPHomeOCR3Config) ([]byte, error) Address() common.Address } diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 4a2054edf2..e2eb04e6b0 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -4,8 +4,8 @@ burn_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMint burn_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.bin 717c079d5d13300cf3c3ee871c6e5bf9af904411f204fb081a9f3b263cca1391 burn_with_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.bin 6333d0314d0bd29e75ea5e05fe62a4516ade0c6db91c30b6f93645035db52ed8 burn_with_from_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.bin 08ed1235dda921ce8841b26aa18d0c0f36db4884779dd7670857159801b6d597 -ccip_config: ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin f67d4a98804a9534a6554da3a57779632d55ad76db5ecc16ade74774769cdd69 ccip_encoding_utils: ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.bin ebabd5311ad4374df0f2f5cd5640bb58d938d92f5a82962ac4df7b6e5af2c197 +ccip_home: ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.abi ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.bin 0dad31438a094c33484189c0160ee9bc28a6909eabeb9450664313867521faec ccip_reader_tester: ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin 1181c7150062d6f0793beb50cb6b984c7f7adef0b9528ef1b419923fffcfdcac commit_store: ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.abi ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.bin 274d87db70b643e00ab0a7e7845bb4b791f3b613bfc87708d33fc5a8369e2a41 commit_store_helper: ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.abi ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.bin f7128dcc2ee6dbcbc976288abcc16970ffb19b59412c5202ef6b259d2007f801 @@ -23,7 +23,7 @@ mock_v3_aggregator_contract: ../../../contracts/solc/v0.8.24/MockV3Aggregator/Mo multi_aggregate_rate_limiter: ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin 0b541232e49727e947dc164eadf35963c66e67576f21baa0ecaa06a8833148ed multi_ocr3_helper: ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.abi ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.bin 04b6b261dd71925670bf4d904aaf7bf08543452009feefb88e07d4c49d12e969 nonce_manager: ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin 6f64e1083b356c06ee66b9138e398b9c97a4cd3e8c9ec38cf3010cebc79af536 -ocr3_config_encoder: ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin d507c3ac70a7d1033b75151c1e5b854b41aaee164dfaa3e5477de400db1aa1f7 +ocr3_config_encoder: ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin 58c7370bf78222f56e41ea232c806b1c375aa2436e9ce46c5122f77628ccb3e8 offramp: ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin 941b18b4e2aef977195fefba514e17c9475667e6f8513b18cabfb07ff90136ce onramp: ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.abi ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.bin 1f31a62ebb3fa5f4702ee27d4fa86604de5afff56787ef67c8dac764eefd2956 ping_pong_demo: ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin c1c2f8a65c7ffd971899cae7fe62f2da57d09e936151e2b92163c4bebe699d6b diff --git a/core/gethwrappers/ccip/go_generate.go b/core/gethwrappers/ccip/go_generate.go index 8f3102525a..2f3ace25a2 100644 --- a/core/gethwrappers/ccip/go_generate.go +++ b/core/gethwrappers/ccip/go_generate.go @@ -16,7 +16,7 @@ package ccip //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin MultiAggregateRateLimiter multi_aggregate_rate_limiter //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/Router/Router.abi ../../../contracts/solc/v0.8.24/Router/Router.bin Router router //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.abi ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.bin FeeQuoter fee_quoter -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin CCIPConfig ccip_config +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.abi ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.bin CCIPHome ccip_home //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin NonceManager nonce_manager // Pools From 40a891f44ba233f3d64c9d227e338c4620b7af36 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 14:59:57 +0200 Subject: [PATCH 6/7] put back 165 --- contracts/gas-snapshots/ccip.gas-snapshot | 40 +++++++++---------- .../src/v0.8/ccip/capability/CCIPHome.sol | 8 +++- .../ccip/generated/ccip_home/ccip_home.go | 28 ++++++++++++- ...rapper-dependency-versions-do-not-edit.txt | 2 +- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 8a3d59a418..2e9914afef 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -36,23 +36,23 @@ BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244050) BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24170) CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2052431) CCIPHomeSetup:test_getCapabilityConfiguration_Success() (gas: 9485) -CCIPHome_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83249) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354552) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466897) -CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433263) -CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8670) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305949) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46160) +CCIPHome_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83337) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354574) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 466963) +CCIPHome_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 433329) +CCIPHome_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8805) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 305971) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 46182) CCIPHome_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 24996) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362424) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 109973) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141534) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362141) -CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141601) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 362490) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 110039) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 141644) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 362207) +CCIPHome_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 141711) CCIPHome_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9652) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1696904) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 990175) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 990209) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1696814) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 990130) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 990164) CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9665) CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 15592) CCIPHome_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9573) @@ -63,14 +63,14 @@ CCIPHome_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() ( CCIPHome_chainConfig:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14921) CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9594) CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370990) -CCIPHome_constructor:test_constructor_Success() (gas: 2957125) -CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 60980) +CCIPHome_constructor:test_constructor_Success() (gas: 2988852) +CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61020) CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 19611) CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19418) CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9631) -CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1038558) -CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1921768) -CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1921802) +CCIPHome_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1038535) +CCIPHome_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 1921767) +CCIPHome_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 1921801) CCIPHome_validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 333177) CCIPHome_validateConfig:test__validateConfigSmallerFChain_Success() (gas: 464532) CCIPHome_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 288463) diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol index 26700fe3ce..76eae80515 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPHome.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -8,6 +8,7 @@ import {ICapabilitiesRegistry} from "../interfaces/ICapabilitiesRegistry.sol"; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {Internal} from "../libraries/Internal.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol"; import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; /// @notice CCIPHome stores the configuration for the CCIP capability. @@ -15,7 +16,7 @@ import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts /// Each chain will have a single configuration which includes information like the router address. /// Each CR DON will have up to four configurations: for each of (commit, exec), one blue and one green configuration. /// This is done in order to achieve "blue-green" deployments. -contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { +contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator, IERC165 { using EnumerableSet for EnumerableSet.UintSet; /// @notice Emitted when a chain's configuration is set. @@ -149,6 +150,11 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator { i_capabilitiesRegistry = capabilitiesRegistry; } + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { + return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; + } + // ================================================================ // │ Config Getters │ // ================================================================ diff --git a/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go b/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go index 8fa145729c..e108b7574d 100644 --- a/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go +++ b/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go @@ -64,8 +64,8 @@ type CCIPHomeOCR3Node struct { } var CCIPHomeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fChain\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FRoleDON\",\"type\":\"uint256\"}],\"name\":\"FChainTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPHome.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPHome.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node\",\"name\":\"node\",\"type\":\"tuple\"}],\"name\":\"InvalidNode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"expectedPluginType\",\"type\":\"uint8\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"gotPluginType\",\"type\":\"uint8\"}],\"name\":\"PluginTypeMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.OCR3ConfigWithMeta[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"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\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPHome.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPHome.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilityRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumChainConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPHome.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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: "0x60a06040523480156200001157600080fd5b5060405162003df038038062003df08339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051613bef620002016000396000818160d001528181610d960152610ffe0152613bef6000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638318ed5d11610081578063f2fde38b1161005b578063f2fde38b14610202578063f442c89a14610215578063fba64a7c1461022857600080fd5b80638318ed5d146101a35780638da5cb5b146101c4578063b74b2356146101e257600080fd5b80634bd0473f116100b25780634bd0473f1461016357806379ba5097146101835780637ac0d41e1461018d57600080fd5b8063020330e6146100ce578063181f5a771461011a575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101566040518060400160405280601281526020017f43434950486f6d6520312e362e302d646576000000000000000000000000000081525081565b6040516101119190612a6b565b610176610171366004612aaf565b61023b565b6040516101119190612bd3565b61018b610637565b005b610195610739565b604051908152602001610111565b6101566101b1366004612d45565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff166100f0565b6101f56101f0366004612d62565b61074a565b6040516101119190612df2565b61018b610210366004612e82565b6109cb565b61018b610223366004612f04565b6109df565b61018b610236366004612f88565b610d7e565b63ffffffff8216600090815260056020526040812060609183600181111561026557610265612ae4565b600181111561027657610276612ae4565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561062a57600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff1660018111156102e9576102e9612ae4565b60018111156102fa576102fa612ae4565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a010000000000000000000090910416606082015260018201805460809092019161035290613045565b80601f016020809104026020016040519081016040528092919081815260200182805461037e90613045565b80156103cb5780601f106103a0576101008083540402835291602001916103cb565b820191906000526020600020905b8154815290600101906020018083116103ae57829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b8282101561055957838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461043690613045565b80601f016020809104026020016040519081016040528092919081815260200182805461046290613045565b80156104af5780601f10610484576101008083540402835291602001916104af565b820191906000526020600020905b81548152906001019060200180831161049257829003601f168201915b505050505081526020016002820180546104c890613045565b80601f01602080910402602001604051908101604052809291908181526020018280546104f490613045565b80156105415780601f1061051657610100808354040283529160200191610541565b820191906000526020600020905b81548152906001019060200180831161052457829003601f168201915b505050505081525050815260200190600101906103f9565b50505050815260200160038201805461057190613045565b80601f016020809104026020016040519081016040528092919081815260200182805461059d90613045565b80156105ea5780601f106105bf576101008083540402835291602001916105ea565b820191906000526020600020905b8154815290600101906020018083116105cd57829003601f168201915b505050919092525050508152600482015467ffffffffffffffff1660208083019190915260059092015460409091015290825260019290920191016102a4565b5050505090505b92915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146106bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60006107456003610e31565b905090565b606060006107586003610e31565b9050600061076684866130c7565b90508315806107755750818110155b156107b55760408051600080825260208201909252906107ab565b610798612801565b8152602001906001900390816107905790505b5092505050610631565b60006107c1858361310d565b9050828111156107ce5750815b60006107da8383613120565b67ffffffffffffffff8111156107f2576107f26130de565b60405190808252806020026020018201604052801561082b57816020015b610818612801565b8152602001906001900390816108105790505b509050600061083a6003610e3b565b9050835b838110156109be57600082828151811061085a5761085a613133565b60209081029190910181015160408051808201825267ffffffffffffffff8316808252600090815260028552829020825181546080818802830181019095526060820181815295975092958601949093919284928491908401828280156108e057602002820191906000526020600020905b8154815260200190600101908083116108cc575b5050509183525050600182015460ff16602082015260028201805460409092019161090a90613045565b80601f016020809104026020016040519081016040528092919081815260200182805461093690613045565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b5050509190925250505090528461099a8885613120565b815181106109aa576109aa613133565b60209081029190910101525060010161083e565b5090979650505050505050565b6109d3610e4f565b6109dc81610ed2565b50565b6109e7610e4f565b60005b83811015610bcd57610a2e858583818110610a0757610a07613133565b9050602002016020810190610a1c9190613162565b60039067ffffffffffffffff16610fc7565b610a9857848482818110610a4457610a44613133565b9050602002016020810190610a599190613162565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016106b4565b60026000868684818110610aae57610aae613133565b9050602002016020810190610ac39190613162565b67ffffffffffffffff1681526020810191909152604001600090812090610aea8282612849565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610b22600283016000612867565b5050610b60858583818110610b3957610b39613133565b9050602002016020810190610b4e9190613162565b60039067ffffffffffffffff16610fdf565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610b9457610b94613133565b9050602002016020810190610ba99190613162565b60405167ffffffffffffffff909116815260200160405180910390a16001016109ea565b5060005b81811015610d77576000838383818110610bed57610bed613133565b9050602002810190610bff919061317d565b610c0d9060208101906131bb565b610c169061334d565b90506000848484818110610c2c57610c2c613133565b9050602002810190610c3e919061317d565b610c4c906020810190613162565b9050610c5b8260000151610feb565b816020015160ff16600003610c9c576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120835180518593610ccc9284929101906128a1565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610d199082613475565b50610d3391506003905067ffffffffffffffff8316611137565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051610d6592919061358f565b60405180910390a15050600101610bd1565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610ded576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610dfc8587018761383c565b8151919350915015610e1457610e1483600084611143565b805115610e2757610e2783600183611143565b5050505050505050565b6000610631825490565b60606000610e4883611991565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ed0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016106b4565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016106b4565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610e48565b6000610e4883836119ed565b60005b81518110156111335760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe84848151811061104a5761104a613133565b60200260200101516040518263ffffffff1660e01b815260040161107091815260200190565b600060405180830381865afa15801561108d573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526110d3919081019061390a565b608001510361112b578181815181106110ee576110ee613133565b60200260200101516040517f8907a4fa0000000000000000000000000000000000000000000000000000000081526004016106b491815260200190565b600101610fee565b5050565b6000610e488383611ae7565b8051600210156111845780516040517f3e4785260000000000000000000000000000000000000000000000000000000081526004016106b491815260200190565b63ffffffff83166000908152600560205260408120818460018111156111ac576111ac612ae4565b60018111156111bd576111bd612ae4565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561157157600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff16600181111561123057611230612ae4565b600181111561124157611241612ae4565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a010000000000000000000090910416606082015260018201805460809092019161129990613045565b80601f01602080910402602001604051908101604052809291908181526020018280546112c590613045565b80156113125780601f106112e757610100808354040283529160200191611312565b820191906000526020600020905b8154815290600101906020018083116112f557829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156114a057838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461137d90613045565b80601f01602080910402602001604051908101604052809291908181526020018280546113a990613045565b80156113f65780601f106113cb576101008083540402835291602001916113f6565b820191906000526020600020905b8154815290600101906020018083116113d957829003601f168201915b5050505050815260200160028201805461140f90613045565b80601f016020809104026020016040519081016040528092919081815260200182805461143b90613045565b80156114885780601f1061145d57610100808354040283529160200191611488565b820191906000526020600020905b81548152906001019060200180831161146b57829003601f168201915b50505050508152505081526020019060010190611340565b5050505081526020016003820180546114b890613045565b80601f01602080910402602001604051908101604052809291908181526020018280546114e490613045565b80156115315780601f1061150657610100808354040283529160200191611531565b820191906000526020600020905b81548152906001019060200180831161151457829003601f168201915b505050919092525050508152600482015467ffffffffffffffff1660208083019190915260059092015460409091015290825260019290920191016111eb565b5050505090506000611584858385611b36565b90506115908282611f42565b63ffffffff85166000908152600560205260408120908560018111156115b8576115b8612ae4565b60018111156115c9576115c9612ae4565b815260200190815260200160002060006115e391906128ec565b60005b815181101561193657600082828151811061160357611603613133565b602002602001015160000151905085600181111561162357611623612ae4565b8151600181111561163657611636612ae4565b146116945782828151811061164d5761164d613133565b6020026020010151604001518682600001516040517f4e9bea2d0000000000000000000000000000000000000000000000000000000081526004016106b4939291906139e2565b63ffffffff87166000908152600560205260408120818860018111156116bc576116bc612ae4565b60018111156116cd576116cd612ae4565b8152602001908152602001600020600181600181540180825580915050039060005260206000209060060201905083838151811061170d5761170d613133565b602002602001015160400151816005018190555083838151811061173357611733613133565b60209081029190910181015101516004820180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9092169190911790558151815482919082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183818111156117b9576117b9612ae4565b021790555060208301518154604085015160608601517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a01000000000000000000009290911691909102178155608083015160018201906118889082613475565b5060c0830151600382019061189d9082613475565b5060005b8360a001515181101561192757816002018460a0015182815181106118c8576118c8613133565b60209081029190910181015182546001818101855560009485529383902082516003909202019081559181015190928201906119049082613475565b50604082015160028201906119199082613475565b5050508060010190506118a1565b505050508060010190506115e6565b5083600181111561194957611949612ae4565b60ff168563ffffffff167f0fe4c45ffc7f05233ddfee7d79ac01d075176a0aa116068c486a2f7490088a0b836040516119829190612bd3565b60405180910390a35050505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156119e157602002820191906000526020600020905b8154815260200190600101908083116119cd575b50505050509050919050565b60008181526001830160205260408120548015611ad6576000611a11600183613120565b8554909150600090611a2590600190613120565b9050808214611a8a576000866000018281548110611a4557611a45613133565b9060005260206000200154905080876000018481548110611a6857611a68613133565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a9b57611a9b613a03565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610631565b6000915050610631565b5092915050565b6000818152600183016020526040812054611b2e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610631565b506000610631565b6060600083516002811115611b4d57611b4d612ae4565b9050600083516002811115611b6457611b64612ae4565b9050611b7082826122c1565b6000845167ffffffffffffffff811115611b8c57611b8c6130de565b604051908082528060200260200182016040528015611bb5578160200160208202803683370190505b5090506000836002811115611bcc57611bcc612ae4565b148015611bea57506001826002811115611be857611be8612ae4565b145b15611c2b57600181600081518110611c0457611c04613133565b602002602001019067ffffffffffffffff16908167ffffffffffffffff1681525050611d93565b6001836002811115611c3f57611c3f612ae4565b148015611c5d57506002826002811115611c5b57611c5b612ae4565b145b15611cf45785600081518110611c7557611c75613133565b60200260200101516020015181600081518110611c9457611c94613133565b602002602001019067ffffffffffffffff16908167ffffffffffffffff168152505085600081518110611cc957611cc9613133565b6020026020010151602001516001611ce19190613a32565b81600181518110611c0457611c04613133565b6002836002811115611d0857611d08612ae4565b148015611d2657506001826002811115611d2457611d24612ae4565b145b15611d5d5785600181518110611d3e57611d3e613133565b60200260200101516020015181600081518110611c0457611c04613133565b82826040517f0a6b675b0000000000000000000000000000000000000000000000000000000081526004016106b4929190613a63565b6000855167ffffffffffffffff811115611daf57611daf6130de565b604051908082528060200260200182016040528015611e4d57816020015b6040805161014081018252600060608083018281526080840183905260a0840183905260c0840183905260e084018290526101008401829052610120840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181611dcd5790505b50905060005b8251811015611f3657611e7e878281518110611e7157611e71613133565b6020026020010151612347565b6040518060600160405280888381518110611e9b57611e9b613133565b60200260200101518152602001848381518110611eba57611eba613133565b602002602001015167ffffffffffffffff168152602001611f0e8b868581518110611ee757611ee7613133565b60200260200101518b8681518110611f0157611f01613133565b6020026020010151612741565b815250828281518110611f2357611f23613133565b6020908102919091010152600101611e53565b50979650505050505050565b8151815181158015611f545750806001145b15611ff65782600081518110611f6c57611f6c613133565b60200260200101516020015167ffffffffffffffff16600114611ff05782600081518110611f9c57611f9c613133565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152600160248201526044016106b4565b50505050565b8160011480156120065750806002145b156121bc578360008151811061201e5761201e613133565b6020026020010151604001518360008151811061203d5761203d613133565b602002602001015160400151146120c9578260008151811061206157612061613133565b6020026020010151604001518460008151811061208057612080613133565b6020026020010151604001516040517fc7ccdd7f0000000000000000000000000000000000000000000000000000000081526004016106b4929190918252602082015260400190565b836000815181106120dc576120dc613133565b60200260200101516020015160016120f49190613a32565b67ffffffffffffffff168360018151811061211157612111613133565b60200260200101516020015167ffffffffffffffff1614611ff0578260018151811061213f5761213f613133565b6020026020010151602001518460008151811061215e5761215e613133565b60200260200101516020015160016121769190613a32565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9283166004820152911660248201526044016106b4565b8160021480156121cc5750806001145b1561228f57836001815181106121e4576121e4613133565b6020026020010151604001518360008151811061220357612203613133565b60200260200101516040015114611ff0578260008151811061222757612227613133565b6020026020010151604001518460018151811061224657612246613133565b6020026020010151604001516040517f9e9756700000000000000000000000000000000000000000000000000000000081526004016106b4929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260028111156122d5576122d5612ae4565b8260028111156122e7576122e7612ae4565b6122f19190613a7e565b9050806001148061233d5750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14801561233d5750600283600281111561233b5761233b612ae4565b145b15611d5d57505050565b806020015167ffffffffffffffff1660000361238f576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815160018111156123a4576123a4612ae4565b141580156123c557506001815160018111156123c2576123c2612ae4565b14155b156123fc576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151511580612439575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b15612470576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602081015161248b9060039067ffffffffffffffff16610fc7565b6124d35760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016106b4565b60408082015160208084015167ffffffffffffffff1660009081526002909152919091206001015460ff918216911681811115612546576040517f2db2204000000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016106b4565b60a083015151610100811115612588576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6125938360036130c7565b81116125cb576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808267ffffffffffffffff8111156125e7576125e76130de565b604051908082528060200260200182016040528015612610578160200160208202803683370190505b50905060005b838110156126d05760008760a00151828151811061263657612636613133565b6020026020010151905080604001515160001461265b578361265781613a9e565b9450505b602081015151158061266c57508051155b156126a557806040517f9fa403140000000000000000000000000000000000000000000000000000000081526004016106b49190613ad6565b80600001518383815181106126bc576126bc613133565b602090810291909101015250600101612616565b5060006126de8560036130c7565b6126e990600161310d565b90508083101561272f576040517f548dd21f00000000000000000000000000000000000000000000000000000000815260048101849052602481018290526044016106b4565b61273882610feb565b50505050505050565b60008082602001518584600001518560800151878760a00151886040015189606001518a60c0015160405160200161278199989796959493929190613ae9565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a0000000000000000000000000000000000000000000000000000000000001795945050505050565b6040518060400160405280600067ffffffffffffffff168152602001612844604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b50805460008255906000526020600020908101906109dc919061290d565b50805461287390613045565b6000825580601f10612883575050565b601f0160209004906000526020600020908101906109dc919061290d565b8280548282559060005260206000209081019282156128dc579160200282015b828111156128dc5782518255916020019190600101906128c1565b506128e892915061290d565b5090565b50805460008255600602906000526020600020908101906109dc9190612922565b5b808211156128e8576000815560010161290e565b808211156128e85780547fffffffffffffffffffffffffffff000000000000000000000000000000000000168155600081816129616001830182612867565b61296f6002830160006129b9565b61297d600383016000612867565b5050506004810180547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016905560006005820155600601612922565b50805460008255600302906000526020600020908101906109dc91905b808211156128e85760008082556129f06001830182612867565b6129fe600283016000612867565b506003016129d6565b6000815180845260005b81811015612a2d57602081850181015186830182015201612a11565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610e486020830184612a07565b63ffffffff811681146109dc57600080fd5b8035612a9b81612a7e565b919050565b803560028110612a9b57600080fd5b60008060408385031215612ac257600080fd5b8235612acd81612a7e565b9150612adb60208401612aa0565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110612b2357612b23612ae4565b9052565b805182526000602082015160606020850152612b466060850182612a07565b905060408301518482036040860152612b5f8282612a07565b95945050505050565b60008282518085526020808601955060208260051b8401016020860160005b848110156109be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612bc1838351612b27565b98840198925090830190600101612b87565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015612d37577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160608151818652612c418287018251612b13565b89810151608067ffffffffffffffff8216818901528a830151915060a060ff8316818a015284840151945060c09250612c85838a018667ffffffffffffffff169052565b81840151945060e0915081828a0152612ca26101408a0186612a07565b9450808401519150507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa080898603016101008a0152612ce18583612b68565b9290930151888303909301610120890152509150612cff8282612a07565b91505088820151612d1b8a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101612bfc565b509098975050505050505050565b600060208284031215612d5757600080fd5b8135610e4881612a7e565b60008060408385031215612d7557600080fd5b50508035926020909101359150565b805160608084528151908401819052600091602091908201906080860190845b81811015612dc057835183529284019291840191600101612da4565b505060ff6020860151166020870152604085015192508581036040870152612de88184612a07565b9695505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015612d37578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff168452870151878401879052612e6f87850182612d84565b9588019593505090860190600101612e1b565b600060208284031215612e9457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610e4857600080fd5b60008083601f840112612eca57600080fd5b50813567ffffffffffffffff811115612ee257600080fd5b6020830191508360208260051b8501011115612efd57600080fd5b9250929050565b60008060008060408587031215612f1a57600080fd5b843567ffffffffffffffff80821115612f3257600080fd5b612f3e88838901612eb8565b90965094506020870135915080821115612f5757600080fd5b50612f6487828801612eb8565b95989497509550505050565b803567ffffffffffffffff81168114612a9b57600080fd5b60008060008060008060808789031215612fa157600080fd5b863567ffffffffffffffff80821115612fb957600080fd5b612fc58a838b01612eb8565b90985096506020890135915080821115612fde57600080fd5b818901915089601f830112612ff257600080fd5b81358181111561300157600080fd5b8a602082850101111561301357600080fd5b60208301965080955050505061302b60408801612f70565b915061303960608801612a90565b90509295509295509295565b600181811c9082168061305957607f821691505b602082108103613092577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761063157610631613098565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8082018082111561063157610631613098565b8181038181111561063157610631613098565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561317457600080fd5b610e4882612f70565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126131b157600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126131b157600080fd5b6040516060810167ffffffffffffffff81118282101715613212576132126130de565b60405290565b60405160e0810167ffffffffffffffff81118282101715613212576132126130de565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613282576132826130de565b604052919050565b600067ffffffffffffffff8211156132a4576132a46130de565b5060051b60200190565b803560ff81168114612a9b57600080fd5b600082601f8301126132d057600080fd5b813567ffffffffffffffff8111156132ea576132ea6130de565b61331b60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161323b565b81815284602083860101111561333057600080fd5b816020850160208301376000918101602001919091529392505050565b60006060823603121561335f57600080fd5b6133676131ef565b823567ffffffffffffffff8082111561337f57600080fd5b9084019036601f83011261339257600080fd5b813560206133a76133a28361328a565b61323b565b82815260059290921b840181019181810190368411156133c657600080fd5b948201945b838610156133e4578535825294820194908201906133cb565b8652506133f28782016132ae565b9085015250604085013591508082111561340b57600080fd5b50613418368286016132bf565b60408301525092915050565b601f821115613470576000816000526020600020601f850160051c8101602086101561344d5750805b601f850160051c820191505b8181101561346c57828155600101613459565b5050505b505050565b815167ffffffffffffffff81111561348f5761348f6130de565b6134a38161349d8454613045565b84613424565b602080601f8311600181146134f657600084156134c05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561346c565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561354357888601518255948401946001909101908401613524565b508582101561357f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff831681526040602082015260006135b26040830184612d84565b949350505050565b600082601f8301126135cb57600080fd5b813560206135db6133a28361328a565b82815260059290921b840181019181810190868411156135fa57600080fd5b8286015b848110156136c257803567ffffffffffffffff8082111561361f5760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156136585760008081fd5b6136606131ef565b8784013581526040808501358481111561367a5760008081fd5b6136888e8b838901016132bf565b838b0152509184013591838311156136a05760008081fd5b6136ae8d8a858801016132bf565b9082015286525050509183019183016135fe565b509695505050505050565b600082601f8301126136de57600080fd5b813560206136ee6133a28361328a565b82815260059290921b8401810191818101908684111561370d57600080fd5b8286015b848110156136c257803567ffffffffffffffff808211156137325760008081fd5b818901915060e0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d0301121561376b5760008081fd5b613773613218565b61377e888501612aa0565b8152604061378d818601612f70565b89830152606061379e8187016132ae565b82840152608091506137b1828701612f70565b9083015260a085810135858111156137c95760008081fd5b6137d78f8c838a01016132bf565b838501525060c0915081860135858111156137f25760008081fd5b6138008f8c838a01016135ba565b8285015250508285013592508383111561381a5760008081fd5b6138288d8a858801016132bf565b908201528652505050918301918301613711565b6000806040838503121561384f57600080fd5b823567ffffffffffffffff8082111561386757600080fd5b613873868387016136cd565b9350602085013591508082111561388957600080fd5b50613896858286016136cd565b9150509250929050565b8051612a9b81612a7e565b600082601f8301126138bc57600080fd5b815160206138cc6133a28361328a565b8083825260208201915060208460051b8701019350868411156138ee57600080fd5b602086015b848110156136c257805183529183019183016138f3565b60006020828403121561391c57600080fd5b815167ffffffffffffffff8082111561393457600080fd5b9083019060e0828603121561394857600080fd5b613950613218565b613959836138a0565b8152613967602084016138a0565b6020820152613978604084016138a0565b6040820152606083015160608201526080830151608082015260a0830151828111156139a357600080fd5b6139af878286016138ab565b60a08301525060c0830151828111156139c757600080fd5b6139d3878286016138ab565b60c08301525095945050505050565b838152606081016139f66020830185612b13565b6135b26040830184612b13565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b67ffffffffffffffff818116838216019080821115611ae057611ae0613098565b60038110612b2357612b23612ae4565b60408101613a718285613a53565b610e486020830184613a53565b8181036000831280158383131683831282161715611ae057611ae0613098565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613acf57613acf613098565b5060010190565b602081526000610e486020830184612b27565b600061012067ffffffffffffffff808d168452602063ffffffff8d1681860152613b16604086018d612b13565b826060860152613b288386018c612a07565b918a16608086015284820360a0860152885180835291925080830191600581901b84018201828b0160005b83811015613b9f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0878403018652613b8d838351612b27565b95850195925090840190600101613b53565b505060ff8a1660c088015267ffffffffffffffff891660e0880152868103610100880152613bcd8189612a07565b955050505050509a995050505050505050505056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fChain\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FRoleDON\",\"type\":\"uint256\"}],\"name\":\"FChainTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPHome.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPHome.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node\",\"name\":\"node\",\"type\":\"tuple\"}],\"name\":\"InvalidNode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"expectedPluginType\",\"type\":\"uint8\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"gotPluginType\",\"type\":\"uint8\"}],\"name\":\"PluginTypeMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.OCR3ConfigWithMeta[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"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\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPHome.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPHome.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilityRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumChainConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"FRoleDON\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signerKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"transmitterKey\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Node[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPHome.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPHome.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162003ef938038062003ef98339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051613cf7620002026000396000818161010301528181610e5c01526110c40152613cf76000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638318ed5d11610081578063f2fde38b1161005b578063f2fde38b14610230578063f442c89a14610243578063fba64a7c1461025657600080fd5b80638318ed5d146101d15780638da5cb5b146101f2578063b74b23561461021057600080fd5b80634bd0473f116100b25780634bd0473f1461019157806379ba5097146101b15780637ac0d41e146101bb57600080fd5b806301ffc9a7146100d9578063020330e614610101578063181f5a7714610148575b600080fd5b6100ec6100e7366004612acd565b610269565b60405190151581526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f8565b6101846040518060400160405280601281526020017f43434950486f6d6520312e362e302d646576000000000000000000000000000081525081565b6040516100f89190612b73565b6101a461019f366004612bb7565b610302565b6040516100f89190612cdb565b6101b96106fd565b005b6101c36107ff565b6040519081526020016100f8565b6101846101df366004612e4d565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff16610123565b61022361021e366004612e6a565b610810565b6040516100f89190612efa565b6101b961023e366004612f8a565b610a91565b6101b961025136600461300c565b610aa5565b6101b9610264366004613090565b610e44565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f78bea7210000000000000000000000000000000000000000000000000000000014806102fc57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b63ffffffff8216600090815260056020526040812060609183600181111561032c5761032c612bec565b600181111561033d5761033d612bec565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156106f157600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff1660018111156103b0576103b0612bec565b60018111156103c1576103c1612bec565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a01000000000000000000009091041660608201526001820180546080909201916104199061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546104459061314d565b80156104925780601f1061046757610100808354040283529160200191610492565b820191906000526020600020905b81548152906001019060200180831161047557829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156106205783829060005260206000209060030201604051806060016040529081600082015481526020016001820180546104fd9061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546105299061314d565b80156105765780601f1061054b57610100808354040283529160200191610576565b820191906000526020600020905b81548152906001019060200180831161055957829003601f168201915b5050505050815260200160028201805461058f9061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546105bb9061314d565b80156106085780601f106105dd57610100808354040283529160200191610608565b820191906000526020600020905b8154815290600101906020018083116105eb57829003601f168201915b505050505081525050815260200190600101906104c0565b5050505081526020016003820180546106389061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546106649061314d565b80156106b15780601f10610686576101008083540402835291602001916106b1565b820191906000526020600020905b81548152906001019060200180831161069457829003601f168201915b505050919092525050508152600482015467ffffffffffffffff16602080830191909152600590920154604090910152908252600192909201910161036b565b50505050905092915050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600061080b6003610ef7565b905090565b6060600061081e6003610ef7565b9050600061082c84866131cf565b905083158061083b5750818110155b1561087b576040805160008082526020820190925290610871565b61085e6128c7565b8152602001906001900390816108565790505b50925050506102fc565b60006108878583613215565b9050828111156108945750815b60006108a08383613228565b67ffffffffffffffff8111156108b8576108b86131e6565b6040519080825280602002602001820160405280156108f157816020015b6108de6128c7565b8152602001906001900390816108d65790505b50905060006109006003610f01565b9050835b83811015610a845760008282815181106109205761092061323b565b60209081029190910181015160408051808201825267ffffffffffffffff8316808252600090815260028552829020825181546080818802830181019095526060820181815295975092958601949093919284928491908401828280156109a657602002820191906000526020600020905b815481526020019060010190808311610992575b5050509183525050600182015460ff1660208201526002820180546040909201916109d09061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546109fc9061314d565b8015610a495780601f10610a1e57610100808354040283529160200191610a49565b820191906000526020600020905b815481529060010190602001808311610a2c57829003601f168201915b50505091909252505050905284610a608885613228565b81518110610a7057610a7061323b565b602090810291909101015250600101610904565b5090979650505050505050565b610a99610f15565b610aa281610f98565b50565b610aad610f15565b60005b83811015610c9357610af4858583818110610acd57610acd61323b565b9050602002016020810190610ae2919061326a565b60039067ffffffffffffffff1661108d565b610b5e57848482818110610b0a57610b0a61323b565b9050602002016020810190610b1f919061326a565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161077a565b60026000868684818110610b7457610b7461323b565b9050602002016020810190610b89919061326a565b67ffffffffffffffff1681526020810191909152604001600090812090610bb0828261290f565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610be860028301600061292d565b5050610c26858583818110610bff57610bff61323b565b9050602002016020810190610c14919061326a565b60039067ffffffffffffffff166110a5565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610c5a57610c5a61323b565b9050602002016020810190610c6f919061326a565b60405167ffffffffffffffff909116815260200160405180910390a1600101610ab0565b5060005b81811015610e3d576000838383818110610cb357610cb361323b565b9050602002810190610cc59190613285565b610cd39060208101906132c3565b610cdc90613455565b90506000848484818110610cf257610cf261323b565b9050602002810190610d049190613285565b610d1290602081019061326a565b9050610d2182600001516110b1565b816020015160ff16600003610d62576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120835180518593610d92928492910190612967565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610ddf908261357d565b50610df991506003905067ffffffffffffffff83166111fd565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051610e2b929190613697565b60405180910390a15050600101610c97565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610eb3576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610ec285870187613944565b8151919350915015610eda57610eda83600084611209565b805115610eed57610eed83600183611209565b5050505050505050565b60006102fc825490565b60606000610f0e83611a57565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161077a565b565b3373ffffffffffffffffffffffffffffffffffffffff821603611017576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161077a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610f0e565b6000610f0e8383611ab3565b60005b81518110156111f95760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe8484815181106111105761111061323b565b60200260200101516040518263ffffffff1660e01b815260040161113691815260200190565b600060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526111999190810190613a12565b60800151036111f1578181815181106111b4576111b461323b565b60200260200101516040517f8907a4fa00000000000000000000000000000000000000000000000000000000815260040161077a91815260200190565b6001016110b4565b5050565b6000610f0e8383611bad565b80516002101561124a5780516040517f3e47852600000000000000000000000000000000000000000000000000000000815260040161077a91815260200190565b63ffffffff831660009081526005602052604081208184600181111561127257611272612bec565b600181111561128357611283612bec565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561163757600084815260209020604080516101408101909152600684029091018054829060608201908390829060ff1660018111156112f6576112f6612bec565b600181111561130757611307612bec565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a010000000000000000000090910416606082015260018201805460809092019161135f9061314d565b80601f016020809104026020016040519081016040528092919081815260200182805461138b9061314d565b80156113d85780601f106113ad576101008083540402835291602001916113d8565b820191906000526020600020905b8154815290600101906020018083116113bb57829003601f168201915b5050505050815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156115665783829060005260206000209060030201604051806060016040529081600082015481526020016001820180546114439061314d565b80601f016020809104026020016040519081016040528092919081815260200182805461146f9061314d565b80156114bc5780601f10611491576101008083540402835291602001916114bc565b820191906000526020600020905b81548152906001019060200180831161149f57829003601f168201915b505050505081526020016002820180546114d59061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546115019061314d565b801561154e5780601f106115235761010080835404028352916020019161154e565b820191906000526020600020905b81548152906001019060200180831161153157829003601f168201915b50505050508152505081526020019060010190611406565b50505050815260200160038201805461157e9061314d565b80601f01602080910402602001604051908101604052809291908181526020018280546115aa9061314d565b80156115f75780601f106115cc576101008083540402835291602001916115f7565b820191906000526020600020905b8154815290600101906020018083116115da57829003601f168201915b505050919092525050508152600482015467ffffffffffffffff1660208083019190915260059092015460409091015290825260019290920191016112b1565b505050509050600061164a858385611bfc565b90506116568282612008565b63ffffffff851660009081526005602052604081209085600181111561167e5761167e612bec565b600181111561168f5761168f612bec565b815260200190815260200160002060006116a991906129b2565b60005b81518110156119fc5760008282815181106116c9576116c961323b565b60200260200101516000015190508560018111156116e9576116e9612bec565b815160018111156116fc576116fc612bec565b1461175a578282815181106117135761171361323b565b6020026020010151604001518682600001516040517f4e9bea2d00000000000000000000000000000000000000000000000000000000815260040161077a93929190613aea565b63ffffffff871660009081526005602052604081208188600181111561178257611782612bec565b600181111561179357611793612bec565b815260200190815260200160002060018160018154018082558091505003906000526020600020906006020190508383815181106117d3576117d361323b565b60200260200101516040015181600501819055508383815181106117f9576117f961323b565b60209081029190910181015101516004820180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9092169190911790558151815482919082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001838181111561187f5761187f612bec565b021790555060208301518154604085015160608601517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a010000000000000000000092909116919091021781556080830151600182019061194e908261357d565b5060c08301516003820190611963908261357d565b5060005b8360a00151518110156119ed57816002018460a00151828151811061198e5761198e61323b565b60209081029190910181015182546001818101855560009485529383902082516003909202019081559181015190928201906119ca908261357d565b50604082015160028201906119df908261357d565b505050806001019050611967565b505050508060010190506116ac565b50836001811115611a0f57611a0f612bec565b60ff168563ffffffff167f0fe4c45ffc7f05233ddfee7d79ac01d075176a0aa116068c486a2f7490088a0b83604051611a489190612cdb565b60405180910390a35050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611aa757602002820191906000526020600020905b815481526020019060010190808311611a93575b50505050509050919050565b60008181526001830160205260408120548015611b9c576000611ad7600183613228565b8554909150600090611aeb90600190613228565b9050808214611b50576000866000018281548110611b0b57611b0b61323b565b9060005260206000200154905080876000018481548110611b2e57611b2e61323b565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611b6157611b61613b0b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102fc565b60009150506102fc565b5092915050565b6000818152600183016020526040812054611bf4575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102fc565b5060006102fc565b6060600083516002811115611c1357611c13612bec565b9050600083516002811115611c2a57611c2a612bec565b9050611c368282612387565b6000845167ffffffffffffffff811115611c5257611c526131e6565b604051908082528060200260200182016040528015611c7b578160200160208202803683370190505b5090506000836002811115611c9257611c92612bec565b148015611cb057506001826002811115611cae57611cae612bec565b145b15611cf157600181600081518110611cca57611cca61323b565b602002602001019067ffffffffffffffff16908167ffffffffffffffff1681525050611e59565b6001836002811115611d0557611d05612bec565b148015611d2357506002826002811115611d2157611d21612bec565b145b15611dba5785600081518110611d3b57611d3b61323b565b60200260200101516020015181600081518110611d5a57611d5a61323b565b602002602001019067ffffffffffffffff16908167ffffffffffffffff168152505085600081518110611d8f57611d8f61323b565b6020026020010151602001516001611da79190613b3a565b81600181518110611cca57611cca61323b565b6002836002811115611dce57611dce612bec565b148015611dec57506001826002811115611dea57611dea612bec565b145b15611e235785600181518110611e0457611e0461323b565b60200260200101516020015181600081518110611cca57611cca61323b565b82826040517f0a6b675b00000000000000000000000000000000000000000000000000000000815260040161077a929190613b6b565b6000855167ffffffffffffffff811115611e7557611e756131e6565b604051908082528060200260200182016040528015611f1357816020015b6040805161014081018252600060608083018281526080840183905260a0840183905260c0840183905260e084018290526101008401829052610120840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181611e935790505b50905060005b8251811015611ffc57611f44878281518110611f3757611f3761323b565b602002602001015161240d565b6040518060600160405280888381518110611f6157611f6161323b565b60200260200101518152602001848381518110611f8057611f8061323b565b602002602001015167ffffffffffffffff168152602001611fd48b868581518110611fad57611fad61323b565b60200260200101518b8681518110611fc757611fc761323b565b6020026020010151612807565b815250828281518110611fe957611fe961323b565b6020908102919091010152600101611f19565b50979650505050505050565b815181518115801561201a5750806001145b156120bc57826000815181106120325761203261323b565b60200260200101516020015167ffffffffffffffff166001146120b657826000815181106120625761206261323b565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001602482015260440161077a565b50505050565b8160011480156120cc5750806002145b1561228257836000815181106120e4576120e461323b565b602002602001015160400151836000815181106121035761210361323b565b6020026020010151604001511461218f57826000815181106121275761212761323b565b602002602001015160400151846000815181106121465761214661323b565b6020026020010151604001516040517fc7ccdd7f00000000000000000000000000000000000000000000000000000000815260040161077a929190918252602082015260400190565b836000815181106121a2576121a261323b565b60200260200101516020015160016121ba9190613b3a565b67ffffffffffffffff16836001815181106121d7576121d761323b565b60200260200101516020015167ffffffffffffffff16146120b657826001815181106122055761220561323b565b602002602001015160200151846000815181106122245761222461323b565b602002602001015160200151600161223c9190613b3a565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff92831660048201529116602482015260440161077a565b8160021480156122925750806001145b1561235557836001815181106122aa576122aa61323b565b602002602001015160400151836000815181106122c9576122c961323b565b602002602001015160400151146120b657826000815181106122ed576122ed61323b565b6020026020010151604001518460018151811061230c5761230c61323b565b6020026020010151604001516040517f9e97567000000000000000000000000000000000000000000000000000000000815260040161077a929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082600281111561239b5761239b612bec565b8260028111156123ad576123ad612bec565b6123b79190613b86565b905080600114806124035750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1480156124035750600283600281111561240157612401612bec565b145b15611e2357505050565b806020015167ffffffffffffffff16600003612455576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008151600181111561246a5761246a612bec565b1415801561248b575060018151600181111561248857612488612bec565b14155b156124c2576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101515115806124ff575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b15612536576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516125519060039067ffffffffffffffff1661108d565b6125995760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161077a565b60408082015160208084015167ffffffffffffffff1660009081526002909152919091206001015460ff91821691168181111561260c576040517f2db22040000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161077a565b60a08301515161010081111561264e576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6126598360036131cf565b8111612691576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808267ffffffffffffffff8111156126ad576126ad6131e6565b6040519080825280602002602001820160405280156126d6578160200160208202803683370190505b50905060005b838110156127965760008760a0015182815181106126fc576126fc61323b565b60200260200101519050806040015151600014612721578361271d81613ba6565b9450505b602081015151158061273257508051155b1561276b57806040517f9fa4031400000000000000000000000000000000000000000000000000000000815260040161077a9190613bde565b80600001518383815181106127825761278261323b565b6020908102919091010152506001016126dc565b5060006127a48560036131cf565b6127af906001613215565b9050808310156127f5576040517f548dd21f000000000000000000000000000000000000000000000000000000008152600481018490526024810182905260440161077a565b6127fe826110b1565b50505050505050565b60008082602001518584600001518560800151878760a00151886040015189606001518a60c0015160405160200161284799989796959493929190613bf1565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a0000000000000000000000000000000000000000000000000000000000001795945050505050565b6040518060400160405280600067ffffffffffffffff16815260200161290a604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b5080546000825590600052602060002090810190610aa291906129d3565b5080546129399061314d565b6000825580601f10612949575050565b601f016020900490600052602060002090810190610aa291906129d3565b8280548282559060005260206000209081019282156129a2579160200282015b828111156129a2578251825591602001919060010190612987565b506129ae9291506129d3565b5090565b5080546000825560060290600052602060002090810190610aa291906129e8565b5b808211156129ae57600081556001016129d4565b808211156129ae5780547fffffffffffffffffffffffffffff00000000000000000000000000000000000016815560008181612a27600183018261292d565b612a35600283016000612a7f565b612a4360038301600061292d565b5050506004810180547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000169055600060058201556006016129e8565b5080546000825560030290600052602060002090810190610aa291905b808211156129ae576000808255612ab6600183018261292d565b612ac460028301600061292d565b50600301612a9c565b600060208284031215612adf57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f0e57600080fd5b6000815180845260005b81811015612b3557602081850181015186830182015201612b19565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610f0e6020830184612b0f565b63ffffffff81168114610aa257600080fd5b8035612ba381612b86565b919050565b803560028110612ba357600080fd5b60008060408385031215612bca57600080fd5b8235612bd581612b86565b9150612be360208401612ba8565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110612c2b57612c2b612bec565b9052565b805182526000602082015160606020850152612c4e6060850182612b0f565b905060408301518482036040860152612c678282612b0f565b95945050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015610a84577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612cc9838351612c2f565b98840198925090830190600101612c8f565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015612e3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160608151818652612d498287018251612c1b565b89810151608067ffffffffffffffff8216818901528a830151915060a060ff8316818a015284840151945060c09250612d8d838a018667ffffffffffffffff169052565b81840151945060e0915081828a0152612daa6101408a0186612b0f565b9450808401519150507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa080898603016101008a0152612de98583612c70565b9290930151888303909301610120890152509150612e078282612b0f565b91505088820151612e238a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101612d04565b509098975050505050505050565b600060208284031215612e5f57600080fd5b8135610f0e81612b86565b60008060408385031215612e7d57600080fd5b50508035926020909101359150565b805160608084528151908401819052600091602091908201906080860190845b81811015612ec857835183529284019291840191600101612eac565b505060ff6020860151166020870152604085015192508581036040870152612ef08184612b0f565b9695505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015612e3f578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff168452870151878401879052612f7787850182612e8c565b9588019593505090860190600101612f23565b600060208284031215612f9c57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610f0e57600080fd5b60008083601f840112612fd257600080fd5b50813567ffffffffffffffff811115612fea57600080fd5b6020830191508360208260051b850101111561300557600080fd5b9250929050565b6000806000806040858703121561302257600080fd5b843567ffffffffffffffff8082111561303a57600080fd5b61304688838901612fc0565b9096509450602087013591508082111561305f57600080fd5b5061306c87828801612fc0565b95989497509550505050565b803567ffffffffffffffff81168114612ba357600080fd5b600080600080600080608087890312156130a957600080fd5b863567ffffffffffffffff808211156130c157600080fd5b6130cd8a838b01612fc0565b909850965060208901359150808211156130e657600080fd5b818901915089601f8301126130fa57600080fd5b81358181111561310957600080fd5b8a602082850101111561311b57600080fd5b60208301965080955050505061313360408801613078565b915061314160608801612b98565b90509295509295509295565b600181811c9082168061316157607f821691505b60208210810361319a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176102fc576102fc6131a0565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b808201808211156102fc576102fc6131a0565b818103818111156102fc576102fc6131a0565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561327c57600080fd5b610f0e82613078565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126132b957600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126132b957600080fd5b6040516060810167ffffffffffffffff8111828210171561331a5761331a6131e6565b60405290565b60405160e0810167ffffffffffffffff8111828210171561331a5761331a6131e6565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561338a5761338a6131e6565b604052919050565b600067ffffffffffffffff8211156133ac576133ac6131e6565b5060051b60200190565b803560ff81168114612ba357600080fd5b600082601f8301126133d857600080fd5b813567ffffffffffffffff8111156133f2576133f26131e6565b61342360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613343565b81815284602083860101111561343857600080fd5b816020850160208301376000918101602001919091529392505050565b60006060823603121561346757600080fd5b61346f6132f7565b823567ffffffffffffffff8082111561348757600080fd5b9084019036601f83011261349a57600080fd5b813560206134af6134aa83613392565b613343565b82815260059290921b840181019181810190368411156134ce57600080fd5b948201945b838610156134ec578535825294820194908201906134d3565b8652506134fa8782016133b6565b9085015250604085013591508082111561351357600080fd5b50613520368286016133c7565b60408301525092915050565b601f821115613578576000816000526020600020601f850160051c810160208610156135555750805b601f850160051c820191505b8181101561357457828155600101613561565b5050505b505050565b815167ffffffffffffffff811115613597576135976131e6565b6135ab816135a5845461314d565b8461352c565b602080601f8311600181146135fe57600084156135c85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613574565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561364b5788860151825594840194600190910190840161362c565b508582101561368757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff831681526040602082015260006136ba6040830184612e8c565b949350505050565b600082601f8301126136d357600080fd5b813560206136e36134aa83613392565b82815260059290921b8401810191818101908684111561370257600080fd5b8286015b848110156137ca57803567ffffffffffffffff808211156137275760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156137605760008081fd5b6137686132f7565b878401358152604080850135848111156137825760008081fd5b6137908e8b838901016133c7565b838b0152509184013591838311156137a85760008081fd5b6137b68d8a858801016133c7565b908201528652505050918301918301613706565b509695505050505050565b600082601f8301126137e657600080fd5b813560206137f66134aa83613392565b82815260059290921b8401810191818101908684111561381557600080fd5b8286015b848110156137ca57803567ffffffffffffffff8082111561383a5760008081fd5b818901915060e0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156138735760008081fd5b61387b613320565b613886888501612ba8565b81526040613895818601613078565b8983015260606138a68187016133b6565b82840152608091506138b9828701613078565b9083015260a085810135858111156138d15760008081fd5b6138df8f8c838a01016133c7565b838501525060c0915081860135858111156138fa5760008081fd5b6139088f8c838a01016136c2565b828501525050828501359250838311156139225760008081fd5b6139308d8a858801016133c7565b908201528652505050918301918301613819565b6000806040838503121561395757600080fd5b823567ffffffffffffffff8082111561396f57600080fd5b61397b868387016137d5565b9350602085013591508082111561399157600080fd5b5061399e858286016137d5565b9150509250929050565b8051612ba381612b86565b600082601f8301126139c457600080fd5b815160206139d46134aa83613392565b8083825260208201915060208460051b8701019350868411156139f657600080fd5b602086015b848110156137ca57805183529183019183016139fb565b600060208284031215613a2457600080fd5b815167ffffffffffffffff80821115613a3c57600080fd5b9083019060e08286031215613a5057600080fd5b613a58613320565b613a61836139a8565b8152613a6f602084016139a8565b6020820152613a80604084016139a8565b6040820152606083015160608201526080830151608082015260a083015182811115613aab57600080fd5b613ab7878286016139b3565b60a08301525060c083015182811115613acf57600080fd5b613adb878286016139b3565b60c08301525095945050505050565b83815260608101613afe6020830185612c1b565b6136ba6040830184612c1b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b67ffffffffffffffff818116838216019080821115611ba657611ba66131a0565b60038110612c2b57612c2b612bec565b60408101613b798285613b5b565b610f0e6020830184613b5b565b8181036000831280158383131683831282161715611ba657611ba66131a0565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613bd757613bd76131a0565b5060010190565b602081526000610f0e6020830184612c2f565b600061012067ffffffffffffffff808d168452602063ffffffff8d1681860152613c1e604086018d612c1b565b826060860152613c308386018c612b0f565b918a16608086015284820360a0860152885180835291925080830191600581901b84018201828b0160005b83811015613ca7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0878403018652613c95838351612c2f565b95850195925090840190600101613c5b565b505060ff8a1660c088015267ffffffffffffffff891660e0880152868103610100880152613cd58189612b0f565b955050505050509a995050505050505050505056fea164736f6c6343000818000a", } var CCIPHomeABI = CCIPHomeMetaData.ABI @@ -336,6 +336,28 @@ func (_CCIPHome *CCIPHomeCallerSession) Owner() (common.Address, error) { return _CCIPHome.Contract.Owner(&_CCIPHome.CallOpts) } +func (_CCIPHome *CCIPHomeCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _CCIPHome.Contract.SupportsInterface(&_CCIPHome.CallOpts, interfaceId) +} + +func (_CCIPHome *CCIPHomeCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _CCIPHome.Contract.SupportsInterface(&_CCIPHome.CallOpts, interfaceId) +} + func (_CCIPHome *CCIPHomeCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { var out []interface{} err := _CCIPHome.contract.Call(opts, &out, "typeAndVersion") @@ -1227,6 +1249,8 @@ type CCIPHomeInterface interface { Owner(opts *bind.CallOpts) (common.Address, error) + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + TypeAndVersion(opts *bind.CallOpts) (string, error) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index e2eb04e6b0..c71b67954c 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -5,7 +5,7 @@ burn_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnMintTokenPoo burn_with_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.bin 6333d0314d0bd29e75ea5e05fe62a4516ade0c6db91c30b6f93645035db52ed8 burn_with_from_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.bin 08ed1235dda921ce8841b26aa18d0c0f36db4884779dd7670857159801b6d597 ccip_encoding_utils: ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.bin ebabd5311ad4374df0f2f5cd5640bb58d938d92f5a82962ac4df7b6e5af2c197 -ccip_home: ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.abi ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.bin 0dad31438a094c33484189c0160ee9bc28a6909eabeb9450664313867521faec +ccip_home: ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.abi ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.bin 5bba70340f698b4e88677f996ec8c6dd3bebdc31081c9fa0cf4e81ce2e9b3f42 ccip_reader_tester: ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin 1181c7150062d6f0793beb50cb6b984c7f7adef0b9528ef1b419923fffcfdcac commit_store: ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.abi ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.bin 274d87db70b643e00ab0a7e7845bb4b791f3b613bfc87708d33fc5a8369e2a41 commit_store_helper: ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.abi ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.bin f7128dcc2ee6dbcbc976288abcc16970ffb19b59412c5202ef6b259d2007f801 From a69addc7c0668f687c0df65c1b4faca1c941b0d8 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 20 Sep 2024 15:10:33 +0200 Subject: [PATCH 7/7] add 165 test --- contracts/gas-snapshots/ccip.gas-snapshot | 2 ++ contracts/src/v0.8/ccip/capability/CCIPHome.sol | 2 ++ .../src/v0.8/ccip/test/capability/CCIPHome.t.sol | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 2e9914afef..9e14950e1c 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -65,6 +65,8 @@ CCIPHome_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9594) CCIPHome_chainConfig:test_getPaginatedCCIPHomes_Success() (gas: 370990) CCIPHome_constructor:test_constructor_Success() (gas: 2988852) CCIPHome_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61020) +CCIPHome_supportsInterface:test_getCapabilityConfiguration_Success() (gas: 9485) +CCIPHome_supportsInterface:test_supportsInterface_Success() (gas: 8964) CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 19611) CCIPHome_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 19418) CCIPHome_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9631) diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol index 76eae80515..03752831dc 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPHome.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -151,6 +151,8 @@ contract CCIPHome is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator, } /// @inheritdoc IERC165 + /// @dev The CapabilitiesRegistry contract will call this function with the `ICapabilityConfiguration` interface ID. + /// If that call doesn't succeed, no config can be set. function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; } diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol index 4e921295c9..27a2396905 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol @@ -1,8 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; -import {CCIPHome} from "../../capability/CCIPHome.sol"; +import {ICapabilityConfiguration} from "../../../keystone/interfaces/ICapabilityConfiguration.sol"; import {ICapabilitiesRegistry} from "../../interfaces/ICapabilitiesRegistry.sol"; + +import {CCIPHome} from "../../capability/CCIPHome.sol"; import {Internal} from "../../libraries/Internal.sol"; import {CCIPHomeHelper} from "../helpers/CCIPHomeHelper.sol"; import {Test} from "forge-std/Test.sol"; @@ -1210,6 +1212,14 @@ contract CCIPHome_updatePluginConfig is CCIPHomeSetup { } } +contract CCIPHome_supportsInterface is CCIPHomeSetup { + function test_supportsInterface_Success() public { + assertTrue( + s_ccipCC.supportsInterface(type(ICapabilityConfiguration).interfaceId), "supportsInterface must return true" + ); + } +} + contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeSetup { function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public { changePrank(CAPABILITIES_REGISTRY);