diff --git a/.github/workflows/ccip-live-network-tests.yml b/.github/workflows/ccip-live-network-tests.yml index 089fcf739b..d1789fca74 100644 --- a/.github/workflows/ccip-live-network-tests.yml +++ b/.github/workflows/ccip-live-network-tests.yml @@ -43,18 +43,20 @@ env: E2E_TEST_AVALANCHE_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_BASE_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_BLAST_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} + E2E_TEST_BSC_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_CELO_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_ETHEREUM_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_GNOSIS_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_KROMA_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} + E2E_TEST_LINEA_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_METIS_ANDROMEDA_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_MODE_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_OPTIMISM_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_POLYGON_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} + E2E_TEST_SCROLL_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_WEMIX_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} E2E_TEST_ZKSYNC_MAINNET_WALLET_KEY: ${{ secrets.QA_SHARED_803C_KEY }} - jobs: build-chainlink: environment: integration @@ -232,7 +234,7 @@ jobs: should_cleanup: false ccip-smoke-test: - name: CCIP smoke Test ${{ matrix.lanes.name }} + name: 'CCIP Smoke - Source: ${{ matrix.lanes.name }}' environment: integration runs-on: ubuntu-latest needs: [ build-chainlink ] @@ -320,7 +322,7 @@ jobs: org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: CCIP Smoke Test + this-job-name: 'CCIP Smoke - Source: ${{ matrix.lanes.name }}' continue-on-error: true - name: Checkout the repo if: ${{ matrix.lanes.enabled == true }} @@ -392,4 +394,87 @@ jobs: aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} cache_key_id: ccip-smoke-${{ env.MOD_CACHE_VERSION }} cache_restore_only: "true" - should_cleanup: false \ No newline at end of file + should_cleanup: false + + # Custom reporting Jobs + start-slack-thread: + name: Start Slack Thread + if: ${{ always() && needs.ccip-smoke-test.result != 'skipped' && needs.ccip-smoke-test.result != 'cancelled' }} + environment: integration + outputs: + thread_ts: ${{ steps.slack.outputs.thread_ts }} + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + runs-on: ubuntu-latest + needs: [ ccip-smoke-test ] + steps: + - name: Debug Result + run: echo ${{ join(needs.*.result, ',') }} + - name: Main Slack Notification + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + id: slack + with: + channel-id: "#test-run-notifications" + payload: | + { + "attachments": [ + { + "color": "${{ contains(join(needs.*.result, ','), 'failure') && '#C62828' || '#2E7D32' }}", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "CCIP Mainnet Smoke tests ${{ contains(join(needs.*.result, ','), 'failure') && ':x:' || ':white_check_mark:'}}", + "emoji": true + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "<${{ github.server_url }}/${{ github.repository }}/${{contains(github.ref_name, 'release') && 'releases/tag' || 'tree'}}/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>" + } + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + post-test-results-to-slack: + name: Post Test Results + if: ${{ always() && needs.start-slack-thread.result != 'skipped' && needs.start-slack-thread.result != 'cancelled' }} + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + runs-on: ubuntu-latest + needs: start-slack-thread + steps: + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Post Test Results + uses: ./.github/actions/notify-slack-jobs-result + with: + github_token: ${{ github.token }} + github_repository: ${{ github.repository }} + workflow_run_id: ${{ github.run_id }} + github_job_name_regex: ^CCIP Smoke (.*)$ + message_title: CCIP Mainnet Smoke test + slack_channel_id: "#test-run-notifications" + slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} + slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }} + + # End Reporting Jobs \ No newline at end of file diff --git a/contracts/.solhintignore b/contracts/.solhintignore index 82f217fa2a..d076b14dc6 100644 --- a/contracts/.solhintignore +++ b/contracts/.solhintignore @@ -42,8 +42,5 @@ ./src/v0.8/vendor ./node_modules/ -# Ignore RMNHome contract temporarily -./src/v0.8/ccip/rmn/RMNHome.sol - # Ignore tweaked vendored contracts ./src/v0.8/shared/enumerable/EnumerableSetWithBytes16.sol \ No newline at end of file diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 5d00beeae3..b714458080 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -35,65 +35,52 @@ 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: 87751) -CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 359022) -CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 478323) -CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 443187) -CCIPConfig_ConfigStateMachine:test__groupByPluginType_TooManyOCR3Configs_Reverts() (gas: 31646) -CCIPConfig_ConfigStateMachine:test__groupByPluginType_threeCommitConfigs_Reverts() (gas: 64324) -CCIPConfig_ConfigStateMachine:test__groupByPluginType_threeExecutionConfigs_Reverts() (gas: 64262) -CCIPConfig_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11734) -CCIPConfig_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8783) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 308111) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 48274) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 27945) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 368614) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 116145) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 149842) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 368354) -CCIPConfig_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 149909) -CCIPConfig_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9632) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1798048) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 1040966) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 1040997) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9665) -CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 16115) -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: 3275156) -CCIPConfig_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61370) -CCIPConfig_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 24518) -CCIPConfig_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 21077) -CCIPConfig_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9654) -CCIPConfig_updatePluginConfig:test_updatePluginConfig_InitToRunning_Success() (gas: 1092200) -CCIPConfig_updatePluginConfig:test_updatePluginConfig_RunningToStaging_Success() (gas: 2043837) -CCIPConfig_updatePluginConfig:test_updatePluginConfig_StagingToRunning_Success() (gas: 2043872) -CCIPConfig_validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 334491) -CCIPConfig_validateConfig:test__validateConfigSmallerFChain_Success() (gas: 465605) -CCIPConfig_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 289551) -CCIPConfig_validateConfig:test__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero_Reverts() (gas: 289846) -CCIPConfig_validateConfig:test__validateConfig_ChainSelectorNotFound_Reverts() (gas: 292593) -CCIPConfig_validateConfig:test__validateConfig_ChainSelectorNotSet_Reverts() (gas: 289185) -CCIPConfig_validateConfig:test__validateConfig_FChainTooHigh_Reverts() (gas: 336851) -CCIPConfig_validateConfig:test__validateConfig_FMustBePositive_Reverts() (gas: 290977) -CCIPConfig_validateConfig:test__validateConfig_FTooHigh_Reverts() (gas: 290416) -CCIPConfig_validateConfig:test__validateConfig_NodeNotInRegistry_Reverts() (gas: 343692) -CCIPConfig_validateConfig:test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() (gas: 309173) -CCIPConfig_validateConfig:test__validateConfig_NotEnoughTransmitters_Reverts() (gas: 1211220) -CCIPConfig_validateConfig:test__validateConfig_OfframpAddressCannotBeZero_Reverts() (gas: 289247) -CCIPConfig_validateConfig:test__validateConfig_RMNHomeAddressCannotBeZero_Reverts() (gas: 289485) -CCIPConfig_validateConfig:test__validateConfig_Success() (gas: 300450) -CCIPConfig_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 790349) -CCIPConfig_validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 293748) -CCIPConfig_validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 293820) -CCIPConfig_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9596) +CCIPHome__validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 334693) +CCIPHome__validateConfig:test__validateConfigSmallerFChain_Success() (gas: 466117) +CCIPHome__validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 289739) +CCIPHome__validateConfig:test__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero_Reverts() (gas: 290034) +CCIPHome__validateConfig:test__validateConfig_ChainSelectorNotFound_Reverts() (gas: 292771) +CCIPHome__validateConfig:test__validateConfig_ChainSelectorNotSet_Reverts() (gas: 289373) +CCIPHome__validateConfig:test__validateConfig_FChainTooHigh_Reverts() (gas: 337311) +CCIPHome__validateConfig:test__validateConfig_FMustBePositive_Reverts() (gas: 291145) +CCIPHome__validateConfig:test__validateConfig_FTooHigh_Reverts() (gas: 290604) +CCIPHome__validateConfig:test__validateConfig_NodeNotInRegistry_Reverts() (gas: 344238) +CCIPHome__validateConfig:test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() (gas: 309179) +CCIPHome__validateConfig:test__validateConfig_NotEnoughTransmitters_Reverts() (gas: 1212133) +CCIPHome__validateConfig:test__validateConfig_OfframpAddressCannotBeZero_Reverts() (gas: 289400) +CCIPHome__validateConfig:test__validateConfig_RMNHomeAddressCannotBeZero_Reverts() (gas: 289661) +CCIPHome__validateConfig:test__validateConfig_Success() (gas: 300616) +CCIPHome__validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 773237) +CCIPHome__validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 293988) +CCIPHome__validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 294035) +CCIPHome_applyChainConfigUpdates:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 185242) +CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 347249) +CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 20631) +CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 270824) +CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14952) +CCIPHome_applyChainConfigUpdates:test_getPaginatedCCIPHomes_Success() (gas: 370980) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_DONIdMismatch_reverts() (gas: 27108) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_InnerCallReverts_reverts() (gas: 11783) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_InvalidSelector_reverts() (gas: 11038) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_reverts() (gas: 26121) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_success() (gas: 1412263) +CCIPHome_constructor:test_constructor_CapabilitiesRegistryAddressZero_reverts() (gas: 63866) +CCIPHome_constructor:test_constructor_success() (gas: 3498390) +CCIPHome_constructor:test_getCapabilityConfiguration_success() (gas: 9173) +CCIPHome_constructor:test_supportsInterface_success() (gas: 9865) +CCIPHome_getAllConfigs:test_getAllConfigs_success() (gas: 2735455) +CCIPHome_getConfigDigests:test_getConfigDigests_success() (gas: 2513909) +CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_CanOnlySelfCall_reverts() (gas: 9110) +CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() (gas: 21877) +CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() (gas: 8796) +CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_success() (gas: 2556754) +CCIPHome_revokeCandidate:test_revokeCandidate_CanOnlySelfCall_reverts() (gas: 9068) +CCIPHome_revokeCandidate:test_revokeCandidate_ConfigDigestMismatch_reverts() (gas: 18421) +CCIPHome_revokeCandidate:test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() (gas: 8773) +CCIPHome_revokeCandidate:test_revokeCandidate_success() (gas: 29506) +CCIPHome_setCandidate:test_setCandidate_CanOnlySelfCall_reverts() (gas: 19022) +CCIPHome_setCandidate:test_setCandidate_ConfigDigestMismatch_reverts() (gas: 1385010) +CCIPHome_setCandidate:test_setCandidate_success() (gas: 1355245) CommitStore_constructor:test_Constructor_Success() (gas: 2855567) CommitStore_isUnpausedAndRMNHealthy:test_RMN_Success() (gas: 73954) CommitStore_report:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 28739) @@ -811,6 +798,28 @@ PingPong_plumbing:test_OutOfOrderExecution_Success() (gas: 20310) PingPong_plumbing:test_Pausing_Success() (gas: 17810) PingPong_startPingPong:test_StartPingPong_With_OOO_Success() (gas: 162091) PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered_Success() (gas: 181509) +RMNHome__validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_DuplicateOffchainPublicKey_reverts() (gas: 18822) +RMNHome__validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_DuplicatePeerId_reverts() (gas: 18682) +RMNHome__validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_DuplicateSourceChain_reverts() (gas: 20371) +RMNHome__validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_MinObserversTooHigh_reverts() (gas: 20810) +RMNHome__validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_OutOfBoundsNodesLength_reverts() (gas: 137268) +RMNHome__validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_OutOfBoundsObserverNodeIndex_reverts() (gas: 20472) +RMNHome_getConfigDigests:test_getConfigDigests_success() (gas: 1077745) +RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() (gas: 23857) +RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() (gas: 10575) +RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_OnlyOwner_reverts() (gas: 10936) +RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_success() (gas: 1083071) +RMNHome_revokeCandidate:test_revokeCandidate_ConfigDigestMismatch_reverts() (gas: 19063) +RMNHome_revokeCandidate:test_revokeCandidate_OnlyOwner_reverts() (gas: 10963) +RMNHome_revokeCandidate:test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() (gas: 10606) +RMNHome_revokeCandidate:test_revokeCandidate_success() (gas: 28147) +RMNHome_setCandidate:test_setCandidate_ConfigDigestMismatch_reverts() (gas: 594679) +RMNHome_setCandidate:test_setCandidate_OnlyOwner_reverts() (gas: 15177) +RMNHome_setCandidate:test_setCandidate_success() (gas: 588379) +RMNHome_setDynamicConfig:test_setDynamicConfig_DigestNotFound_reverts() (gas: 30159) +RMNHome_setDynamicConfig:test_setDynamicConfig_MinObserversTooHigh_reverts() (gas: 18848) +RMNHome_setDynamicConfig:test_setDynamicConfig_OnlyOwner_reverts() (gas: 14115) +RMNHome_setDynamicConfig:test_setDynamicConfig_success() (gas: 103911) RMNRemote_constructor:test_constructor_success() (gas: 8334) RMNRemote_constructor:test_constructor_zeroChainSelector_reverts() (gas: 59165) RMNRemote_curse:test_curse_AlreadyCursed_duplicateSubject_reverts() (gas: 154457) @@ -969,7 +978,7 @@ TokenAdminRegistry_setPool:test_setPool_ZeroAddressRemovesPool_Success() (gas: 3 TokenAdminRegistry_transferAdminRole:test_transferAdminRole_OnlyAdministrator_Revert() (gas: 18103) TokenAdminRegistry_transferAdminRole:test_transferAdminRole_Success() (gas: 49438) TokenPoolAndProxy:test_lockOrBurn_burnMint_Success() (gas: 5586499) -TokenPoolAndProxy:test_lockOrBurn_burnWithFromMint_Success() (gas: 5617969) +TokenPoolAndProxy:test_lockOrBurn_burnWithFromMint_Success() (gas: 5618769) TokenPoolAndProxy:test_lockOrBurn_lockRelease_Success() (gas: 5793246) TokenPoolAndProxy:test_setPreviousPool_Success() (gas: 3070731) TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_2() (gas: 6434801) diff --git a/contracts/scripts/native_solc_compile_all_ccip b/contracts/scripts/native_solc_compile_all_ccip index 0696d66115..a8f2b2f233 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 @@ -104,7 +103,7 @@ compileContract ccip/test/WETH9.sol # Encoding Utils -compileContract ccip/CCIPEncodingUtils.sol +compileContract ccip/interfaces/encodingutils/ICCIPEncodingUtils.sol # Customer contracts compileContract ccip/pools/USDC/USDCTokenPool.sol diff --git a/contracts/src/v0.8/ccip/CCIPEncodingUtils.sol b/contracts/src/v0.8/ccip/CCIPEncodingUtils.sol deleted file mode 100644 index 010fa4a1cd..0000000000 --- a/contracts/src/v0.8/ccip/CCIPEncodingUtils.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.24; - -import {RMNRemote} from "./rmn/RMNRemote.sol"; - -/// @dev this file exposes structs that are otherwise internal to the CCIP codebase -/// doing this allows those structs to be encoded and decoded with type safety in offchain code -/// and tests because generated wrappers are available -contract CCIPEncodingUtils { - error DoNotDeploy(); - - constructor() { - revert DoNotDeploy(); - } - - /// @dev the RMN Report struct is used in integration / E2E tests - function _rmnReport(bytes32 rmnReportVersion, RMNRemote.Report memory rmnReport) external {} -} diff --git a/contracts/src/v0.8/ccip/FeeQuoter.sol b/contracts/src/v0.8/ccip/FeeQuoter.sol index 9004c6b97d..d2a6b77eff 100644 --- a/contracts/src/v0.8/ccip/FeeQuoter.sol +++ b/contracts/src/v0.8/ccip/FeeQuoter.sol @@ -94,8 +94,8 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, uint32 maxPerMsgGasLimit; // │ Maximum gas limit for messages targeting EVMs uint32 destGasOverhead; // │ Gas charged on top of the gasLimit to cover destination chain costs uint16 destGasPerPayloadByte; // │ Destination chain gas charged for passing each byte of `data` payload to receiver - uint32 destDataAvailabilityOverheadGas; // | Extra data availability gas charged on top of the message, e.g. for OCR - uint16 destGasPerDataAvailabilityByte; // | Amount of gas to charge per byte of message data that needs availability + uint32 destDataAvailabilityOverheadGas; // │ Extra data availability gas charged on top of the message, e.g. for OCR + uint16 destGasPerDataAvailabilityByte; // │ Amount of gas to charge per byte of message data that needs availability uint16 destDataAvailabilityMultiplierBps; // │ Multiplier for data availability gas, multiples of bps, or 0.0001 // The following three properties are defaults, they can be overridden by setting the TokenTransferFeeConfig for a token uint16 defaultTokenFeeUSDCents; // │ Default token fee charged per token transfer diff --git a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol b/contracts/src/v0.8/ccip/capability/CCIPConfig.sol deleted file mode 100644 index e677c132f9..0000000000 --- a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol +++ /dev/null @@ -1,570 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -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 {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. -/// 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 { - 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); - /// @notice Emitted when a chain's configuration is removed. - /// @param chainSelector The chain selector. - event ChainConfigRemoved(uint64 chainSelector); - - error NodeNotInRegistry(bytes32 p2pId); - error OnlyCapabilitiesRegistryCanCall(); - error ChainSelectorNotFound(uint64 chainSelector); - error ChainSelectorNotSet(); - error TooManyOCR3Configs(); - error TooManySigners(); - error InvalidNode(CCIPConfigTypes.OCR3Node node); - error NotEnoughTransmitters(uint256 got, uint256 minimum); - error FChainMustBePositive(); - error FTooHigh(); - error FChainTooHigh(uint256 fChain, uint256 FRoleDON); - error InvalidPluginType(); - error OfframpAddressCannotBeZero(); - error RMNHomeAddressCannotBeZero(); - error InvalidConfigLength(uint256 length); - error InvalidConfigStateTransition( - CCIPConfigTypes.ConfigState currentState, CCIPConfigTypes.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); - - /// @dev Type and version override. - string public constant override typeAndVersion = "CCIPConfig 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; - 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 - bytes32 internal constant EMPTY_ENCODED_ADDRESS_HASH = keccak256(abi.encode(address(0))); - /// @dev 256 is the hard limit due to the bit encoding of their indexes into a uint256. - 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; - - /// @dev All chains that are configured. - EnumerableSet.UintSet private s_remoteChainSelectors; - - /// @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; - - /// @param capabilitiesRegistry the canonical capabilities registry address. - constructor(address capabilitiesRegistry) { - if (capabilitiesRegistry == address(0)) { - revert ZeroAddressNotAllowed(); - } - 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) { - return i_capabilitiesRegistry; - } - - /// @notice Returns the total number of chains configured. - /// @return The total number of chains configured. - function getNumChainConfigurations() external view returns (uint256) { - return s_remoteChainSelectors.length(); - } - - /// @notice Returns all the chain configurations. - /// @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) { - 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 - } - - uint256 endIndex = startIndex + pageSize; - if (endIndex > totalItems) { - endIndex = totalItems; - } - - CCIPConfigTypes.ChainConfigInfo[] memory paginatedChainConfigs = - new CCIPConfigTypes.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] - }); - } - - return paginatedChainConfigs; - } - - /// @notice Returns the OCR configuration for the given don ID and plugin type. - /// @param donId The DON ID. - /// @param pluginType The plugin type. - /// @return The OCR3 configurations, up to 2 (blue and green). - function getOCRConfig( - uint32 donId, - Internal.OCRPluginType pluginType - ) external view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { - return s_ocr3Configs[donId][pluginType]; - } - - // ================================================================ - // │ Capability Configuration │ - // ================================================================ - - /// @inheritdoc ICapabilityConfiguration - /// @dev The CCIP capability will fetch the configuration needed directly from this contract. - /// The offchain syncer will call this function, however, so its important that it doesn't revert. - function getCapabilityConfiguration(uint32 /* donId */ ) external pure override returns (bytes memory configuration) { - return bytes(""); - } - - /// @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 */ - bytes calldata config, - 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[]))); - if (commitConfigs.length > 0) { - _updatePluginConfig(donId, Internal.OCRPluginType.Commit, commitConfigs); - } - if (execConfigs.length > 0) { - _updatePluginConfig(donId, Internal.OCRPluginType.Execution, execConfigs); - } - } - - /// @notice Sets a new OCR3 config for a specific plugin type for a DON. - /// @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]; - - // 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); - _validateConfigStateTransition(currentState, proposedState); - - // Build the new configuration with metadata and validate that the transition is valid. - CCIPConfigTypes.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) { - // 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.configDigest = newConfigWithMeta[i].configDigest; - ocr3ConfigWithMeta.configCount = newConfigWithMeta[i].configCount; - - CCIPConfigTypes.OCR3Config storage ocr3Config = ocr3ConfigWithMeta.config; - CCIPConfigTypes.OCR3Config memory newOcr3Config = newConfigWithMeta[i].config; - ocr3Config.pluginType = newOcr3Config.pluginType; - ocr3Config.chainSelector = newOcr3Config.chainSelector; - ocr3Config.FRoleDON = newOcr3Config.FRoleDON; - ocr3Config.offchainConfigVersion = newOcr3Config.offchainConfigVersion; - ocr3Config.offrampAddress = newOcr3Config.offrampAddress; - ocr3Config.rmnHomeAddress = newOcr3Config.rmnHomeAddress; - 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]); - } - } - } - - emit ConfigSet(donId, uint8(pluginType), newConfigWithMeta); - } - - // ================================================================ - // │ 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 (CCIPConfigTypes.ConfigState) { - if (configLen > 2) { - revert InvalidConfigLength(configLen); - } - return CCIPConfigTypes.ConfigState(configLen); - } - - /// @notice Validates the state transition between two config states. - /// The only valid state transitions are the following: - /// Init -> Running (first ever config) - /// Running -> Staging (blue/green proposal) - /// Staging -> Running (promotion) - /// 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 { - // Calculate the difference between the new state and the current state - int256 stateDiff = int256(uint256(newState)) - int256(uint256(currentState)); - - // Check if the state transition is valid: - // Valid transitions: - // 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)) { - return; - } - revert InvalidConfigStateTransition(currentState, newState); - } - - /// @notice Validates the transition between two OCR3 configurations. - /// @param currentConfig The current configuration with metadata. - /// @param newConfigWithMeta The new configuration with metadata. - function _validateConfigTransition( - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, - CCIPConfigTypes.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); - } - return; - } - - if (currentConfigLen == 1 && newConfigLen == 2) { - // On a blue/green proposal: - // * the config digest of the blue config must remain unchanged. - // * the green config count must be the blue config count + 1. - 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); - } - return; - } - - if (currentConfigLen == 2 && newConfigLen == 1) { - // On a promotion, the green config digest must become the blue config digest. - if (newConfigWithMeta[0].configDigest != currentConfig[1].configDigest) { - revert WrongConfigDigest(newConfigWithMeta[0].configDigest, currentConfig[1].configDigest); - } - return; - } - - revert NonExistentConfigTransition(); - } - - /// @notice Computes a new configuration with metadata based on the current configuration and the new configuration. - /// @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, - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, - CCIPConfigTypes.OCR3Config[] memory newConfig, - CCIPConfigTypes.ConfigState currentState, - CCIPConfigTypes.ConfigState newState - ) internal view returns (CCIPConfigTypes.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) { - // First ever config starts with config count == 1. - configCounts[0] = 1; - } else if (currentState == CCIPConfigTypes.ConfigState.Running && newState == CCIPConfigTypes.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) { - // On a promotion, the config count of the green config becomes the blue config count. - configCounts[0] = currentConfig[1].configCount; - } else { - revert InvalidConfigStateTransition(currentState, newState); - } - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = - new CCIPConfigTypes.OCR3ConfigWithMeta[](newConfig.length); - for (uint256 i = 0; i < configCounts.length; ++i) { - _validateConfig(newConfig[i]); - newConfigWithMeta[i] = CCIPConfigTypes.OCR3ConfigWithMeta({ - config: newConfig[i], - configCount: configCounts[i], - configDigest: _computeConfigDigest(donId, configCounts[i], newConfig[i]) - }); - } - - 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( - CCIPConfigTypes.OCR3Config[] memory ocr3Configs - ) - internal - pure - returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.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 CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); - execConfigs = new CCIPConfigTypes.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(CCIPConfigTypes.OCR3Config memory cfg) internal view { - if (cfg.chainSelector == 0) revert ChainSelectorNotSet(); - if (cfg.pluginType != Internal.OCRPluginType.Commit && cfg.pluginType != Internal.OCRPluginType.Execution) { - revert InvalidPluginType(); - } - if (cfg.offrampAddress.length == 0 || keccak256(cfg.offrampAddress) == EMPTY_ENCODED_ADDRESS_HASH) { - revert OfframpAddressCannotBeZero(); - } - if (cfg.rmnHomeAddress.length == 0 || keccak256(cfg.rmnHomeAddress) == EMPTY_ENCODED_ADDRESS_HASH) { - revert RMNHomeAddressCannotBeZero(); - } - if (!s_remoteChainSelectors.contains(cfg.chainSelector)) revert ChainSelectorNotFound(cfg.chainSelector); - - // fChain cannot exceed FRoleDON, since it is a subcommittee in the larger DON - uint256 FRoleDON = cfg.FRoleDON; - uint256 fChain = s_chainConfigurations[cfg.chainSelector].fChain; - // fChain > 0 is enforced in applyChainConfigUpdates, and the presence of a chain config is checked above - // FRoleDON != 0 because FRoleDON >= fChain is enforced here - if (fChain > FRoleDON) { - revert FChainTooHigh(fChain, FRoleDON); - } - - // len(nodes) >= 3 * FRoleDON + 1 - // len(nodes) == numberOfSigners - uint256 numberOfNodes = cfg.nodes.length; - if (numberOfNodes > MAX_NUM_ORACLES) revert TooManySigners(); - if (numberOfNodes <= 3 * FRoleDON) revert FTooHigh(); - - uint256 nonZeroTransmitters = 0; - bytes32[] memory p2pIds = new bytes32[](numberOfNodes); - for (uint256 i = 0; i < numberOfNodes; ++i) { - CCIPConfigTypes.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, - if (node.transmitterKey.length != 0) { - nonZeroTransmitters++; - } - - // Signer key and p2pIds must always be present - if (node.signerKey.length == 0 || node.p2pId == bytes32(0)) { - revert InvalidNode(node); - } - - p2pIds[i] = node.p2pId; - } - - // We check for chain config presence above, so fChain here must be non-zero. fChain <= FRoleDON due to the checks above. - // There can be less transmitters than signers - so they can be set to zero (which indicates that a node is a signer, but not a transmitter). - uint256 minTransmittersLength = 3 * fChain + 1; - if (nonZeroTransmitters < minTransmittersLength) { - revert NotEnoughTransmitters(nonZeroTransmitters, minTransmittersLength); - } - - // Check that the readers are in the capabilities registry. - _ensureInRegistry(p2pIds); - } - - /// @notice Computes the digest of the provided configuration. - /// @dev In traditional OCR config digest computation, block.chainid and address(this) are used - /// in order to further domain separate the digest. We can't do that here since the digest will - /// 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 ocr3Config The OCR3 configuration. - /// @return The computed digest. - function _computeConfigDigest( - uint32 donId, - uint64 configCount, - CCIPConfigTypes.OCR3Config memory ocr3Config - ) internal pure returns (bytes32) { - uint256 h = uint256( - keccak256( - abi.encode( - ocr3Config.chainSelector, - donId, - ocr3Config.pluginType, - ocr3Config.offrampAddress, - ocr3Config.rmnHomeAddress, - configCount, - ocr3Config.nodes, - ocr3Config.FRoleDON, - ocr3Config.offchainConfigVersion, - ocr3Config.offchainConfig - ) - ) - ); - - return bytes32((CONFIG_DIGEST_PREFIX & CONFIG_DIGEST_PREFIX_MASK) | (h & ~CONFIG_DIGEST_PREFIX_MASK)); - } - - // ================================================================ - // │ Chain Configuration │ - // ================================================================ - - /// @notice Sets and/or removes chain configurations. - /// Does not validate that fChain <= FRoleDON and relies on OCR3Configs to be changed in case fChain becomes larger than the FRoleDON value. - /// @param chainSelectorRemoves The chain configurations to remove. - /// @param chainConfigAdds The chain configurations to add. - function applyChainConfigUpdates( - uint64[] calldata chainSelectorRemoves, - CCIPConfigTypes.ChainConfigInfo[] calldata chainConfigAdds - ) external onlyOwner { - // Process removals first. - for (uint256 i = 0; i < chainSelectorRemoves.length; ++i) { - // check if the chain selector is in s_remoteChainSelectors first. - if (!s_remoteChainSelectors.contains(chainSelectorRemoves[i])) { - revert ChainSelectorNotFound(chainSelectorRemoves[i]); - } - - delete s_chainConfigurations[chainSelectorRemoves[i]]; - s_remoteChainSelectors.remove(chainSelectorRemoves[i]); - - emit ChainConfigRemoved(chainSelectorRemoves[i]); - } - - // Process additions next. - for (uint256 i = 0; i < chainConfigAdds.length; ++i) { - CCIPConfigTypes.ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; - uint64 chainSelector = chainConfigAdds[i].chainSelector; - - // Verify that the provided readers are present in the capabilities registry. - _ensureInRegistry(chainConfig.readers); - - // Verify that fChain is positive. - if (chainConfig.fChain == 0) { - revert FChainMustBePositive(); - } - - s_chainConfigurations[chainSelector] = chainConfig; - s_remoteChainSelectors.add(chainSelector); - - emit ChainConfigSet(chainSelector, chainConfig); - } - } - - /// @notice Helper function to ensure that a node is in the capabilities registry. - /// @param p2pIds The P2P IDs of the node to check. - function _ensureInRegistry(bytes32[] memory p2pIds) internal view { - for (uint256 i = 0; i < p2pIds.length; ++i) { - // TODO add a method that does the validation in the ICapabilitiesRegistry contract - if (ICapabilitiesRegistry(i_capabilitiesRegistry).getNode(p2pIds[i]).p2pId == bytes32("")) { - revert NodeNotInRegistry(p2pIds[i]); - } - } - } -} diff --git a/contracts/src/v0.8/ccip/capability/CCIPHome.sol b/contracts/src/v0.8/ccip/capability/CCIPHome.sol new file mode 100644 index 0000000000..3f05b59d5b --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/CCIPHome.sol @@ -0,0 +1,613 @@ +// SPDX-License-Identifier: BUSL-1.1 +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 {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. +/// 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. +/// @dev This contract is a state machine with the following states: +/// - Init: The initial state of the contract, no config has been set, or all configs have been revoked. +/// [0, 0] +/// +/// - Candidate: A new config has been set, but it has not been promoted yet, or all active configs have been revoked. +/// [0, 1] +/// +/// - Active: A non-zero config has been promoted and is active, there is no candidate configured. +/// [1, 0] +/// +/// - ActiveAndCandidate: A non-zero config has been promoted and is active, and a new config has been set as candidate. +/// [1, 1] +/// +/// The following state transitions are allowed: +/// - Init -> Candidate: setCandidate() +/// - Candidate -> Active: promoteCandidateAndRevokeActive() +/// - Candidate -> Candidate: setCandidate() +/// - Candidate -> Init: revokeCandidate() +/// - Active -> ActiveAndCandidate: setCandidate() +/// - Active -> Init: promoteCandidateAndRevokeActive() +/// - ActiveAndCandidate -> Active: promoteCandidateAndRevokeActive() +/// - ActiveAndCandidate -> Active: revokeCandidate() +/// - ActiveAndCandidate -> ActiveAndCandidate: setCandidate() +/// +/// This means the following calls are not allowed at the following states: +/// - Init: promoteCandidateAndRevokeActive(), as there is no config to promote. +/// - Init: revokeCandidate(), as there is no config to revoke +/// - Active: revokeCandidate(), as there is no candidate to revoke +/// Note that we explicitly do allow promoteCandidateAndRevokeActive() to be called when there is an active config but +/// no candidate config. This is the only way to remove the active config. The alternative would be to set some unusable +/// config as candidate and promote that, but fully clearing it is cleaner. +/// +/// ┌─────────────┐ setCandidate ┌─────────────┐ +/// │ ├───────────────────►│ │ setCandidate +/// │ Init │ revokeCandidate │ Candidate │◄───────────┐ +/// │ [0,0] │◄───────────────────┤ [0,1] │────────────┘ +/// │ │ ┌─────────────────┤ │ +/// └─────────────┘ │ promote- └─────────────┘ +/// ▲ │ Candidate +/// promote- │ │ +/// Candidate │ │ +/// │ │ +/// ┌──────────┴──┐ │ promote- ┌─────────────┐ +/// │ │◄─┘ Candidate OR │ Active & │ setCandidate +/// │ Active │ revokeCandidate │ Candidate │◄───────────┐ +/// │ [1,0] │◄───────────────────┤ [1,1] │────────────┘ +/// │ ├───────────────────►│ │ +/// └─────────────┘ setSecondary └─────────────┘ +/// +contract CCIPHome is OwnerIsCreator, ITypeAndVersion, ICapabilityConfiguration, IERC165 { + using EnumerableSet for EnumerableSet.UintSet; + + event ChainConfigRemoved(uint64 chainSelector); + event ChainConfigSet(uint64 chainSelector, ChainConfig chainConfig); + event ConfigSet(bytes32 indexed configDigest, uint32 version, OCR3Config config); + event ActiveConfigRevoked(bytes32 indexed configDigest); + event CandidateConfigRevoked(bytes32 indexed configDigest); + event ConfigPromoted(bytes32 indexed configDigest); + + error NodeNotInRegistry(bytes32 p2pId); + error ChainSelectorNotFound(uint64 chainSelector); + error FChainMustBePositive(); + error ChainSelectorNotSet(); + error InvalidPluginType(); + error OfframpAddressCannotBeZero(); + error FChainTooHigh(uint256 fChain, uint256 FRoleDON); + error TooManySigners(); + error FTooHigh(); + error RMNHomeAddressCannotBeZero(); + error InvalidNode(OCR3Node node); + error NotEnoughTransmitters(uint256 got, uint256 minimum); + error OnlyCapabilitiesRegistryCanCall(); + error ZeroAddressNotAllowed(); + error ConfigDigestMismatch(bytes32 expectedConfigDigest, bytes32 gotConfigDigest); + error CanOnlySelfCall(); + error RevokingZeroDigestNotAllowed(); + error NoOpStateTransitionNotAllowed(); + error InvalidSelector(bytes4 selector); + error DONIdMismatch(uint32 callDonId, uint32 capabilityRegistryDonId); + + error InvalidStateTransition( + bytes32 currentActiveDigest, + bytes32 currentCandidateDigest, + bytes32 proposedActiveDigest, + bytes32 proposedCandidateDigest + ); + + /// @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 exec offchain configuration. + bytes offrampAddress; // The remote chain offramp address. + bytes rmnHomeAddress; // The home chain RMN home address. + OCR3Node[] nodes; // Keys & IDs of nodes part of the role DON + bytes offchainConfig; // The offchain configuration for the OCR3 plugin. Protobuf encoded. + } + + struct VersionedConfig { + uint32 version; + bytes32 configDigest; + OCR3Config config; + } + + /// @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 ChainConfigArgs { + uint64 chainSelector; + ChainConfig chainConfig; + } + + string public constant override typeAndVersion = "CCIPHome 1.6.0-dev"; + + /// @dev A prefix added to all config digests that is unique to the implementation + uint256 private constant PREFIX = 0x000a << (256 - 16); // 0x000a00..00 + bytes32 internal constant EMPTY_ENCODED_ADDRESS_HASH = keccak256(abi.encode(address(0))); + /// @dev 256 is the hard limit due to the bit encoding of their indexes into a uint256. + uint256 internal constant MAX_NUM_ORACLES = 256; + + /// @notice Used for encoding the config digest prefix + uint256 private constant PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..00 + /// @notice The max number of configs that can be active at the same time. + uint256 private constant MAX_CONCURRENT_CONFIGS = 2; + /// @notice Helper to identify the zero config digest with less casting. + bytes32 private constant ZERO_DIGEST = bytes32(uint256(0)); + + /// @dev The canonical capabilities registry address. + address internal immutable i_capabilitiesRegistry; + + /// @dev chain configuration for each chain that CCIP is deployed on. + mapping(uint64 chainSelector => ChainConfig chainConfig) private s_chainConfigurations; + + /// @dev All chains that are configured. + EnumerableSet.UintSet private s_remoteChainSelectors; + + /// @notice This array holds the configs. + /// @dev A DonID covers a single chain, and the plugin type is used to differentiate between the commit and execution + mapping(uint32 donId => mapping(Internal.OCRPluginType pluginType => VersionedConfig[MAX_CONCURRENT_CONFIGS])) private + s_configs; + + /// @notice The total number of configs ever set, used for generating the version of the configs. + uint32 private s_currentVersion = 0; + /// @notice The index of the active config. + uint32 private s_activeConfigIndex = 0; + + /// @notice Constructor for the CCIPHome contract takes in the address of the capabilities registry. This address + /// is the only allowed caller to mutate the configuration through beforeCapabilityConfigSet. + constructor(address capabilitiesRegistry) { + if (capabilitiesRegistry == address(0)) { + revert ZeroAddressNotAllowed(); + } + i_capabilitiesRegistry = capabilitiesRegistry; + } + + // ================================================================ + // │ Capability Registry │ + // ================================================================ + + /// @notice Returns the capabilities registry address. + /// @return The capabilities registry address. + function getCapabilityRegistry() external view returns (address) { + return i_capabilitiesRegistry; + } + + /// @inheritdoc IERC165 + /// @dev Required for the capabilities registry to recognize this contract. + function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { + return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; + } + + /// @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 + bytes calldata update, + // Config count is unused because we don't want to invalidate a config on blue/green promotions so we keep track of + // the actual newly submitted configs instead of the number of config mutations. + uint64, // config count + uint32 donId + ) external override { + if (msg.sender != i_capabilitiesRegistry) { + revert OnlyCapabilitiesRegistryCanCall(); + } + + bytes4 selector = bytes4(update[:4]); + // We only allow self-calls to the following approved methods + if ( + selector != this.setCandidate.selector && selector != this.revokeCandidate.selector + && selector != this.promoteCandidateAndRevokeActive.selector + ) { + revert InvalidSelector(selector); + } + + // We validate that the call contains the correct DON ID. The DON ID is always the first function argument. + uint256 callDonId = abi.decode(update[4:36], (uint256)); + if (callDonId != donId) { + revert DONIdMismatch(uint32(callDonId), donId); + } + + // solhint-disable-next-line avoid-low-level-calls + (bool success, bytes memory retData) = address(this).call(update); + // if not successful, revert with the original revert + if (!success) { + assembly { + revert(add(retData, 0x20), returndatasize()) + } + } + } + + /// @inheritdoc ICapabilityConfiguration + /// @dev The CCIP capability will fetch the configuration needed directly from this contract. + /// The offchain syncer will call this function, so its important that it doesn't revert. + function getCapabilityConfiguration(uint32 /* donId */ ) external pure override returns (bytes memory configuration) { + return bytes(""); + } + + // ================================================================ + // │ Getters │ + // ================================================================ + + /// @notice Returns the current active and candidate config digests. + /// @dev Can be bytes32(0) if no config has been set yet or it has been revoked. + /// @param donId The key of the plugin to get the config digests for. + /// @return activeConfigDigest The digest of the active config. + /// @return candidateConfigDigest The digest of the candidate config. + function getConfigDigests( + uint32 donId, + Internal.OCRPluginType pluginType + ) public view returns (bytes32 activeConfigDigest, bytes32 candidateConfigDigest) { + return ( + s_configs[donId][pluginType][_getActiveIndex()].configDigest, + s_configs[donId][pluginType][_getCandidateIndex()].configDigest + ); + } + + /// @notice Returns the active config digest for for a given key. + /// @param donId The key of the plugin to get the config digests for. + function getActiveDigest(uint32 donId, Internal.OCRPluginType pluginType) public view returns (bytes32) { + return s_configs[donId][pluginType][_getActiveIndex()].configDigest; + } + + /// @notice Returns the candidate config digest for for a given key. + /// @param donId The key of the plugin to get the config digests for. + function getCandidateDigest(uint32 donId, Internal.OCRPluginType pluginType) public view returns (bytes32) { + return s_configs[donId][pluginType][_getCandidateIndex()].configDigest; + } + + /// @notice The offchain code can use this to fetch an old config which might still be in use by some remotes. Use + /// in case one of the configs is too large to be returnable by one of the other getters. + /// @param donId The unique key for the DON that the configuration applies to. + /// @param configDigest The digest of the config to fetch. + /// @return versionedConfig The config and its version. + /// @return ok True if the config was found, false otherwise. + function getConfig( + uint32 donId, + Internal.OCRPluginType pluginType, + bytes32 configDigest + ) external view returns (VersionedConfig memory versionedConfig, bool ok) { + for (uint256 i = 0; i < MAX_CONCURRENT_CONFIGS; ++i) { + // We never want to return true for a zero digest, even if the caller is asking for it, as this can expose old + // config state that is invalid. + if (s_configs[donId][pluginType][i].configDigest == configDigest && configDigest != ZERO_DIGEST) { + return (s_configs[donId][pluginType][i], true); + } + } + // versionConfig is uninitialized so it contains default values. + return (versionedConfig, false); + } + + /// @notice Returns the active and candidate configuration for a given plugin key. + /// @param donId The unique key for the DON that the configuration applies to. + /// @return activeConfig The active configuration. + /// @return candidateConfig The candidate configuration. + function getAllConfigs( + uint32 donId, + Internal.OCRPluginType pluginType + ) external view returns (VersionedConfig memory activeConfig, VersionedConfig memory candidateConfig) { + VersionedConfig memory storedActiveConfig = s_configs[donId][pluginType][_getActiveIndex()]; + if (storedActiveConfig.configDigest != ZERO_DIGEST) { + activeConfig = storedActiveConfig; + } + + VersionedConfig memory storedCandidateConfig = s_configs[donId][pluginType][_getCandidateIndex()]; + if (storedCandidateConfig.configDigest != ZERO_DIGEST) { + candidateConfig = storedCandidateConfig; + } + + return (activeConfig, candidateConfig); + } + + // ================================================================ + // │ State transitions │ + // ================================================================ + + /// @notice Sets a new config as the candidate config. Does not influence the active config. + /// @param donId The key of the plugin to set the config for. + /// @return newConfigDigest The digest of the new config. + function setCandidate( + uint32 donId, + Internal.OCRPluginType pluginType, + OCR3Config calldata config, + bytes32 digestToOverwrite + ) external returns (bytes32 newConfigDigest) { + _onlySelfCall(); + _validateConfig(config); + + bytes32 existingDigest = getCandidateDigest(donId, pluginType); + + if (existingDigest != digestToOverwrite) { + revert ConfigDigestMismatch(existingDigest, digestToOverwrite); + } + + // are we going to overwrite a config? If so, emit an event. + if (existingDigest != ZERO_DIGEST) { + emit CandidateConfigRevoked(digestToOverwrite); + } + + uint32 newVersion = ++s_currentVersion; + newConfigDigest = _calculateConfigDigest(donId, pluginType, abi.encode(config), newVersion); + + VersionedConfig storage existingConfig = s_configs[donId][pluginType][_getCandidateIndex()]; + existingConfig.configDigest = newConfigDigest; + existingConfig.version = newVersion; + existingConfig.config = config; + + emit ConfigSet(newConfigDigest, newVersion, config); + + return newConfigDigest; + } + + /// @notice Revokes a specific config by digest. + /// @param donId The key of the plugin to revoke the config for. + /// @param configDigest The digest of the config to revoke. This is done to prevent accidental revokes. + function revokeCandidate(uint32 donId, Internal.OCRPluginType pluginType, bytes32 configDigest) external { + _onlySelfCall(); + + if (configDigest == ZERO_DIGEST) { + revert RevokingZeroDigestNotAllowed(); + } + + uint256 candidateConfigIndex = _getCandidateIndex(); + if (s_configs[donId][pluginType][candidateConfigIndex].configDigest != configDigest) { + revert ConfigDigestMismatch(s_configs[donId][pluginType][candidateConfigIndex].configDigest, configDigest); + } + + emit CandidateConfigRevoked(configDigest); + // Delete only the digest, as that's what's used to determine if a config is active. This means the actual + // config stays in storage which should significantly reduce the gas cost of overwriting that storage space in + // the future. + delete s_configs[donId][pluginType][candidateConfigIndex].configDigest; + } + + /// @notice Promotes the candidate config to the active config and revokes the active config. + /// @param donId The key of the plugin to promote the config for. + /// @param digestToPromote The digest of the config to promote. + function promoteCandidateAndRevokeActive( + uint32 donId, + Internal.OCRPluginType pluginType, + bytes32 digestToPromote, + bytes32 digestToRevoke + ) external { + _onlySelfCall(); + + if (digestToPromote == ZERO_DIGEST && digestToRevoke == ZERO_DIGEST) { + revert NoOpStateTransitionNotAllowed(); + } + + uint256 candidateConfigIndex = _getCandidateIndex(); + if (s_configs[donId][pluginType][candidateConfigIndex].configDigest != digestToPromote) { + revert ConfigDigestMismatch(s_configs[donId][pluginType][candidateConfigIndex].configDigest, digestToPromote); + } + + VersionedConfig storage activeConfig = s_configs[donId][pluginType][_getActiveIndex()]; + if (activeConfig.configDigest != digestToRevoke) { + revert ConfigDigestMismatch(activeConfig.configDigest, digestToRevoke); + } + + delete activeConfig.configDigest; + + s_activeConfigIndex ^= 1; + if (digestToRevoke != ZERO_DIGEST) { + emit ActiveConfigRevoked(digestToRevoke); + } + emit ConfigPromoted(digestToPromote); + } + + /// @notice Calculates the config digest for a given plugin key, static config, and version. + /// @param donId The key of the plugin to calculate the digest for. + /// @param staticConfig The static part of the config. + /// @param version The version of the config. + /// @return The calculated config digest. + function _calculateConfigDigest( + uint32 donId, + Internal.OCRPluginType pluginType, + bytes memory staticConfig, + uint32 version + ) internal view returns (bytes32) { + return bytes32( + (PREFIX & PREFIX_MASK) + | ( + uint256( + keccak256( + bytes.concat( + abi.encode(bytes32("EVM"), block.chainid, address(this), donId, pluginType, version), staticConfig + ) + ) + ) & ~PREFIX_MASK + ) + ); + } + + function _getActiveIndex() private view returns (uint32) { + return s_activeConfigIndex; + } + + function _getCandidateIndex() private view returns (uint32) { + return s_activeConfigIndex ^ 1; + } + + // ================================================================ + // │ Validation │ + // ================================================================ + + 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(); + } + if (cfg.offrampAddress.length == 0 || keccak256(cfg.offrampAddress) == EMPTY_ENCODED_ADDRESS_HASH) { + revert OfframpAddressCannotBeZero(); + } + if (cfg.rmnHomeAddress.length == 0 || keccak256(cfg.rmnHomeAddress) == EMPTY_ENCODED_ADDRESS_HASH) { + revert RMNHomeAddressCannotBeZero(); + } + if (!s_remoteChainSelectors.contains(cfg.chainSelector)) revert ChainSelectorNotFound(cfg.chainSelector); + + // fChain cannot exceed FRoleDON, since it is a subcommittee in the larger DON + uint256 FRoleDON = cfg.FRoleDON; + uint256 fChain = s_chainConfigurations[cfg.chainSelector].fChain; + // fChain > 0 is enforced in applyChainConfigUpdates, and the presence of a chain config is checked above + // FRoleDON != 0 because FRoleDON >= fChain is enforced here + if (fChain > FRoleDON) { + revert FChainTooHigh(fChain, FRoleDON); + } + + // len(nodes) >= 3 * FRoleDON + 1 + // len(nodes) == numberOfSigners + uint256 numberOfNodes = cfg.nodes.length; + if (numberOfNodes > MAX_NUM_ORACLES) revert TooManySigners(); + if (numberOfNodes <= 3 * FRoleDON) revert FTooHigh(); + + uint256 nonZeroTransmitters = 0; + bytes32[] memory p2pIds = new bytes32[](numberOfNodes); + for (uint256 i = 0; i < numberOfNodes; ++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, + if (node.transmitterKey.length != 0) { + nonZeroTransmitters++; + } + + // Signer key and p2pIds must always be present + if (node.signerKey.length == 0 || node.p2pId == bytes32(0)) { + revert InvalidNode(node); + } + + p2pIds[i] = node.p2pId; + } + + // We check for chain config presence above, so fChain here must be non-zero. fChain <= FRoleDON due to the checks above. + // There can be less transmitters than signers - so they can be set to zero (which indicates that a node is a signer, but not a transmitter). + uint256 minTransmittersLength = 3 * fChain + 1; + if (nonZeroTransmitters < minTransmittersLength) { + revert NotEnoughTransmitters(nonZeroTransmitters, minTransmittersLength); + } + + // Check that the readers are in the capabilities registry. + _ensureInRegistry(p2pIds); + } + + function _onlySelfCall() internal view { + if (msg.sender != address(this)) { + revert CanOnlySelfCall(); + } + } + + // ================================================================ + // │ Chain Configuration │ + // ================================================================ + + /// @notice Returns the total number of chains configured. + /// @return The total number of chains configured. + function getNumChainConfigurations() external view returns (uint256) { + return s_remoteChainSelectors.length(); + } + + /// @notice Returns all the chain configurations. + /// @param pageIndex The page index. + /// @param pageSize The page size. + /// @return paginatedChainConfigs chain configurations. + function getAllChainConfigs(uint256 pageIndex, uint256 pageSize) external view returns (ChainConfigArgs[] memory) { + uint256 numberOfChains = s_remoteChainSelectors.length(); + uint256 startIndex = pageIndex * pageSize; + + if (pageSize == 0 || startIndex >= numberOfChains) { + return new ChainConfigArgs[](0); // Return an empty array if pageSize is 0 or pageIndex is out of bounds + } + + uint256 endIndex = startIndex + pageSize; + if (endIndex > numberOfChains) { + endIndex = numberOfChains; + } + + ChainConfigArgs[] memory paginatedChainConfigs = new ChainConfigArgs[](endIndex - startIndex); + + uint256[] memory chainSelectors = s_remoteChainSelectors.values(); + for (uint256 i = startIndex; i < endIndex; ++i) { + uint64 chainSelector = uint64(chainSelectors[i]); + paginatedChainConfigs[i - startIndex] = + ChainConfigArgs({chainSelector: chainSelector, chainConfig: s_chainConfigurations[chainSelector]}); + } + + return paginatedChainConfigs; + } + + /// @notice Sets and/or removes chain configurations. + /// Does not validate that fChain <= FRoleDON and relies on OCR3Configs to be changed in case fChain becomes larger than the FRoleDON value. + /// @param chainSelectorRemoves The chain configurations to remove. + /// @param chainConfigAdds The chain configurations to add. + function applyChainConfigUpdates( + uint64[] calldata chainSelectorRemoves, + ChainConfigArgs[] calldata chainConfigAdds + ) external onlyOwner { + // Process removals first. + for (uint256 i = 0; i < chainSelectorRemoves.length; ++i) { + // check if the chain selector is in s_remoteChainSelectors first. + if (!s_remoteChainSelectors.contains(chainSelectorRemoves[i])) { + revert ChainSelectorNotFound(chainSelectorRemoves[i]); + } + + delete s_chainConfigurations[chainSelectorRemoves[i]]; + s_remoteChainSelectors.remove(chainSelectorRemoves[i]); + + emit ChainConfigRemoved(chainSelectorRemoves[i]); + } + + // Process additions next. + for (uint256 i = 0; i < chainConfigAdds.length; ++i) { + ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; + uint64 chainSelector = chainConfigAdds[i].chainSelector; + + // Verify that the provided readers are present in the capabilities registry. + _ensureInRegistry(chainConfig.readers); + + // Verify that fChain is positive. + if (chainConfig.fChain == 0) { + revert FChainMustBePositive(); + } + + s_chainConfigurations[chainSelector] = chainConfig; + s_remoteChainSelectors.add(chainSelector); + + emit ChainConfigSet(chainSelector, chainConfig); + } + } + + /// @notice Helper function to ensure that a node is in the capabilities registry. + /// @param p2pIds The P2P IDs of the node to check. + function _ensureInRegistry(bytes32[] memory p2pIds) internal view { + for (uint256 i = 0; i < p2pIds.length; ++i) { + // TODO add a method that does the validation in the ICapabilitiesRegistry contract + if (ICapabilitiesRegistry(i_capabilitiesRegistry).getNode(p2pIds[i]).p2pId == bytes32("")) { + revert NodeNotInRegistry(p2pIds[i]); + } + } + } +} diff --git a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol deleted file mode 100644 index d09dbeb65a..0000000000 --- a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.4; - -import {CCIPConfigTypes} from "../libraries/CCIPConfigTypes.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); -} 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 e5d77b02e5..0000000000 --- a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.4; - -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. - bytes rmnHomeAddress; // The home chain RMN home 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/capability/interfaces/ICapabilitiesRegistry.sol b/contracts/src/v0.8/ccip/interfaces/ICapabilitiesRegistry.sol similarity index 98% rename from contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol rename to contracts/src/v0.8/ccip/interfaces/ICapabilitiesRegistry.sol index 621c3686cf..dac7317e41 100644 --- a/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol +++ b/contracts/src/v0.8/ccip/interfaces/ICapabilitiesRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.24; +pragma solidity ^0.8.0; interface ICapabilitiesRegistry { struct NodeInfo { diff --git a/contracts/src/v0.8/ccip/interfaces/encodingutils/ICCIPEncodingUtils.sol b/contracts/src/v0.8/ccip/interfaces/encodingutils/ICCIPEncodingUtils.sol new file mode 100644 index 0000000000..026c5fa50b --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/encodingutils/ICCIPEncodingUtils.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {CCIPHome} from "../../capability/CCIPHome.sol"; +import {RMNRemote} from "../../rmn/RMNRemote.sol"; + +/// @dev this file exposes structs that are otherwise internal to the CCIP codebase +/// doing this allows those structs to be encoded and decoded with type safety in offchain code +/// and tests because generated wrappers are available +interface ICCIPEncodingUtils { + /// @dev the RMN Report struct is used in integration / E2E tests + function exposeRmnReport(bytes32 rmnReportVersion, RMNRemote.Report memory rmnReport) external; + + /// @dev the OCR3Config Config struct is used in integration / E2E tests + function exposeOCR3Config(CCIPHome.OCR3Config[] calldata config) external view returns (bytes memory); +} diff --git a/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol b/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol index 324fd484a7..d9c4df0a6c 100644 --- a/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol +++ b/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol @@ -12,7 +12,7 @@ import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/tok contract BurnWithFromMintTokenPoolAndProxy is ITypeAndVersion, LegacyPoolWrapper { using SafeERC20 for IBurnMintERC20; - string public constant override typeAndVersion = "BurnFromMintTokenPoolAndProxy 1.5.0"; + string public constant override typeAndVersion = "BurnWithFromMintTokenPoolAndProxy 1.5.0"; constructor( IBurnMintERC20 token, diff --git a/contracts/src/v0.8/ccip/rmn/RMNHome.sol b/contracts/src/v0.8/ccip/rmn/RMNHome.sol index ec479bf663..d13385aed8 100644 --- a/contracts/src/v0.8/ccip/rmn/RMNHome.sol +++ b/contracts/src/v0.8/ccip/rmn/RMNHome.sol @@ -7,146 +7,384 @@ import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; /// @notice Stores the home configuration for RMN, that is referenced by CCIP oracles, RMN nodes, and the RMNRemote /// contracts. +/// @dev This contract is a state machine with the following states: +/// - Init: The initial state of the contract, no config has been set, or all configs have been revoked. +/// [0, 0] +/// +/// - Candidate: A new config has been set, but it has not been promoted yet, or all active configs have been revoked. +/// [0, 1] +/// +/// - Active: A non-zero config has been promoted and is active, there is no candidate configured. +/// [1, 0] +/// +/// - ActiveAndCandidate: A non-zero config has been promoted and is active, and a new config has been set as candidate. +/// [1, 1] +/// +/// The following state transitions are allowed: +/// - Init -> Candidate: setCandidate() +/// - Candidate -> Active: promoteCandidateAndRevokeActive() +/// - Candidate -> Candidate: setCandidate() +/// - Candidate -> Init: revokeCandidate() +/// - Active -> ActiveAndCandidate: setCandidate() +/// - Active -> Init: promoteCandidateAndRevokeActive() +/// - ActiveAndCandidate -> Active: promoteCandidateAndRevokeActive() +/// - ActiveAndCandidate -> Active: revokeCandidate() +/// - ActiveAndCandidate -> ActiveAndCandidate: setCandidate() +/// +/// This means the following calls are not allowed at the following states: +/// - Init: promoteCandidateAndRevokeActive(), as there is no config to promote. +/// - Init: revokeCandidate(), as there is no config to revoke +/// - Active: revokeCandidate(), as there is no candidate to revoke +/// Note that we explicitly do allow promoteCandidateAndRevokeActive() to be called when there is an active config but +/// no candidate config. This is the only way to remove the active config. The alternative would be to set some unusable +/// config as candidate and promote that, but fully clearing it is cleaner. +/// +/// ┌─────────────┐ setCandidate ┌─────────────┐ +/// │ ├───────────────────►│ │ setCandidate +/// │ Init │ revokeCandidate │ Candidate │◄───────────┐ +/// │ [0,0] │◄───────────────────┤ [0,1] │────────────┘ +/// │ │ ┌─────────────────┤ │ +/// └─────────────┘ │ promote- └─────────────┘ +/// ▲ │ Candidate +/// promote- │ │ +/// Candidate │ │ +/// │ │ +/// ┌──────────┴──┐ │ promote- ┌─────────────┐ +/// │ │◄─┘ Candidate OR │ Active & │ setCandidate +/// │ Active │ revokeCandidate │ Candidate │◄───────────┐ +/// │ [1,0] │◄───────────────────┤ [1,1] │────────────┘ +/// │ ├───────────────────►│ │ +/// └─────────────┘ setSecondary └─────────────┘ +/// contract RMNHome is OwnerIsCreator, ITypeAndVersion { + event ConfigSet(bytes32 indexed configDigest, uint32 version, StaticConfig staticConfig, DynamicConfig dynamicConfig); + event ActiveConfigRevoked(bytes32 indexed configDigest); + event CandidateConfigRevoked(bytes32 indexed configDigest); + event DynamicConfigSet(bytes32 indexed configDigest, DynamicConfig dynamicConfig); + event ConfigPromoted(bytes32 indexed configDigest); + + error OutOfBoundsNodesLength(); error DuplicatePeerId(); error DuplicateOffchainPublicKey(); - error OutOfOrderSourceChains(); - error OutOfOrderObserverNodeIndices(); + error DuplicateSourceChain(); error OutOfBoundsObserverNodeIndex(); error MinObserversTooHigh(); - - event ConfigSet(bytes32 configDigest, VersionedConfig versionedConfig); - event ConfigRevoked(bytes32 configDigest); + error ConfigDigestMismatch(bytes32 expectedConfigDigest, bytes32 gotConfigDigest); + error DigestNotFound(bytes32 configDigest); + error RevokingZeroDigestNotAllowed(); + error NoOpStateTransitionNotAllowed(); struct Node { - string peerId; // used for p2p communication, base58 encoded - bytes32 offchainPublicKey; // observations are signed with this public key, and are only verified offchain + bytes32 peerId; // Used for p2p communication. + bytes32 offchainPublicKey; // Observations are signed with this public key, and are only verified offchain. } struct SourceChain { - uint64 chainSelector; - uint64[] observerNodeIndices; // indices into Config.nodes, strictly increasing - uint64 minObservers; // required to agree on an observation for this source chain + uint64 chainSelector; // ─────╮ The Source chain selector. + uint64 minObservers; // ──────╯ Required number of observers to agree on an observation for this source chain. + // ObserverNodesBitmap & (1< 0 && !(newConfig.sourceChains[i - 1].chainSelector < newConfig.sourceChains[i].chainSelector)) { - revert OutOfOrderSourceChains(); - } + /// @notice Used for encoding the config digest prefix, unique per Home contract implementation. + uint256 private constant PREFIX = 0x000b << (256 - 16); // 0x000b00..00 + /// @notice Used for encoding the config digest prefix + uint256 private constant PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..00 + /// @notice The max number of configs that can be active at the same time. + uint256 private constant MAX_CONCURRENT_CONFIGS = 2; + /// @notice Helper to identify the zero config digest with less casting. + bytes32 private constant ZERO_DIGEST = bytes32(uint256(0)); + // @notice To ensure that observerNodesBitmap can be bit-encoded into a uint256. + uint256 private constant MAX_NODES = 256; - // all observerNodeIndices are valid - for (uint256 j = 0; j < newConfig.sourceChains[i].observerNodeIndices.length; ++j) { - if ( - j > 0 - && !(newConfig.sourceChains[i].observerNodeIndices[j - 1] < newConfig.sourceChains[i].observerNodeIndices[j]) - ) { - revert OutOfOrderObserverNodeIndices(); - } - if (!(newConfig.sourceChains[i].observerNodeIndices[j] < newConfig.nodes.length)) { - revert OutOfBoundsObserverNodeIndex(); - } - } + /// @notice This array holds the configs. + /// @dev Value i in this array is valid iff s_configs[i].configDigest != 0. + VersionedConfig[MAX_CONCURRENT_CONFIGS] private s_configs; - // minObservers are tenable - if (!(newConfig.sourceChains[i].minObservers <= newConfig.sourceChains[i].observerNodeIndices.length)) { - revert MinObserversTooHigh(); - } - } - } + /// @notice The latest version set, incremented by one for each new config. + uint32 private s_currentVersion = 0; + /// @notice The index of the active config. Used to determine which config is active. Adding the configs to a list + /// with two items and using this index to determine which one is active is a gas efficient way to handle this. Having + /// a set place for the active config would mean we have to copy the candidate config to the active config when it is + /// promoted, which would be more expensive. This index allows us to flip the configs around using `XOR 1`, which + /// flips 0 to 1 and 1 to 0. + uint32 private s_activeConfigIndex = 0; + + // ================================================================ + // │ Getters │ + // ================================================================ + + /// @notice Returns the current active and candidate config digests. + /// @dev Can be bytes32(0) if no config has been set yet or it has been revoked. + /// @return activeConfigDigest The digest of the active config. + /// @return candidateConfigDigest The digest of the candidate config. + function getConfigDigests() external view returns (bytes32 activeConfigDigest, bytes32 candidateConfigDigest) { + return (s_configs[_getActiveIndex()].configDigest, s_configs[_getCandidateIndex()].configDigest); + } + + /// @notice Returns the active config digest + function getActiveDigest() external view returns (bytes32) { + return s_configs[_getActiveIndex()].configDigest; + } - uint256 oldConfigIndex = s_latestConfigIndex; - uint32 oldConfigCount = s_configCounts[oldConfigIndex]; - uint256 newConfigIndex = (oldConfigIndex + 1) % CONFIG_RING_BUFFER_SIZE; + /// @notice Returns the candidate config digest + function getCandidateDigest() public view returns (bytes32) { + return s_configs[_getCandidateIndex()].configDigest; + } - for (uint256 i = 0; i < CONFIG_RING_BUFFER_SIZE; ++i) { - if ((i == newConfigIndex || revokePastConfigs) && s_configCounts[i] > 0) { - emit ConfigRevoked(_configDigest(VersionedConfig({version: s_configCounts[i], config: s_configs[i]}))); - delete s_configCounts[i]; + /// @notice The offchain code can use this to fetch an old config which might still be in use by some remotes. Use + /// in case one of the configs is too large to be returnable by one of the other getters. + /// @param configDigest The digest of the config to fetch. + /// @return versionedConfig The config and its version. + /// @return ok True if the config was found, false otherwise. + function getConfig(bytes32 configDigest) external view returns (VersionedConfig memory versionedConfig, bool ok) { + for (uint256 i = 0; i < MAX_CONCURRENT_CONFIGS; ++i) { + // We never want to return true for a zero digest, even if the caller is asking for it, as this can expose old + // config state that is invalid. + if (s_configs[i].configDigest == configDigest && configDigest != ZERO_DIGEST) { + return (s_configs[i], true); } } - - uint32 newConfigCount = oldConfigCount + 1; - VersionedConfig memory newVersionedConfig = VersionedConfig({version: newConfigCount, config: newConfig}); - bytes32 newConfigDigest = _configDigest(newVersionedConfig); - s_configs[newConfigIndex] = newConfig; - s_configCounts[newConfigIndex] = newConfigCount; - s_latestConfigIndex = newConfigIndex; - s_latestConfigDigest = newConfigDigest; - emit ConfigSet(newConfigDigest, newVersionedConfig); + return (versionedConfig, false); } - /// @return configDigest will be zero in case no config has been set - function getLatestConfigDigestAndVersionedConfig() + function getAllConfigs() external view - returns (bytes32 configDigest, VersionedConfig memory) + returns (VersionedConfig memory activeConfig, VersionedConfig memory candidateConfig) { - return ( - s_latestConfigDigest, - VersionedConfig({version: s_configCounts[s_latestConfigIndex], config: s_configs[s_latestConfigIndex]}) + VersionedConfig memory storedActiveConfig = s_configs[_getActiveIndex()]; + if (storedActiveConfig.configDigest != ZERO_DIGEST) { + activeConfig = storedActiveConfig; + } + + VersionedConfig memory storedCandidateConfig = s_configs[_getCandidateIndex()]; + if (storedCandidateConfig.configDigest != ZERO_DIGEST) { + candidateConfig = storedCandidateConfig; + } + + return (activeConfig, candidateConfig); + } + + // ================================================================ + // │ State transitions │ + // ================================================================ + + /// @notice Sets a new config as the candidate config. Does not influence the active config. + /// @param staticConfig The static part of the config. + /// @param dynamicConfig The dynamic part of the config. + /// @param digestToOverwrite The digest of the config to overwrite, or ZERO_DIGEST if no config is to be overwritten. + /// This is done to prevent accidental overwrites. + /// @return newConfigDigest The digest of the new config. + function setCandidate( + StaticConfig calldata staticConfig, + DynamicConfig calldata dynamicConfig, + bytes32 digestToOverwrite + ) external onlyOwner returns (bytes32 newConfigDigest) { + _validateStaticAndDynamicConfig(staticConfig, dynamicConfig); + + bytes32 existingDigest = getCandidateDigest(); + + if (existingDigest != digestToOverwrite) { + revert ConfigDigestMismatch(existingDigest, digestToOverwrite); + } + + // are we going to overwrite a config? If so, emit an event. + if (existingDigest != ZERO_DIGEST) { + emit CandidateConfigRevoked(digestToOverwrite); + } + + uint32 newVersion = ++s_currentVersion; + newConfigDigest = _calculateConfigDigest(abi.encode(staticConfig), newVersion); + + VersionedConfig storage existingConfig = s_configs[_getCandidateIndex()]; + existingConfig.configDigest = newConfigDigest; + existingConfig.version = newVersion; + existingConfig.staticConfig = staticConfig; + existingConfig.dynamicConfig = dynamicConfig; + + emit ConfigSet(newConfigDigest, newVersion, staticConfig, dynamicConfig); + + return newConfigDigest; + } + + /// @notice Revokes a specific config by digest. This is used when the candidate config turns out to be incorrect to + /// remove it without it ever having to be promoted. It's also possible to revoke the candidate config by setting a + /// newer candidate config using `setCandidate`. + /// @param configDigest The digest of the config to revoke. This is done to prevent accidental revokes. + function revokeCandidate(bytes32 configDigest) external onlyOwner { + if (configDigest == ZERO_DIGEST) { + revert RevokingZeroDigestNotAllowed(); + } + + uint256 candidateConfigIndex = _getCandidateIndex(); + if (s_configs[candidateConfigIndex].configDigest != configDigest) { + revert ConfigDigestMismatch(s_configs[candidateConfigIndex].configDigest, configDigest); + } + + emit CandidateConfigRevoked(configDigest); + // Delete only the digest, as that's what's used to determine if a config is active. This means the actual + // config stays in storage which should significantly reduce the gas cost of overwriting that storage space in + // the future. + delete s_configs[candidateConfigIndex].configDigest; + } + + /// @notice Promotes the candidate config to the active config and revokes the active config. + /// @param digestToPromote The digest of the config to promote. + /// @param digestToRevoke The digest of the config to revoke. + /// @dev No config is changed in storage, the only storage changes that happen are + /// - The activeConfigIndex is flipped. + /// - The digest of the old active config is deleted. + function promoteCandidateAndRevokeActive(bytes32 digestToPromote, bytes32 digestToRevoke) external onlyOwner { + if (digestToPromote == ZERO_DIGEST && digestToRevoke == ZERO_DIGEST) { + revert NoOpStateTransitionNotAllowed(); + } + + uint256 candidateConfigIndex = _getCandidateIndex(); + if (s_configs[candidateConfigIndex].configDigest != digestToPromote) { + revert ConfigDigestMismatch(s_configs[candidateConfigIndex].configDigest, digestToPromote); + } + + VersionedConfig storage activeConfig = s_configs[_getActiveIndex()]; + if (activeConfig.configDigest != digestToRevoke) { + revert ConfigDigestMismatch(activeConfig.configDigest, digestToRevoke); + } + + delete activeConfig.configDigest; + + s_activeConfigIndex ^= 1; + if (digestToRevoke != ZERO_DIGEST) { + emit ActiveConfigRevoked(digestToRevoke); + } + emit ConfigPromoted(digestToPromote); + } + + /// @notice Sets the dynamic config for a specific config. + /// @param newDynamicConfig The new dynamic config. + /// @param currentDigest The digest of the config to update. + /// @dev This does not update the config digest as only the static config is part of the digest. + function setDynamicConfig(DynamicConfig calldata newDynamicConfig, bytes32 currentDigest) external onlyOwner { + for (uint256 i = 0; i < MAX_CONCURRENT_CONFIGS; ++i) { + if (s_configs[i].configDigest == currentDigest && currentDigest != ZERO_DIGEST) { + _validateDynamicConfig(newDynamicConfig, s_configs[i].staticConfig.nodes.length); + // Since the static config doesn't change we don't have to update the digest or version. + s_configs[i].dynamicConfig = newDynamicConfig; + + emit DynamicConfigSet(currentDigest, newDynamicConfig); + return; + } + } + + revert DigestNotFound(currentDigest); + } + + /// @notice Calculates the config digest for a given plugin key, static config, and version. + /// @param staticConfig The static part of the config. + /// @param version The version of the config. + /// @return The calculated config digest. + function _calculateConfigDigest(bytes memory staticConfig, uint32 version) internal view returns (bytes32) { + return bytes32( + (PREFIX & PREFIX_MASK) + | ( + uint256( + keccak256(bytes.concat(abi.encode(bytes32("EVM"), block.chainid, address(this), version), staticConfig)) + ) & ~PREFIX_MASK + ) ); } - /// @notice The offchain code can use this to fetch an old config which might still be in use by some remotes - /// @dev Only to be called by offchain code, efficiency is not a concern - function getConfig(bytes32 configDigest) external view returns (VersionedConfig memory versionedConfig, bool ok) { - for (uint256 i = 0; i < CONFIG_RING_BUFFER_SIZE; ++i) { - if (s_configCounts[i] == 0) { - // unset config - continue; + function _getActiveIndex() private view returns (uint32) { + return s_activeConfigIndex; + } + + function _getCandidateIndex() private view returns (uint32) { + return s_activeConfigIndex ^ 1; + } + + // ================================================================ + // │ Validation │ + // ================================================================ + + /// @notice Validates the static and dynamic config. Reverts when the config is invalid. + /// @param staticConfig The static part of the config. + /// @param dynamicConfig The dynamic part of the config. + function _validateStaticAndDynamicConfig( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig + ) internal pure { + // Ensure that observerNodesBitmap can be bit-encoded into a uint256. + if (staticConfig.nodes.length > MAX_NODES) { + revert OutOfBoundsNodesLength(); + } + + // Ensure no peerId or offchainPublicKey is duplicated. + for (uint256 i = 0; i < staticConfig.nodes.length; ++i) { + for (uint256 j = i + 1; j < staticConfig.nodes.length; ++j) { + if (staticConfig.nodes[i].peerId == staticConfig.nodes[j].peerId) { + revert DuplicatePeerId(); + } + if (staticConfig.nodes[i].offchainPublicKey == staticConfig.nodes[j].offchainPublicKey) { + revert DuplicateOffchainPublicKey(); + } + } + } + + _validateDynamicConfig(dynamicConfig, staticConfig.nodes.length); + } + + /// @notice Validates the dynamic config. Reverts when the config is invalid. + /// @param dynamicConfig The dynamic part of the config. + /// @param numberOfNodes The number of nodes in the static config. + function _validateDynamicConfig(DynamicConfig memory dynamicConfig, uint256 numberOfNodes) internal pure { + uint256 numberOfSourceChains = dynamicConfig.sourceChains.length; + for (uint256 i = 0; i < numberOfSourceChains; ++i) { + SourceChain memory currentSourceChain = dynamicConfig.sourceChains[i]; + // Ensure the source chain is unique. + for (uint256 j = i + 1; j < numberOfSourceChains; ++j) { + if (currentSourceChain.chainSelector == dynamicConfig.sourceChains[j].chainSelector) { + revert DuplicateSourceChain(); + } } - VersionedConfig memory vc = VersionedConfig({version: s_configCounts[i], config: s_configs[i]}); - if (_configDigest(vc) == configDigest) { - versionedConfig = vc; - ok = true; - break; + + // all observer node indices are valid + uint256 bitmap = currentSourceChain.observerNodesBitmap; + // Check if there are any bits set for indexes outside of the expected range. + if (bitmap & (type(uint256).max >> (256 - numberOfNodes)) != bitmap) { + revert OutOfBoundsObserverNodeIndex(); + } + + uint256 observersCount = 0; + for (; bitmap != 0; ++observersCount) { + bitmap &= bitmap - 1; + } + + // minObservers are tenable + if (currentSourceChain.minObservers > observersCount) { + revert MinObserversTooHigh(); } } } diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol deleted file mode 100644 index 0f95d8b42c..0000000000 --- a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol +++ /dev/null @@ -1,1532 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.24; - -import {CCIPConfig} from "../../capability/CCIPConfig.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 {Test} from "forge-std/Test.sol"; - -contract CCIPConfigSetup is Test { - address public constant OWNER = 0x82ae2B4F57CA5C1CBF8f744ADbD3697aD1a35AFe; - address public constant CAPABILITIES_REGISTRY = 0x272aF4BF7FBFc4944Ed59F914Cd864DfD912D55e; - - CCIPConfigHelper public s_ccipCC; - - function setUp() public { - changePrank(OWNER); - s_ccipCC = new CCIPConfigHelper(CAPABILITIES_REGISTRY); - } - - function _makeBytes32Array(uint256 length, uint256 seed) internal pure returns (bytes32[] memory arr) { - arr = new bytes32[](length); - for (uint256 i = 0; i < length; i++) { - arr[i] = keccak256(abi.encode(i, 1, seed)); - } - return arr; - } - - function _makeBytesArray(uint256 length, uint256 seed) internal pure returns (bytes[] memory arr) { - arr = new bytes[](length); - for (uint256 i = 0; i < length; i++) { - arr[i] = abi.encode(keccak256(abi.encode(i, 1, seed))); - } - return arr; - } - - function _subset(bytes32[] memory arr, uint256 start, uint256 end) internal pure returns (bytes32[] memory) { - bytes32[] memory subset = new bytes32[](end - start); - for (uint256 i = start; i < end; i++) { - subset[i - start] = arr[i]; - } - return subset; - } - - function _addChainConfig(uint256 numNodes) internal returns (CCIPConfigTypes.OCR3Node[] memory nodes) { - return _addChainConfig(numNodes, 1); - } - - function _addChainConfig(uint256 numNodes, uint8 fChain) internal returns (CCIPConfigTypes.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); - - for (uint256 i = 0; i < numNodes; i++) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); - - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, p2pIds[i]), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 1, - signer: bytes32(signers[i]), - p2pId: p2pIds[i], - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - } - // Add chain selector for chain 1. - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: p2pIds, fChain: fChain, config: bytes("config1")}) - }); - - vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); - s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - - return nodes; - } - - function _constructNodesArray( - bytes32[] memory p2pIds, - bytes[] memory signers, - bytes[] memory transmitters - ) internal pure returns (CCIPConfigTypes.OCR3Node[] memory nodes) { - nodes = new CCIPConfigTypes.OCR3Node[](p2pIds.length); - - for (uint256 i = 0; i < p2pIds.length; i++) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); - } - - return nodes; - } - - function _assertOCR3ConfigWithMetaEqual( - CCIPConfigTypes.OCR3ConfigWithMeta[] memory a, - CCIPConfigTypes.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].configDigest, b[i].configDigest, "configDigest must match"); - } - } - - function _assertOCR3ConfigEqual( - CCIPConfigTypes.OCR3Config memory a, - CCIPConfigTypes.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"); - assertEq(a.offchainConfigVersion, b.offchainConfigVersion, "offchainConfigVersion must match"); - assertEq(a.offrampAddress, b.offrampAddress, "offrampAddress must match"); - assertEq(a.rmnHomeAddress, b.rmnHomeAddress, "rmnHomeAddress must match"); - assertEq(a.nodes.length, b.nodes.length, "nodes length must match"); - assertEq(a.offchainConfig, b.offchainConfig, "offchainConfig must match"); - - for (uint256 i = 0; i < a.nodes.length; ++i) { - assertEq(a.nodes[i].p2pId, b.nodes[i].p2pId, "p2pId must match"); - assertEq(a.nodes[i].signerKey, b.nodes[i].signerKey, "signerKey must match"); - assertEq(a.nodes[i].transmitterKey, b.nodes[i].transmitterKey, "transmitterKey must match"); - } - } - - function test_getCapabilityConfiguration_Success() public view { - bytes memory capConfig = s_ccipCC.getCapabilityConfiguration(42 /* doesn't matter, not used */ ); - assertEq(capConfig.length, 0, "capability config length must be 0"); - } -} - -contract CCIPConfig_constructor is Test { - // Successes. - - function test_constructor_Success() public { - address capabilitiesRegistry = makeAddr("capabilitiesRegistry"); - CCIPConfigHelper ccipCC = new CCIPConfigHelper(capabilitiesRegistry); - assertEq(address(ccipCC.getCapabilityRegistry()), capabilitiesRegistry); - assertEq(ccipCC.typeAndVersion(), "CCIPConfig 1.6.0-dev"); - } - - // Reverts. - - function test_constructor_ZeroAddressNotAllowed_Revert() public { - vm.expectRevert(CCIPConfig.ZeroAddressNotAllowed.selector); - new CCIPConfigHelper(address(0)); - } -} - -contract CCIPConfig_chainConfig is CCIPConfigSetup { - // 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({ - chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) - }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) - }); - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 1, - signer: bytes32(uint256(1)), - p2pId: chainReaders[0], - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); - vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); - s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - - CCIPConfigTypes.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 { - bytes32[] memory chainReaders = new bytes32[](1); - chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); - adds[0] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) - }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) - }); - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 1, - signer: bytes32(uint256(1)), - p2pId: chainReaders[0], - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - - s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - - CCIPConfigTypes.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"); - - configs = s_ccipCC.getAllChainConfigs(0, 1); - assertEq(configs.length, 1, "chain configs length must be 1"); - assertEq(configs[0].chainSelector, 1, "chain selector must match"); - - configs = s_ccipCC.getAllChainConfigs(0, 10); - 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"); - - configs = s_ccipCC.getAllChainConfigs(1, 1); - assertEq(configs.length, 1, "chain configs length must be 1"); - - configs = s_ccipCC.getAllChainConfigs(1, 2); - assertEq(configs.length, 0, "chain configs length must be 0"); - } - - 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({ - chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) - }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) - }); - - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 1, - signer: bytes32(uint256(1)), - p2pId: chainReaders[0], - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - - vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); - vm.expectEmit(); - emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); - s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - - assertEq(s_ccipCC.getNumChainConfigurations(), 2, "total chain configs must be 2"); - - uint64[] memory removes = new uint64[](1); - removes[0] = uint64(1); - - vm.expectEmit(); - emit CCIPConfig.ChainConfigRemoved(1); - s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); - - assertEq(s_ccipCC.getNumChainConfigurations(), 1, "total chain configs must be 1"); - } - - // Reverts. - - function test_applyChainConfigUpdates_selectorNotFound_Reverts() public { - 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)); - } - - 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({ - chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) - }); - - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 0, - signer: bytes32(0), - p2pId: bytes32(uint256(0)), - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.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({ - chainSelector: 1, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) - }); - adds[1] = CCIPConfigTypes.ChainConfigInfo({ - chainSelector: 2, - chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain - }); - - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 1, - signer: bytes32(uint256(1)), - p2pId: chainReaders[0], - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - - vm.expectRevert(CCIPConfig.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); - - return CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: FRoleDON, - offchainConfigVersion: 30, - offchainConfig: bytes("offchainConfig") - }); - } - - function _getCorrectOCR3Config() internal returns (CCIPConfigTypes.OCR3Config memory) { - return _getCorrectOCR3Config(4, 1); - } - - // Successes. - - function test__validateConfig_Success() public { - s_ccipCC.validateConfig(_getCorrectOCR3Config()); - } - - function test__validateConfigLessTransmittersThanSigners_Success() public { - // fChain is 1, so there should be at least 4 transmitters. - CCIPConfigTypes.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); - - // Set fChain to 2 - _addChainConfig(4, 2); - - s_ccipCC.validateConfig(config); - } - - // Reverts. - - function test__validateConfig_ChainSelectorNotSet_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.chainSelector = 0; // invalid - - vm.expectRevert(CCIPConfig.ChainSelectorNotSet.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_OfframpAddressCannotBeZero_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.offrampAddress = ""; // invalid - - vm.expectRevert(CCIPConfig.OfframpAddressCannotBeZero.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.offrampAddress = abi.encode(address(0)); // invalid - - vm.expectRevert(CCIPConfig.OfframpAddressCannotBeZero.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_RMNHomeAddressCannotBeZero_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.rmnHomeAddress = ""; // invalid - - vm.expectRevert(CCIPConfig.RMNHomeAddressCannotBeZero.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.rmnHomeAddress = abi.encode(address(0)); // invalid - - vm.expectRevert(CCIPConfig.RMNHomeAddressCannotBeZero.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_ChainSelectorNotFound_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.chainSelector = 2; // not set - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.ChainSelectorNotFound.selector, 2)); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_NotEnoughTransmitters_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - uint256 numberOfTransmitters = 3; - - // 32 > 31 (max num oracles) - CCIPConfigTypes.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. - for (uint256 i = numberOfTransmitters; i < nodes.length; ++i) { - nodes[i].transmitterKey = bytes(""); - } - - config.nodes = nodes; - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, numberOfTransmitters, 4)); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.nodes[0].transmitterKey = bytes(""); - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, 3, 4)); - s_ccipCC.validateConfig(config); - - // Zero out remaining transmitters to verify error changes - for (uint256 i = 1; i < config.nodes.length; ++i) { - config.nodes[i].transmitterKey = bytes(""); - } - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.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); - - vm.expectRevert(CCIPConfig.TooManySigners.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_FChainTooHigh_Reverts() public { - CCIPConfigTypes.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)); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_FMustBePositive_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.FRoleDON = 0; // not positive - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.FChainTooHigh.selector, 1, 0)); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_FTooHigh_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.FRoleDON = 2; // too high - - vm.expectRevert(CCIPConfig.FTooHigh.selector); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_ZeroP2PId_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.nodes[1].p2pId = bytes32(0); - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidNode.selector, config.nodes[1])); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_ZeroSignerKey_Reverts() public { - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.nodes[2].signerKey = bytes(""); - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidNode.selector, config.nodes[2])); - s_ccipCC.validateConfig(config); - } - - function test__validateConfig_NodeNotInRegistry_Reverts() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - bytes32 nonExistentP2PId = keccak256("notInRegistry"); - nodes[0].p2pId = nonExistentP2PId; - - vm.mockCall( - CAPABILITIES_REGISTRY, - abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, nonExistentP2PId), - abi.encode( - ICapabilitiesRegistry.NodeInfo({ - nodeOperatorId: 0, - signer: bytes32(0), - p2pId: bytes32(uint256(0)), - hashedCapabilityIds: new bytes32[](0), - configCount: uint32(1), - workflowDONId: uint32(1), - capabilitiesDONIds: new uint256[](0) - }) - ) - ); - CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); - config.nodes = nodes; - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NodeNotInRegistry.selector, nonExistentP2PId)); - s_ccipCC.validateConfig(config); - } -} - -contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { - // 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)); - - configLen = 1; - state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Running)); - - configLen = 2; - state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Staging)); - } - - function test__validateConfigStateTransition_Success() public view { - s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Init, CCIPConfigTypes.ConfigState.Running); - - s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Running, CCIPConfigTypes.ConfigState.Staging); - - s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Staging, CCIPConfigTypes.ConfigState.Running); - } - - function test__computeConfigDigest_Success() public view { - // config digest must change upon: - // - ocr config change (e.g plugin type, chain selector, etc.) - // - don id change - // - config count change - 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); - for (uint256 i = 0; i < 4; ++i) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); - } - - CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("offchainConfig") - }); - uint32 donId = 1; - uint32 configCount = 1; - - bytes32 configDigest1 = s_ccipCC.computeConfigDigest(donId, configCount, config); - - donId = 2; - bytes32 configDigest2 = s_ccipCC.computeConfigDigest(donId, configCount, config); - - donId = 1; - configCount = 2; - bytes32 configDigest3 = s_ccipCC.computeConfigDigest(donId, configCount, config); - - configCount = 1; - config.pluginType = Internal.OCRPluginType.Execution; - bytes32 configDigest4 = s_ccipCC.computeConfigDigest(donId, configCount, config); - - assertNotEq(configDigest1, configDigest2, "config digests 1 and 2 must not match"); - assertNotEq(configDigest1, configDigest3, "config digests 1 and 3 must not match"); - assertNotEq(configDigest1, configDigest4, "config digests 1 and 4 must not match"); - - assertNotEq(configDigest2, configDigest3, "config digests 2 and 3 must not match"); - 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); - CCIPConfigTypes.OCR3Node[] memory nodes = new CCIPConfigTypes.OCR3Node[](4); - for (uint256 i = 0; i < 4; ++i) { - nodes[i] = CCIPConfigTypes.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); - } - - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](numCommitCfgs + numExecCfgs); - for (uint256 i = 0; i < numCommitCfgs; i++) { - cfgs[i] = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: abi.encode("commit", i) - }); - } - for (uint256 i = 0; i < numExecCfgs; i++) { - cfgs[numCommitCfgs + i] = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Execution, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: abi.encode("exec", numCommitCfgs + i) - }); - } - (CCIPConfigTypes.OCR3Config[] memory commitCfgs, CCIPConfigTypes.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 { - CCIPConfigTypes.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({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Init; - CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; - CCIPConfigTypes.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(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( - newConfigWithMeta[0].configDigest, - s_ccipCC.computeConfigDigest(donId, 1, newConfig[0]), - "config digest must match" - ); - - // This ensures that the test case is using correct inputs. - s_ccipCC.validateConfigTransition(currentConfig, newConfigWithMeta); - } - - function test__computeNewConfigWithMeta_RunningToStaging_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.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; - - CCIPConfigTypes.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( - uint8(newConfigWithMeta[0].config.pluginType), uint8(blueConfig.pluginType), "plugin type of blue must match" - ); - assertEq( - newConfigWithMeta[0].config.offchainConfig, blueConfig.offchainConfig, "offchain config of blue must match" - ); - assertEq( - newConfigWithMeta[0].configDigest, - s_ccipCC.computeConfigDigest(donId, 1, blueConfig), - "config digest of blue must match" - ); - - assertEq(newConfigWithMeta[1].configCount, uint64(2), "config count of green must be 2"); - assertEq( - uint8(newConfigWithMeta[1].config.pluginType), uint8(greenConfig.pluginType), "plugin type of green must match" - ); - assertEq( - newConfigWithMeta[1].config.offchainConfig, greenConfig.offchainConfig, "offchain config of green must match" - ); - assertEq( - newConfigWithMeta[1].configDigest, - s_ccipCC.computeConfigDigest(donId, 2, greenConfig), - "config digest of green must match" - ); - - // This ensures that the test case is using correct inputs. - s_ccipCC.validateConfigTransition(currentConfig, newConfigWithMeta); - } - - function test__computeNewConfigWithMeta_StagingToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); - newConfig[0] = greenConfig; - - CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Staging; - CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; - - CCIPConfigTypes.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(uint8(newConfigWithMeta[0].config.pluginType), uint8(greenConfig.pluginType), "plugin type must match"); - assertEq(newConfigWithMeta[0].config.offchainConfig, greenConfig.offchainConfig, "offchain config must match"); - assertEq( - newConfigWithMeta[0].configDigest, s_ccipCC.computeConfigDigest(donId, 2, greenConfig), "config digest must match" - ); - - // This ensures that the test case is using correct inputs. - s_ccipCC.validateConfigTransition(currentConfig, newConfigWithMeta); - } - - function test__validateConfigTransition_InitToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); - - s_ccipCC.validateConfigTransition(currentConfig, newConfig); - } - - function test__validateConfigTransition_RunningToStaging_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - - s_ccipCC.validateConfigTransition(currentConfig, newConfig); - } - - function test__validateConfigTransition_StagingToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - s_ccipCC.validateConfigTransition(currentConfig, newConfig); - } - - // Reverts. - - function test_Fuzz__stateFromConfigLength_Reverts(uint256 configLen) public { - vm.assume(configLen > 2); - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigLength.selector, configLen)); - 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); - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); - for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - 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); - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); - for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Execution, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - 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 { - CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](5); - vm.expectRevert(CCIPConfig.TooManyOCR3Configs.selector); - s_ccipCC.groupByPluginType(cfgs); - } - - function test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() public { - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - // p2pIds: _makeBytes32Array(4, 0), - // signers: _makeBytesArray(4, 10), - // transmitters: _makeBytesArray(4, 20), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 0, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.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({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - // p2pIds: _makeBytes32Array(4, 0), - // signers: _makeBytesArray(4, 10), - // transmitters: _makeBytesArray(4, 20), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 3, blueConfig) // wrong config digest (due to diff config count) - }); - newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - vm.expectRevert( - abi.encodeWithSelector( - CCIPConfig.WrongConfigDigestBlueGreen.selector, - s_ccipCC.computeConfigDigest(donId, 3, blueConfig), - s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - ) - ); - s_ccipCC.validateConfigTransition(currentConfig, newConfig); - } - - function test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() public { - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 3, // wrong config count - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) - }); - - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.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({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: _constructNodesArray(_makeBytes32Array(4, 0), _makeBytesArray(4, 10), _makeBytesArray(4, 20)), - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 1, - config: blueConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - configCount: 2, - config: greenConfig, - configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) // wrong config digest - }); - - vm.expectRevert( - abi.encodeWithSelector( - CCIPConfig.WrongConfigDigest.selector, - s_ccipCC.computeConfigDigest(donId, 3, greenConfig), - s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - ) - ); - s_ccipCC.validateConfigTransition(currentConfig, newConfig); - } - - 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); - s_ccipCC.validateConfigTransition(currentConfig, newConfig); - } -} - -contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { - // Successes. - - function test_updatePluginConfig_InitToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); - configs[0] = blueConfig; - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); - expectedConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - config: blueConfig, - configCount: 1, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - - vm.expectEmit(); - emit CCIPConfig.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); - - _assertOCR3ConfigWithMetaEqual(storedConfig, expectedConfig); - } - - function test_updatePluginConfig_RunningToStaging_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - // add blue config. - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.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({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); - blueAndGreen[0] = blueConfig; - blueAndGreen[1] = greenConfig; - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - expectedConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - config: blueConfig, - configCount: 1, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - expectedConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - config: greenConfig, - configCount: 2, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - vm.expectEmit(); - emit CCIPConfig.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); - - _assertOCR3ConfigWithMetaEqual(storedConfig, expectedConfig); - } - - function test_updatePluginConfig_StagingToRunning_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - // add blue config. - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.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({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit-new") - }); - CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); - blueAndGreen[0] = blueConfig; - blueAndGreen[1] = greenConfig; - - CCIPConfigTypes.OCR3ConfigWithMeta[] memory expectedConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); - expectedConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ - config: blueConfig, - configCount: 1, - configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) - }); - expectedConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ - config: greenConfig, - configCount: 2, - configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) - }); - - vm.expectEmit(); - emit CCIPConfig.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); - - _assertOCR3ConfigWithMetaEqual(storedConfig, expectedConfig); - } - - // 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))); - 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); - // 0 -> 2 is an invalid state transition. - vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigStateTransition.selector, 0, 2)); - s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); - } -} - -contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { - // Successes. - function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public { - changePrank(CAPABILITIES_REGISTRY); - - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.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); - changePrank(CAPABILITIES_REGISTRY); - - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.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); - assertEq(storedConfigs.length, 1, "config length must be 1"); - assertEq(storedConfigs[0].configCount, 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); - changePrank(CAPABILITIES_REGISTRY); - - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Execution, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("exec") - }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.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); - assertEq(storedConfigs.length, 1, "config length must be 1"); - assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); - assertEq( - uint256(storedConfigs[0].config.pluginType), - uint256(Internal.OCRPluginType.Execution), - "plugin type must be execution" - ); - } - - function test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() public { - CCIPConfigTypes.OCR3Node[] memory nodes = _addChainConfig(4); - changePrank(CAPABILITIES_REGISTRY); - - uint32 donId = 1; - CCIPConfigTypes.OCR3Config memory blueCommitConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Commit, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("commit") - }); - CCIPConfigTypes.OCR3Config memory blueExecConfig = CCIPConfigTypes.OCR3Config({ - pluginType: Internal.OCRPluginType.Execution, - offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), - rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), - chainSelector: 1, - nodes: nodes, - FRoleDON: 1, - offchainConfigVersion: 30, - offchainConfig: bytes("exec") - }); - CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.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 = - 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( - uint256(storedExecConfigs[0].config.pluginType), - uint256(Internal.OCRPluginType.Execution), - "plugin type must be execution" - ); - - CCIPConfigTypes.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( - uint256(storedCommitConfigs[0].config.pluginType), - uint256(Internal.OCRPluginType.Commit), - "plugin type must be commit" - ); - } - - // Reverts. - - function test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() public { - bytes32[] memory nodes = new bytes32[](0); - bytes memory config = bytes(""); - uint64 configCount = 1; - uint32 donId = 1; - vm.expectRevert(CCIPConfig.OnlyCapabilitiesRegistryCanCall.selector); - s_ccipCC.beforeCapabilityConfigSet(nodes, config, configCount, donId); - } -} diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol new file mode 100644 index 0000000000..1b91191cc0 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome.t.sol @@ -0,0 +1,932 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +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"; +import {Vm} from "forge-std/Vm.sol"; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol"; + +contract CCIPHomeTest is Test { + // address internal constant OWNER = address(0x0000000123123123123); + bytes32 internal constant ZERO_DIGEST = bytes32(uint256(0)); + address internal constant CAPABILITIES_REGISTRY = address(0x0000000123123123123); + Internal.OCRPluginType internal constant DEFAULT_PLUGIN_TYPE = Internal.OCRPluginType.Commit; + uint32 internal constant DEFAULT_DON_ID = 78978987; + + CCIPHomeHelper public s_ccipHome; + + uint256 private constant PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 private constant PREFIX = 0x000a << (256 - 16); // 0x000b00..00 + + uint64 private constant DEFAULT_CHAIN_SELECTOR = 9381579735; + + function setUp() public virtual { + s_ccipHome = new CCIPHomeHelper(CAPABILITIES_REGISTRY); + s_ccipHome.applyChainConfigUpdates(new uint64[](0), _getBaseChainConfigs()); + + ICapabilitiesRegistry.NodeInfo memory nodeInfo = ICapabilitiesRegistry.NodeInfo({ + p2pId: keccak256("p2pId"), + signer: keccak256("signer"), + nodeOperatorId: 1, + configCount: 1, + workflowDONId: 1, + hashedCapabilityIds: new bytes32[](0), + capabilitiesDONIds: new uint256[](0) + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector), abi.encode(nodeInfo) + ); + + vm.startPrank(address(s_ccipHome)); + } + + function _getBaseChainConfigs() internal pure returns (CCIPHome.ChainConfigArgs[] memory) { + CCIPHome.ChainConfigArgs[] memory configs = new CCIPHome.ChainConfigArgs[](1); + CCIPHome.ChainConfig memory chainConfig = + CCIPHome.ChainConfig({readers: new bytes32[](0), fChain: 1, config: abi.encode("chainConfig")}); + configs[0] = CCIPHome.ChainConfigArgs({chainSelector: DEFAULT_CHAIN_SELECTOR, chainConfig: chainConfig}); + + return configs; + } + + function _getConfigDigest( + uint32 donId, + Internal.OCRPluginType pluginType, + bytes memory config, + uint32 version + ) internal view returns (bytes32) { + return bytes32( + (PREFIX & PREFIX_MASK) + | ( + uint256( + keccak256( + bytes.concat( + abi.encode(bytes32("EVM"), block.chainid, address(s_ccipHome), donId, pluginType, version), config + ) + ) + ) & ~PREFIX_MASK + ) + ); + } + + function _getBaseConfig() internal pure returns (CCIPHome.OCR3Config memory) { + CCIPHome.OCR3Node[] memory nodes = new CCIPHome.OCR3Node[](4); + for (uint256 i = 0; i < nodes.length; i++) { + nodes[i] = CCIPHome.OCR3Node({ + p2pId: keccak256(abi.encode("p2pId", i)), + signerKey: abi.encode("signerKey"), + transmitterKey: abi.encode("transmitterKey") + }); + } + + return CCIPHome.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + chainSelector: DEFAULT_CHAIN_SELECTOR, + FRoleDON: 1, + offchainConfigVersion: 98765, + offrampAddress: abi.encode("offrampAddress"), + rmnHomeAddress: abi.encode("rmnHomeAddress"), + nodes: nodes, + offchainConfig: abi.encode("offchainConfig") + }); + } +} + +contract CCIPHome_constructor is CCIPHomeTest { + function test_constructor_success() public { + CCIPHome ccipHome = new CCIPHome(CAPABILITIES_REGISTRY); + + assertEq(address(ccipHome.getCapabilityRegistry()), CAPABILITIES_REGISTRY); + } + + function test_supportsInterface_success() public view { + assertTrue(s_ccipHome.supportsInterface(type(IERC165).interfaceId)); + assertTrue(s_ccipHome.supportsInterface(type(ICapabilityConfiguration).interfaceId)); + } + + function test_getCapabilityConfiguration_success() public view { + bytes memory config = s_ccipHome.getCapabilityConfiguration(DEFAULT_DON_ID); + assertEq(config.length, 0); + } + + function test_constructor_CapabilitiesRegistryAddressZero_reverts() public { + vm.expectRevert(CCIPHome.ZeroAddressNotAllowed.selector); + new CCIPHome(address(0)); + } +} + +contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeTest { + function setUp() public virtual override { + super.setUp(); + vm.stopPrank(); + vm.startPrank(address(CAPABILITIES_REGISTRY)); + } + + function test_beforeCapabilityConfigSet_success() public { + // first set a config + bytes memory callData = + abi.encodeCall(CCIPHome.setCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, _getBaseConfig(), ZERO_DIGEST)); + + vm.expectCall(address(s_ccipHome), callData); + + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + + // Then revoke the config + bytes32 candidateDigest = s_ccipHome.getCandidateDigest(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertNotEq(candidateDigest, ZERO_DIGEST); + + callData = abi.encodeCall(CCIPHome.revokeCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, candidateDigest)); + + vm.expectCall(address(s_ccipHome), callData); + + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + + // Then set a new config + callData = + abi.encodeCall(CCIPHome.setCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, _getBaseConfig(), ZERO_DIGEST)); + + vm.expectCall(address(s_ccipHome), callData); + + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + + // Then promote the new config + + bytes32 newCandidateDigest = s_ccipHome.getCandidateDigest(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertNotEq(newCandidateDigest, ZERO_DIGEST); + + callData = abi.encodeCall( + CCIPHome.promoteCandidateAndRevokeActive, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, newCandidateDigest, ZERO_DIGEST) + ); + + vm.expectCall(address(s_ccipHome), callData); + + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + + bytes32 activeDigest = s_ccipHome.getActiveDigest(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, newCandidateDigest); + } + + function test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_reverts() public { + bytes memory callData = + abi.encodeCall(CCIPHome.setCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, _getBaseConfig(), ZERO_DIGEST)); + + vm.stopPrank(); + + vm.expectRevert(CCIPHome.OnlyCapabilitiesRegistryCanCall.selector); + + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + } + + function test_beforeCapabilityConfigSet_InvalidSelector_reverts() public { + bytes memory callData = abi.encodeCall(CCIPHome.getConfigDigests, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE)); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidSelector.selector, CCIPHome.getConfigDigests.selector)); + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + } + + function test_beforeCapabilityConfigSet_DONIdMismatch_reverts() public { + uint32 wrongDonId = DEFAULT_DON_ID + 1; + + bytes memory callData = + abi.encodeCall(CCIPHome.setCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, _getBaseConfig(), ZERO_DIGEST)); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.DONIdMismatch.selector, DEFAULT_DON_ID, wrongDonId)); + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, wrongDonId); + } + + function test_beforeCapabilityConfigSet_InnerCallReverts_reverts() public { + bytes memory callData = abi.encodeCall(CCIPHome.revokeCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, ZERO_DIGEST)); + + vm.expectRevert(CCIPHome.RevokingZeroDigestNotAllowed.selector); + s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); + } +} + +contract CCIPHome_getConfigDigests is CCIPHomeTest { + function test_getConfigDigests_success() public { + (bytes32 activeDigest, bytes32 candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, ZERO_DIGEST); + assertEq(candidateDigest, ZERO_DIGEST); + + CCIPHome.OCR3Config memory config = _getBaseConfig(); + bytes32 firstDigest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + (activeDigest, candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, ZERO_DIGEST); + assertEq(candidateDigest, firstDigest); + + s_ccipHome.promoteCandidateAndRevokeActive(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, firstDigest, ZERO_DIGEST); + + (activeDigest, candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, firstDigest); + assertEq(candidateDigest, ZERO_DIGEST); + + bytes32 secondDigest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + (activeDigest, candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, firstDigest); + assertEq(candidateDigest, secondDigest); + + assertEq(activeDigest, s_ccipHome.getActiveDigest(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE)); + assertEq(candidateDigest, s_ccipHome.getCandidateDigest(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE)); + } +} + +contract CCIPHome_getAllConfigs is CCIPHomeTest { + function test_getAllConfigs_success() public { + CCIPHome.OCR3Config memory config = _getBaseConfig(); + bytes32 firstDigest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + (CCIPHome.VersionedConfig memory activeConfig, CCIPHome.VersionedConfig memory candidateConfig) = + s_ccipHome.getAllConfigs(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeConfig.configDigest, ZERO_DIGEST); + assertEq(candidateConfig.configDigest, firstDigest); + + s_ccipHome.promoteCandidateAndRevokeActive(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, firstDigest, ZERO_DIGEST); + + (activeConfig, candidateConfig) = s_ccipHome.getAllConfigs(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeConfig.configDigest, firstDigest); + assertEq(candidateConfig.configDigest, ZERO_DIGEST); + + bytes32 secondDigest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + (activeConfig, candidateConfig) = s_ccipHome.getAllConfigs(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeConfig.configDigest, firstDigest); + assertEq(candidateConfig.configDigest, secondDigest); + + (activeConfig, candidateConfig) = s_ccipHome.getAllConfigs(DEFAULT_DON_ID + 1, DEFAULT_PLUGIN_TYPE); + assertEq(activeConfig.configDigest, ZERO_DIGEST); + assertEq(candidateConfig.configDigest, ZERO_DIGEST); + + (activeConfig, candidateConfig) = s_ccipHome.getAllConfigs(DEFAULT_DON_ID, Internal.OCRPluginType.Execution); + assertEq(activeConfig.configDigest, ZERO_DIGEST); + assertEq(candidateConfig.configDigest, ZERO_DIGEST); + } +} + +contract CCIPHome_setCandidate is CCIPHomeTest { + function test_setCandidate_success() public { + CCIPHome.OCR3Config memory config = _getBaseConfig(); + CCIPHome.VersionedConfig memory versionedConfig = + CCIPHome.VersionedConfig({version: 1, config: config, configDigest: ZERO_DIGEST}); + + versionedConfig.configDigest = + _getConfigDigest(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, abi.encode(versionedConfig.config), versionedConfig.version); + + vm.expectEmit(); + emit CCIPHome.ConfigSet(versionedConfig.configDigest, versionedConfig.version, versionedConfig.config); + + s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, versionedConfig.config, ZERO_DIGEST); + + (CCIPHome.VersionedConfig memory storedVersionedConfig, bool ok) = + s_ccipHome.getConfig(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, versionedConfig.configDigest); + assertTrue(ok); + assertEq(storedVersionedConfig.version, versionedConfig.version); + assertEq(storedVersionedConfig.configDigest, versionedConfig.configDigest); + assertEq(keccak256(abi.encode(storedVersionedConfig.config)), keccak256(abi.encode(versionedConfig.config))); + } + + function test_setCandidate_ConfigDigestMismatch_reverts() public { + CCIPHome.OCR3Config memory config = _getBaseConfig(); + + bytes32 digest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.ConfigDigestMismatch.selector, digest, ZERO_DIGEST)); + s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + vm.expectEmit(); + emit CCIPHome.CandidateConfigRevoked(digest); + + s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, digest); + } + + function test_setCandidate_CanOnlySelfCall_reverts() public { + vm.stopPrank(); + + vm.expectRevert(CCIPHome.CanOnlySelfCall.selector); + s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, _getBaseConfig(), ZERO_DIGEST); + } +} + +contract CCIPHome_revokeCandidate is CCIPHomeTest { + // Sets two configs + function setUp() public virtual override { + super.setUp(); + CCIPHome.OCR3Config memory config = _getBaseConfig(); + bytes32 digest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + s_ccipHome.promoteCandidateAndRevokeActive(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, digest, ZERO_DIGEST); + + config.offrampAddress = abi.encode("new_offrampAddress"); + s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + } + + function test_revokeCandidate_success() public { + (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = + s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + + vm.expectEmit(); + emit CCIPHome.CandidateConfigRevoked(priorCandidateDigest); + + s_ccipHome.revokeCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, priorCandidateDigest); + + (CCIPHome.VersionedConfig memory storedVersionedConfig, bool ok) = + s_ccipHome.getConfig(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, priorCandidateDigest); + assertFalse(ok); + // Ensure no old data is returned, even though it's still in storage + assertEq(storedVersionedConfig.version, 0); + assertEq(storedVersionedConfig.config.chainSelector, 0); + assertEq(storedVersionedConfig.config.FRoleDON, 0); + + // Asser the active digest is unaffected but the candidate digest is set to zero + (bytes32 activeDigest, bytes32 candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, priorActiveDigest); + assertEq(candidateDigest, ZERO_DIGEST); + assertTrue(candidateDigest != priorCandidateDigest); + } + + function test_revokeCandidate_ConfigDigestMismatch_reverts() public { + (, bytes32 priorCandidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + + bytes32 wrongDigest = keccak256("wrong_digest"); + vm.expectRevert(abi.encodeWithSelector(CCIPHome.ConfigDigestMismatch.selector, priorCandidateDigest, wrongDigest)); + s_ccipHome.revokeCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, wrongDigest); + } + + function test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() public { + vm.expectRevert(CCIPHome.RevokingZeroDigestNotAllowed.selector); + s_ccipHome.revokeCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, ZERO_DIGEST); + } + + function test_revokeCandidate_CanOnlySelfCall_reverts() public { + vm.startPrank(address(0)); + + vm.expectRevert(CCIPHome.CanOnlySelfCall.selector); + s_ccipHome.revokeCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, keccak256("configDigest")); + } +} + +contract CCIPHome_promoteCandidateAndRevokeActive is CCIPHomeTest { + function test_promoteCandidateAndRevokeActive_success() public { + CCIPHome.OCR3Config memory config = _getBaseConfig(); + bytes32 firstConfigToPromote = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + vm.expectEmit(); + emit CCIPHome.ConfigPromoted(firstConfigToPromote); + + s_ccipHome.promoteCandidateAndRevokeActive(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, firstConfigToPromote, ZERO_DIGEST); + + // Assert the active digest is updated and the candidate digest is set to zero + (bytes32 activeDigest, bytes32 candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeDigest, firstConfigToPromote); + assertEq(candidateDigest, ZERO_DIGEST); + + // Set a new candidate to promote over a non-zero active config. + config.offchainConfig = abi.encode("new_offchainConfig_config"); + bytes32 secondConfigToPromote = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); + + vm.expectEmit(); + emit CCIPHome.ActiveConfigRevoked(firstConfigToPromote); + + vm.expectEmit(); + emit CCIPHome.ConfigPromoted(secondConfigToPromote); + + s_ccipHome.promoteCandidateAndRevokeActive( + DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, secondConfigToPromote, firstConfigToPromote + ); + + (CCIPHome.VersionedConfig memory activeConfig, CCIPHome.VersionedConfig memory candidateConfig) = + s_ccipHome.getAllConfigs(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + assertEq(activeConfig.configDigest, secondConfigToPromote); + assertEq(candidateConfig.configDigest, ZERO_DIGEST); + assertEq(keccak256(abi.encode(activeConfig.config)), keccak256(abi.encode(config))); + } + + function test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() public { + vm.expectRevert(CCIPHome.NoOpStateTransitionNotAllowed.selector); + s_ccipHome.promoteCandidateAndRevokeActive(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, ZERO_DIGEST, ZERO_DIGEST); + } + + function test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() public { + (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = + s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); + bytes32 wrongActiveDigest = keccak256("wrongActiveDigest"); + bytes32 wrongCandidateDigest = keccak256("wrongCandidateDigest"); + + vm.expectRevert( + abi.encodeWithSelector(CCIPHome.ConfigDigestMismatch.selector, priorActiveDigest, wrongCandidateDigest) + ); + s_ccipHome.promoteCandidateAndRevokeActive( + DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, wrongCandidateDigest, wrongActiveDigest + ); + + vm.expectRevert( + abi.encodeWithSelector(CCIPHome.ConfigDigestMismatch.selector, priorActiveDigest, wrongActiveDigest) + ); + + s_ccipHome.promoteCandidateAndRevokeActive( + DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, priorCandidateDigest, wrongActiveDigest + ); + } + + function test_promoteCandidateAndRevokeActive_CanOnlySelfCall_reverts() public { + vm.stopPrank(); + + vm.expectRevert(CCIPHome.CanOnlySelfCall.selector); + s_ccipHome.promoteCandidateAndRevokeActive( + DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, keccak256("toPromote"), keccak256("ToRevoke") + ); + } +} + +contract CCIPHome__validateConfig is CCIPHomeTest { + function setUp() public virtual override { + s_ccipHome = new CCIPHomeHelper(CAPABILITIES_REGISTRY); + } + + function _addChainConfig(uint256 numNodes) internal returns (CCIPHome.OCR3Node[] memory nodes) { + return _addChainConfig(numNodes, 1); + } + + function _makeBytes32Array(uint256 length, uint256 seed) internal pure returns (bytes32[] memory arr) { + arr = new bytes32[](length); + for (uint256 i = 0; i < length; i++) { + arr[i] = keccak256(abi.encode(i, 1, seed)); + } + return arr; + } + + function _makeBytesArray(uint256 length, uint256 seed) internal pure returns (bytes[] memory arr) { + arr = new bytes[](length); + for (uint256 i = 0; i < length; i++) { + arr[i] = abi.encode(keccak256(abi.encode(i, 1, seed))); + } + return arr; + } + + 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 CCIPHome.OCR3Node[](numNodes); + + for (uint256 i = 0; i < numNodes; i++) { + nodes[i] = CCIPHome.OCR3Node({p2pId: p2pIds[i], signerKey: signers[i], transmitterKey: transmitters[i]}); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, p2pIds[i]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(signers[i]), + p2pId: p2pIds[i], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + } + // Add chain selector for chain 1. + CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](1); + adds[0] = CCIPHome.ChainConfigArgs({ + chainSelector: 1, + chainConfig: CCIPHome.ChainConfig({readers: p2pIds, fChain: fChain, config: bytes("config1")}) + }); + + vm.expectEmit(); + emit CCIPHome.ChainConfigSet(1, adds[0].chainConfig); + s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); + + return nodes; + } + + function _getCorrectOCR3Config(uint8 numNodes, uint8 FRoleDON) internal returns (CCIPHome.OCR3Config memory) { + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(numNodes); + + return CCIPHome.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encode(keccak256(abi.encode("offramp"))), + rmnHomeAddress: abi.encode(keccak256(abi.encode("rmnHome"))), + chainSelector: 1, + nodes: nodes, + FRoleDON: FRoleDON, + offchainConfigVersion: 30, + offchainConfig: bytes("offchainConfig") + }); + } + + function _getCorrectOCR3Config() internal returns (CCIPHome.OCR3Config memory) { + return _getCorrectOCR3Config(4, 1); + } + + // Successes. + + function test__validateConfig_Success() public { + s_ccipHome.validateConfig(_getCorrectOCR3Config()); + } + + function test__validateConfigLessTransmittersThanSigners_Success() public { + // fChain is 1, so there should be at least 4 transmitters. + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(5, 1); + config.nodes[1].transmitterKey = bytes(""); + + s_ccipHome.validateConfig(config); + } + + function test__validateConfigSmallerFChain_Success() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(11, 3); + + // Set fChain to 2 + _addChainConfig(4, 2); + + s_ccipHome.validateConfig(config); + } + + // Reverts + + function test__validateConfig_ChainSelectorNotSet_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.chainSelector = 0; // invalid + + vm.expectRevert(CCIPHome.ChainSelectorNotSet.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_OfframpAddressCannotBeZero_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.offrampAddress = ""; // invalid + + vm.expectRevert(CCIPHome.OfframpAddressCannotBeZero.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.offrampAddress = abi.encode(address(0)); // invalid + + vm.expectRevert(CCIPHome.OfframpAddressCannotBeZero.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_RMNHomeAddressCannotBeZero_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.rmnHomeAddress = ""; // invalid + + vm.expectRevert(CCIPHome.RMNHomeAddressCannotBeZero.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.rmnHomeAddress = abi.encode(address(0)); // invalid + + vm.expectRevert(CCIPHome.RMNHomeAddressCannotBeZero.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_ChainSelectorNotFound_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.chainSelector = 2; // not set + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.ChainSelectorNotFound.selector, 2)); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_NotEnoughTransmitters_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + uint256 numberOfTransmitters = 3; + + // 32 > 31 (max num oracles) + 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. + for (uint256 i = numberOfTransmitters; i < nodes.length; ++i) { + nodes[i].transmitterKey = bytes(""); + } + + config.nodes = nodes; + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NotEnoughTransmitters.selector, numberOfTransmitters, 4)); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.nodes[0].transmitterKey = bytes(""); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NotEnoughTransmitters.selector, 3, 4)); + s_ccipHome.validateConfig(config); + + // Zero out remaining transmitters to verify error changes + for (uint256 i = 1; i < config.nodes.length; ++i) { + config.nodes[i].transmitterKey = bytes(""); + } + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NotEnoughTransmitters.selector, 0, 4)); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_TooManySigners_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.nodes = new CCIPHome.OCR3Node[](257); + + vm.expectRevert(CCIPHome.TooManySigners.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_FChainTooHigh_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.FRoleDON = 2; // too low + + // Set fChain to 3 + _addChainConfig(4, 3); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.FChainTooHigh.selector, 3, 2)); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_FMustBePositive_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.FRoleDON = 0; // not positive + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.FChainTooHigh.selector, 1, 0)); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_FTooHigh_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.FRoleDON = 2; // too high + + vm.expectRevert(CCIPHome.FTooHigh.selector); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_ZeroP2PId_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.nodes[1].p2pId = bytes32(0); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidNode.selector, config.nodes[1])); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_ZeroSignerKey_Reverts() public { + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.nodes[2].signerKey = bytes(""); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidNode.selector, config.nodes[2])); + s_ccipHome.validateConfig(config); + } + + function test__validateConfig_NodeNotInRegistry_Reverts() public { + CCIPHome.OCR3Node[] memory nodes = _addChainConfig(4); + bytes32 nonExistentP2PId = keccak256("notInRegistry"); + nodes[0].p2pId = nonExistentP2PId; + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, nonExistentP2PId), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 0, + signer: bytes32(0), + p2pId: bytes32(uint256(0)), + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); + config.nodes = nodes; + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NodeNotInRegistry.selector, nonExistentP2PId)); + s_ccipHome.validateConfig(config); + } +} + +contract CCIPHome_applyChainConfigUpdates is CCIPHomeTest { + function setUp() public virtual override { + s_ccipHome = new CCIPHomeHelper(CAPABILITIES_REGISTRY); + } + + function test_applyChainConfigUpdates_addChainConfigs_Success() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); + adds[0] = CCIPHome.ChainConfigArgs({ + chainSelector: 1, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPHome.ChainConfigArgs({ + chainSelector: 2, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + }); + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + vm.expectEmit(); + emit CCIPHome.ChainConfigSet(1, adds[0].chainConfig); + vm.expectEmit(); + emit CCIPHome.ChainConfigSet(2, adds[1].chainConfig); + s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); + + CCIPHome.ChainConfigArgs[] memory configs = s_ccipHome.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_ccipHome.getNumChainConfigurations(), 2, "total chain configs must be 2"); + } + + function test_getPaginatedCCIPHomes_Success() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); + adds[0] = CCIPHome.ChainConfigArgs({ + chainSelector: 1, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPHome.ChainConfigArgs({ + chainSelector: 2, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + }); + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); + + CCIPHome.ChainConfigArgs[] memory configs = s_ccipHome.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"); + + configs = s_ccipHome.getAllChainConfigs(0, 1); + assertEq(configs.length, 1, "chain configs length must be 1"); + assertEq(configs[0].chainSelector, 1, "chain selector must match"); + + configs = s_ccipHome.getAllChainConfigs(0, 10); + 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"); + + configs = s_ccipHome.getAllChainConfigs(1, 1); + assertEq(configs.length, 1, "chain configs length must be 1"); + + configs = s_ccipHome.getAllChainConfigs(1, 2); + assertEq(configs.length, 0, "chain configs length must be 0"); + } + + function test_applyChainConfigUpdates_removeChainConfigs_Success() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); + adds[0] = CCIPHome.ChainConfigArgs({ + chainSelector: 1, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPHome.ChainConfigArgs({ + chainSelector: 2, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + vm.expectEmit(); + emit CCIPHome.ChainConfigSet(1, adds[0].chainConfig); + vm.expectEmit(); + emit CCIPHome.ChainConfigSet(2, adds[1].chainConfig); + s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); + + assertEq(s_ccipHome.getNumChainConfigurations(), 2, "total chain configs must be 2"); + + uint64[] memory removes = new uint64[](1); + removes[0] = uint64(1); + + vm.expectEmit(); + emit CCIPHome.ChainConfigRemoved(1); + s_ccipHome.applyChainConfigUpdates(removes, new CCIPHome.ChainConfigArgs[](0)); + + assertEq(s_ccipHome.getNumChainConfigurations(), 1, "total chain configs must be 1"); + } + + // Reverts. + + function test_applyChainConfigUpdates_selectorNotFound_Reverts() public { + uint64[] memory removes = new uint64[](1); + removes[0] = uint64(1); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.ChainSelectorNotFound.selector, 1)); + s_ccipHome.applyChainConfigUpdates(removes, new CCIPHome.ChainConfigArgs[](0)); + } + + function test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](1); + adds[0] = CCIPHome.ChainConfigArgs({ + chainSelector: 1, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 0, + signer: bytes32(0), + p2pId: bytes32(uint256(0)), + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + vm.expectRevert(abi.encodeWithSelector(CCIPHome.NodeNotInRegistry.selector, chainReaders[0])); + s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); + } + + function test__applyChainConfigUpdates_FChainNotPositive_Reverts() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); + adds[0] = CCIPHome.ChainConfigArgs({ + chainSelector: 1, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPHome.ChainConfigArgs({ + chainSelector: 2, + chainConfig: CCIPHome.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + vm.expectRevert(CCIPHome.FChainMustBePositive.selector); + s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); + } +} 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..8e460b791e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPHomeHelper.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {CCIPHome} from "../../capability/CCIPHome.sol"; + +contract CCIPHomeHelper is CCIPHome { + constructor(address capabilitiesRegistry) CCIPHome(capabilitiesRegistry) {} + + function validateConfig(OCR3Config memory cfg) external view { + return _validateConfig(cfg); + } + + function ensureInRegistry(bytes32[] memory p2pIds) external view { + return _ensureInRegistry(p2pIds); + } +} diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome.t.sol index 40cb1e4a07..c5226d3206 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome.t.sol @@ -3,13 +3,375 @@ pragma solidity 0.8.24; import {Internal} from "../../libraries/Internal.sol"; import {RMNHome} from "../../rmn/RMNHome.sol"; -import {BaseTest} from "../BaseTest.t.sol"; +import {Test} from "forge-std/Test.sol"; +import {Vm} from "forge-std/Vm.sol"; -contract RMNHomeTest is BaseTest { - RMNHome public s_rmnHome; +contract RMNHomeTest is Test { + struct Config { + RMNHome.StaticConfig staticConfig; + RMNHome.DynamicConfig dynamicConfig; + } + + bytes32 internal constant ZERO_DIGEST = bytes32(uint256(0)); + RMNHome public s_rmnHome = new RMNHome(); + + function _getBaseConfig() internal pure returns (Config memory) { + RMNHome.Node[] memory nodes = new RMNHome.Node[](3); + nodes[0] = RMNHome.Node({peerId: keccak256("peerId_0"), offchainPublicKey: keccak256("offchainPublicKey_0")}); + nodes[1] = RMNHome.Node({peerId: keccak256("peerId_1"), offchainPublicKey: keccak256("offchainPublicKey_1")}); + nodes[2] = RMNHome.Node({peerId: keccak256("peerId_2"), offchainPublicKey: keccak256("offchainPublicKey_2")}); + + RMNHome.SourceChain[] memory sourceChains = new RMNHome.SourceChain[](2); + // Observer 0 for source chain 9000 + sourceChains[0] = RMNHome.SourceChain({chainSelector: 9000, minObservers: 1, observerNodesBitmap: 1 << 0}); + // Observers 1 and 2 for source chain 9001 + sourceChains[1] = RMNHome.SourceChain({chainSelector: 9001, minObservers: 2, observerNodesBitmap: 1 << 1 | 1 << 2}); + + return Config({ + staticConfig: RMNHome.StaticConfig({nodes: nodes, offchainConfig: abi.encode("static_config")}), + dynamicConfig: RMNHome.DynamicConfig({sourceChains: sourceChains, offchainConfig: abi.encode("dynamic_config")}) + }); + } + + uint256 private constant PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 private constant PREFIX = 0x000b << (256 - 16); // 0x000b00..00 + + function _getConfigDigest(bytes memory staticConfig, uint32 version) internal view returns (bytes32) { + return bytes32( + (PREFIX & PREFIX_MASK) + | ( + uint256( + keccak256(bytes.concat(abi.encode(bytes32("EVM"), block.chainid, address(s_rmnHome), version), staticConfig)) + ) & ~PREFIX_MASK + ) + ); + } +} + +contract RMNHome_getConfigDigests is RMNHomeTest { + function test_getConfigDigests_success() public { + (bytes32 activeDigest, bytes32 candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, ZERO_DIGEST); + assertEq(candidateDigest, ZERO_DIGEST); + + Config memory config = _getBaseConfig(); + bytes32 firstDigest = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + + (activeDigest, candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, ZERO_DIGEST); + assertEq(candidateDigest, firstDigest); + + s_rmnHome.promoteCandidateAndRevokeActive(firstDigest, ZERO_DIGEST); + + (activeDigest, candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, firstDigest); + assertEq(candidateDigest, ZERO_DIGEST); + + bytes32 secondDigest = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + + (activeDigest, candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, firstDigest); + assertEq(candidateDigest, secondDigest); + + assertEq(activeDigest, s_rmnHome.getActiveDigest()); + assertEq(candidateDigest, s_rmnHome.getCandidateDigest()); + } +} + +contract RMNHome_setCandidate is RMNHomeTest { + function test_setCandidate_success() public { + Config memory config = _getBaseConfig(); + RMNHome.VersionedConfig memory versionedConfig = RMNHome.VersionedConfig({ + version: 1, + staticConfig: config.staticConfig, + dynamicConfig: config.dynamicConfig, + configDigest: ZERO_DIGEST + }); + + versionedConfig.configDigest = _getConfigDigest(abi.encode(versionedConfig.staticConfig), versionedConfig.version); + + vm.expectEmit(); + emit RMNHome.ConfigSet( + versionedConfig.configDigest, versionedConfig.version, versionedConfig.staticConfig, versionedConfig.dynamicConfig + ); + + s_rmnHome.setCandidate(versionedConfig.staticConfig, versionedConfig.dynamicConfig, ZERO_DIGEST); + + (RMNHome.VersionedConfig memory storedVersionedConfig, bool ok) = s_rmnHome.getConfig(versionedConfig.configDigest); + assertTrue(ok); + assertEq(storedVersionedConfig.version, versionedConfig.version); + RMNHome.StaticConfig memory storedStaticConfig = storedVersionedConfig.staticConfig; + RMNHome.DynamicConfig memory storedDynamicConfig = storedVersionedConfig.dynamicConfig; + + assertEq(storedStaticConfig.nodes.length, versionedConfig.staticConfig.nodes.length); + for (uint256 i = 0; i < storedStaticConfig.nodes.length; i++) { + RMNHome.Node memory storedNode = storedStaticConfig.nodes[i]; + assertEq(storedNode.peerId, versionedConfig.staticConfig.nodes[i].peerId); + assertEq(storedNode.offchainPublicKey, versionedConfig.staticConfig.nodes[i].offchainPublicKey); + } + + assertEq(storedDynamicConfig.sourceChains.length, versionedConfig.dynamicConfig.sourceChains.length); + for (uint256 i = 0; i < storedDynamicConfig.sourceChains.length; i++) { + RMNHome.SourceChain memory storedSourceChain = storedDynamicConfig.sourceChains[i]; + assertEq(storedSourceChain.chainSelector, versionedConfig.dynamicConfig.sourceChains[i].chainSelector); + assertEq(storedSourceChain.minObservers, versionedConfig.dynamicConfig.sourceChains[i].minObservers); + assertEq(storedSourceChain.observerNodesBitmap, versionedConfig.dynamicConfig.sourceChains[i].observerNodesBitmap); + } + assertEq(storedDynamicConfig.offchainConfig, versionedConfig.dynamicConfig.offchainConfig); + assertEq(storedStaticConfig.offchainConfig, versionedConfig.staticConfig.offchainConfig); + } + + function test_setCandidate_ConfigDigestMismatch_reverts() public { + Config memory config = _getBaseConfig(); + + bytes32 digest = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + + vm.expectRevert(abi.encodeWithSelector(RMNHome.ConfigDigestMismatch.selector, digest, ZERO_DIGEST)); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + + vm.expectEmit(); + emit RMNHome.CandidateConfigRevoked(digest); + + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, digest); + } + + function test_setCandidate_OnlyOwner_reverts() public { + Config memory config = _getBaseConfig(); + + vm.startPrank(address(0)); + + vm.expectRevert("Only callable by owner"); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } +} + +contract RMNHome_revokeCandidate is RMNHomeTest { + // Sets two configs + function setUp() public { + Config memory config = _getBaseConfig(); + bytes32 digest = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + s_rmnHome.promoteCandidateAndRevokeActive(digest, ZERO_DIGEST); + + config.dynamicConfig.sourceChains[0].minObservers--; + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_revokeCandidate_success() public { + (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = s_rmnHome.getConfigDigests(); + + vm.expectEmit(); + emit RMNHome.CandidateConfigRevoked(priorCandidateDigest); + + s_rmnHome.revokeCandidate(priorCandidateDigest); + + (RMNHome.VersionedConfig memory storedVersionedConfig, bool ok) = s_rmnHome.getConfig(priorCandidateDigest); + assertFalse(ok); + // Ensure no old data is returned, even though it's still in storage + assertEq(storedVersionedConfig.version, 0); + assertEq(storedVersionedConfig.staticConfig.nodes.length, 0); + assertEq(storedVersionedConfig.dynamicConfig.sourceChains.length, 0); + + // Asser the active digest is unaffected but the candidate digest is set to zero + (bytes32 activeDigest, bytes32 candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, priorActiveDigest); + assertEq(candidateDigest, ZERO_DIGEST); + assertTrue(candidateDigest != priorCandidateDigest); + } + + function test_revokeCandidate_ConfigDigestMismatch_reverts() public { + (, bytes32 priorCandidateDigest) = s_rmnHome.getConfigDigests(); + + bytes32 wrongDigest = keccak256("wrong_digest"); + vm.expectRevert(abi.encodeWithSelector(RMNHome.ConfigDigestMismatch.selector, priorCandidateDigest, wrongDigest)); + s_rmnHome.revokeCandidate(wrongDigest); + } + + function test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() public { + vm.expectRevert(RMNHome.RevokingZeroDigestNotAllowed.selector); + s_rmnHome.revokeCandidate(ZERO_DIGEST); + } + + function test_revokeCandidate_OnlyOwner_reverts() public { + vm.startPrank(address(0)); + + vm.expectRevert("Only callable by owner"); + s_rmnHome.revokeCandidate(keccak256("configDigest")); + } +} + +contract RMNHome_promoteCandidateAndRevokeActive is RMNHomeTest { + function test_promoteCandidateAndRevokeActive_success() public { + Config memory config = _getBaseConfig(); + bytes32 firstConfigToPromote = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + + vm.expectEmit(); + emit RMNHome.ConfigPromoted(firstConfigToPromote); + + s_rmnHome.promoteCandidateAndRevokeActive(firstConfigToPromote, ZERO_DIGEST); + + // Assert the active digest is updated and the candidate digest is set to zero + (bytes32 activeDigest, bytes32 candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, firstConfigToPromote); + assertEq(candidateDigest, ZERO_DIGEST); + + // Set a new candidate to promote over a non-zero active config. + config.staticConfig.offchainConfig = abi.encode("new_static_config"); + config.dynamicConfig.offchainConfig = abi.encode("new_dynamic_config"); + bytes32 secondConfigToPromote = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + + vm.expectEmit(); + emit RMNHome.ActiveConfigRevoked(firstConfigToPromote); + + vm.expectEmit(); + emit RMNHome.ConfigPromoted(secondConfigToPromote); + + s_rmnHome.promoteCandidateAndRevokeActive(secondConfigToPromote, firstConfigToPromote); + + (RMNHome.VersionedConfig memory activeConfig, RMNHome.VersionedConfig memory candidateConfig) = + s_rmnHome.getAllConfigs(); + assertEq(activeConfig.configDigest, secondConfigToPromote); + assertEq(activeConfig.staticConfig.offchainConfig, config.staticConfig.offchainConfig); + assertEq(activeConfig.dynamicConfig.offchainConfig, config.dynamicConfig.offchainConfig); + + assertEq(candidateConfig.configDigest, ZERO_DIGEST); + } + + function test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() public { + vm.expectRevert(RMNHome.NoOpStateTransitionNotAllowed.selector); + s_rmnHome.promoteCandidateAndRevokeActive(ZERO_DIGEST, ZERO_DIGEST); + } + + function test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() public { + (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = s_rmnHome.getConfigDigests(); + bytes32 wrongActiveDigest = keccak256("wrongActiveDigest"); + bytes32 wrongCandidateDigest = keccak256("wrongCandidateDigest"); + + vm.expectRevert( + abi.encodeWithSelector(RMNHome.ConfigDigestMismatch.selector, priorActiveDigest, wrongCandidateDigest) + ); + s_rmnHome.promoteCandidateAndRevokeActive(wrongCandidateDigest, wrongActiveDigest); + + vm.expectRevert(abi.encodeWithSelector(RMNHome.ConfigDigestMismatch.selector, priorActiveDigest, wrongActiveDigest)); + + s_rmnHome.promoteCandidateAndRevokeActive(priorCandidateDigest, wrongActiveDigest); + } + + function test_promoteCandidateAndRevokeActive_OnlyOwner_reverts() public { + vm.startPrank(address(0)); + + vm.expectRevert("Only callable by owner"); + s_rmnHome.promoteCandidateAndRevokeActive(keccak256("toPromote"), keccak256("ToRevoke")); + } +} + +contract RMNHome__validateStaticAndDynamicConfig is RMNHomeTest { + function test_validateStaticAndDynamicConfig_OutOfBoundsNodesLength_reverts() public { + Config memory config = _getBaseConfig(); + config.staticConfig.nodes = new RMNHome.Node[](257); + + vm.expectRevert(RMNHome.OutOfBoundsNodesLength.selector); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_validateStaticAndDynamicConfig_DuplicatePeerId_reverts() public { + Config memory config = _getBaseConfig(); + config.staticConfig.nodes[1].peerId = config.staticConfig.nodes[0].peerId; + + vm.expectRevert(RMNHome.DuplicatePeerId.selector); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_validateStaticAndDynamicConfig_DuplicateOffchainPublicKey_reverts() public { + Config memory config = _getBaseConfig(); + config.staticConfig.nodes[1].offchainPublicKey = config.staticConfig.nodes[0].offchainPublicKey; + + vm.expectRevert(RMNHome.DuplicateOffchainPublicKey.selector); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_validateStaticAndDynamicConfig_DuplicateSourceChain_reverts() public { + Config memory config = _getBaseConfig(); + config.dynamicConfig.sourceChains[1].chainSelector = config.dynamicConfig.sourceChains[0].chainSelector; + + vm.expectRevert(RMNHome.DuplicateSourceChain.selector); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_validateStaticAndDynamicConfig_OutOfBoundsObserverNodeIndex_reverts() public { + Config memory config = _getBaseConfig(); + config.dynamicConfig.sourceChains[0].observerNodesBitmap = 1 << config.staticConfig.nodes.length; + + vm.expectRevert(RMNHome.OutOfBoundsObserverNodeIndex.selector); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_validateStaticAndDynamicConfig_MinObserversTooHigh_reverts() public { + Config memory config = _getBaseConfig(); + config.dynamicConfig.sourceChains[0].minObservers++; + + vm.expectRevert(RMNHome.MinObserversTooHigh.selector); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } +} + +contract RMNHome_setDynamicConfig is RMNHomeTest { + function setUp() public { + Config memory config = _getBaseConfig(); + s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); + } + + function test_setDynamicConfig_success() public { + (bytes32 priorActiveDigest,) = s_rmnHome.getConfigDigests(); + + Config memory config = _getBaseConfig(); + config.dynamicConfig.sourceChains[0].minObservers--; + + (, bytes32 candidateConfigDigest) = s_rmnHome.getConfigDigests(); + + vm.expectEmit(); + emit RMNHome.DynamicConfigSet(candidateConfigDigest, config.dynamicConfig); + + s_rmnHome.setDynamicConfig(config.dynamicConfig, candidateConfigDigest); + + (RMNHome.VersionedConfig memory storedVersionedConfig, bool ok) = s_rmnHome.getConfig(candidateConfigDigest); + assertTrue(ok); + assertEq( + storedVersionedConfig.dynamicConfig.sourceChains[0].minObservers, + config.dynamicConfig.sourceChains[0].minObservers + ); + + // Asser the digests don't change when updating the dynamic config + (bytes32 activeDigest, bytes32 candidateDigest) = s_rmnHome.getConfigDigests(); + assertEq(activeDigest, priorActiveDigest); + assertEq(candidateDigest, candidateConfigDigest); + } + + // Asserts the validation function is being called + function test_setDynamicConfig_MinObserversTooHigh_reverts() public { + Config memory config = _getBaseConfig(); + config.dynamicConfig.sourceChains[0].minObservers++; + + vm.expectRevert(abi.encodeWithSelector(RMNHome.DigestNotFound.selector, ZERO_DIGEST)); + s_rmnHome.setDynamicConfig(config.dynamicConfig, ZERO_DIGEST); + } + + function test_setDynamicConfig_DigestNotFound_reverts() public { + // Zero always reverts + vm.expectRevert(abi.encodeWithSelector(RMNHome.DigestNotFound.selector, ZERO_DIGEST)); + s_rmnHome.setDynamicConfig(_getBaseConfig().dynamicConfig, ZERO_DIGEST); + + // Non-existent digest reverts + bytes32 nonExistentDigest = keccak256("nonExistentDigest"); + vm.expectRevert(abi.encodeWithSelector(RMNHome.DigestNotFound.selector, nonExistentDigest)); + s_rmnHome.setDynamicConfig(_getBaseConfig().dynamicConfig, nonExistentDigest); + } + + function test_setDynamicConfig_OnlyOwner_reverts() public { + Config memory config = _getBaseConfig(); + + vm.startPrank(address(0)); - function setUp() public virtual override { - super.setUp(); - s_rmnHome = new RMNHome(); + vm.expectRevert("Only callable by owner"); + s_rmnHome.setDynamicConfig(config.dynamicConfig, keccak256("configDigest")); } } diff --git a/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go b/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go index 60de3dcdac..c0c6857c73 100644 --- a/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go +++ b/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go @@ -83,7 +83,7 @@ type TokenPoolChainUpdate struct { var BurnWithFromMintTokenPoolAndProxyMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"oldPool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"newPool\",\"type\":\"address\"}],\"name\":\"LegacyPoolChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getOnRamp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"onRampAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPreviousPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"prevPool\",\"type\":\"address\"}],\"name\":\"setPreviousPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60e06040523480156200001157600080fd5b5060405162004dda38038062004dda8339810160408190526200003491620008cc565b83838383838383833380600081620000935760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c657620000c6816200019b565b5050506001600160a01b0384161580620000e757506001600160a01b038116155b80620000fa57506001600160a01b038216155b1562000119576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016c576040805160008152602081019091526200016c908462000246565b50620001919650506001600160a01b038a169450309350600019925050620003a39050565b5050505062000b08565b336001600160a01b03821603620001f55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c05162000267576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002f25760008382815181106200028b576200028b620009dc565b60209081029190910101519050620002a560028262000489565b15620002e8576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200026a565b5060005b81518110156200039e576000828281518110620003175762000317620009dc565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000343575062000395565b62000350600282620004a9565b1562000393576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002f6565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620003f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041b9190620009f2565b62000427919062000a22565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091529192506200048391869190620004c016565b50505050565b6000620004a0836001600160a01b03841662000591565b90505b92915050565b6000620004a0836001600160a01b03841662000695565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201526000906200050f906001600160a01b038516908490620006e7565b8051909150156200039e578080602001905181019062000530919062000a38565b6200039e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200008a565b600081815260018301602052604081205480156200068a576000620005b860018362000a63565b8554909150600090620005ce9060019062000a63565b90508082146200063a576000866000018281548110620005f257620005f2620009dc565b9060005260206000200154905080876000018481548110620006185762000618620009dc565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200064e576200064e62000a79565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620004a3565b6000915050620004a3565b6000818152600183016020526040812054620006de57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004a3565b506000620004a3565b6060620006f8848460008562000700565b949350505050565b606082471015620007635760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200008a565b600080866001600160a01b0316858760405162000781919062000ab5565b60006040518083038185875af1925050503d8060008114620007c0576040519150601f19603f3d011682016040523d82523d6000602084013e620007c5565b606091505b509092509050620007d987838387620007e4565b979650505050505050565b606083156200085857825160000362000850576001600160a01b0385163b620008505760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200008a565b5081620006f8565b620006f883838151156200086f5781518083602001fd5b8060405162461bcd60e51b81526004016200008a919062000ad3565b6001600160a01b0381168114620008a157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620008c7816200088b565b919050565b60008060008060808587031215620008e357600080fd5b8451620008f0816200088b565b602086810151919550906001600160401b03808211156200091057600080fd5b818801915088601f8301126200092557600080fd5b8151818111156200093a576200093a620008a4565b8060051b604051601f19603f83011681018181108582111715620009625762000962620008a4565b60405291825284820192508381018501918b8311156200098157600080fd5b938501935b82851015620009aa576200099a85620008ba565b8452938501939285019262000986565b809850505050505050620009c160408601620008ba565b9150620009d160608601620008ba565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b60006020828403121562000a0557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115620004a357620004a362000a0c565b60006020828403121562000a4b57600080fd5b8151801515811462000a5c57600080fd5b9392505050565b81810381811115620004a357620004a362000a0c565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000aac57818101518382015260200162000a92565b50506000910152565b6000825162000ac981846020870162000a8f565b9190910192915050565b602081526000825180602084015262000af481604085016020870162000a8f565b601f01601f19169190910160400192915050565b60805160a05160c05161424e62000b8c6000396000818161052c01528181611ad60152612528015260008181610506015281816118690152611d89015260008181610231015281816102860152818161076801528181610df40152818161178901528181611ca901528181611e8f015281816124be0152612713015261424e6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639a4575b911610104578063c0d78655116100a2578063db6327dc11610071578063db6327dc146104f1578063dc0bd97114610504578063e0351e131461052a578063f2fde38b1461055057600080fd5b8063c0d78655146104a3578063c4bffe2b146104b6578063c75eea9c146104cb578063cf7401f3146104de57600080fd5b8063a8d87a3b116100de578063a8d87a3b146103f0578063af58d59f14610403578063b0f479a114610472578063b79465801461049057600080fd5b80639a4575b91461039d578063a2b261d8146103bd578063a7cd63b7146103db57600080fd5b80636d3d1a581161017c57806383826b2b1161014b57806383826b2b146103465780638926f54f146103595780638da5cb5b1461036c5780639766b9321461038a57600080fd5b80636d3d1a58146102fa57806378a010b21461031857806379ba50971461032b5780637d54534e1461033357600080fd5b806321df0da7116101b857806321df0da71461022f578063240028e81461027657806339077537146102c357806354c8a4f3146102e557600080fd5b806301ffc9a7146101df5780630a2fd49314610207578063181f5a7714610227575b600080fd5b6101f26101ed3660046131c0565b610563565b60405190151581526020015b60405180910390f35b61021a61021536600461321f565b610648565b6040516101fe91906132a8565b61021a6106f8565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b6101f26102843660046132e8565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102d66102d1366004613305565b610714565b604051905181526020016101fe565b6102f86102f336600461338d565b6108cc565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610251565b6102f86103263660046133f9565b610947565b6102f8610abb565b6102f86103413660046132e8565b610bb8565b6101f261035436600461347c565b610c07565b6101f261036736600461321f565b610cd4565b60005473ffffffffffffffffffffffffffffffffffffffff16610251565b6102f86103983660046132e8565b610ceb565b6103b06103ab3660046134b3565b610d7a565b6040516101fe91906134ee565b60095473ffffffffffffffffffffffffffffffffffffffff16610251565b6103e3610ef0565b6040516101fe919061354e565b6102516103fe36600461321f565b503090565b61041661041136600461321f565b610f01565b6040516101fe919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610251565b61021a61049e36600461321f565b610fd6565b6102f86104b13660046132e8565b611001565b6104be6110d5565b6040516101fe91906135a8565b6104166104d936600461321f565b61118d565b6102f86104ec36600461375f565b61125f565b6102f86104ff3660046137a4565b6112e8565b7f0000000000000000000000000000000000000000000000000000000000000000610251565b7f00000000000000000000000000000000000000000000000000000000000000006101f2565b6102f861055e3660046132e8565b61176e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806105f657507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061064257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff81166000908152600760205260409020600401805460609190610673906137e6565b80601f016020809104026020016040519081016040528092919081815260200182805461069f906137e6565b80156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b50505050509050919050565b60405180606001604052806023815260200161421f6023913981565b60408051602081019091526000815261073461072f836138d5565b611782565b60095473ffffffffffffffffffffffffffffffffffffffff1661082a5773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f1961079d60608501604086016132e8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b5050505061083b565b61083b610836836138d5565b6119b3565b61084b60608301604084016132e8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f084606001356040516108ad91815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108d4611a51565b61094184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611ad492505050565b50505050565b61094f611a51565b61095883610cd4565b61099f576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109c6906137e6565b80601f01602080910402602001604051908101604052809291908181526020018280546109f2906137e6565b8015610a3f5780601f10610a1457610100808354040283529160200191610a3f565b820191906000526020600020905b815481529060010190602001808311610a2257829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610a6e838583613a1a565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610aad93929190613b34565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610996565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610bc0611a51565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff8216301480610ccd5750600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169281019290925273ffffffffffffffffffffffffffffffffffffffff848116602484015216906383826b2b90604401602060405180830381865afa158015610ca9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccd9190613b98565b9392505050565b6000610642600567ffffffffffffffff8416611c8a565b610cf3611a51565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f22891015b60405180910390a15050565b6040805180820190915260608082526020820152610d9f610d9a83613bb5565b611ca2565b60095473ffffffffffffffffffffffffffffffffffffffff16610e6a576040517f79cc6790000000000000000000000000000000000000000000000000000000008152306004820152606083013560248201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906379cc679090604401600060405180830381600087803b158015610e4d57600080fd5b505af1158015610e61573d6000803e3d6000fd5b50505050610e7b565b610e7b610e7683613bb5565b611e6c565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610ed584602001602081019061049e919061321f565b81526040805160208181019092526000815291015292915050565b6060610efc6002611f86565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261064290611f93565b67ffffffffffffffff81166000908152600760205260409020600501805460609190610673906137e6565b611009611a51565b73ffffffffffffffffffffffffffffffffffffffff8116611056576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610d6e565b606060006110e36005611f86565b90506000815167ffffffffffffffff811115611101576111016135ea565b60405190808252806020026020018201604052801561112a578160200160208202803683370190505b50905060005b82518110156111865782818151811061114b5761114b613c57565b602002602001015182828151811061116557611165613c57565b67ffffffffffffffff90921660209283029190910190910152600101611130565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261064290611f93565b60085473ffffffffffffffffffffffffffffffffffffffff16331480159061129f575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156112d8576040517f8e4a23d6000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b6112e3838383612045565b505050565b6112f0611a51565b60005b818110156112e357600083838381811061130f5761130f613c57565b90506020028101906113219190613c86565b61132a90613cc4565b905061133f816080015182602001511561212f565b6113528160a0015182602001511561212f565b80602001511561164e5780516113749060059067ffffffffffffffff16612268565b6113b95780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610996565b60408101515115806113ce5750606081015151155b15611405576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906115e69082613d78565b50606082015160058201906115fb9082613d78565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506116419493929190613e92565b60405180910390a1611765565b80516116669060059067ffffffffffffffff16612274565b6116ab5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610996565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906117146004830182613172565b611722600583016000613172565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b506001016112f3565b611776611a51565b61177f81612280565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146118175760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610996565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa1580156118c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e99190613b98565b15611920576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61192d8160200151612375565b600061193c8260200151610648565b9050805160001480611960575080805190602001208260a001518051906020012014155b1561199d578160a001516040517f24eb47e500000000000000000000000000000000000000000000000000000000815260040161099691906132a8565b6119af8260200151836060015161249b565b5050565b60095481516040808401516060850151602086015192517f8627fad600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694638627fad694611a1c9490939291600401613f2b565b600060405180830381600087803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ad2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610996565b565b7f0000000000000000000000000000000000000000000000000000000000000000611b2b576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611bc1576000838281518110611b4b57611b4b613c57565b60200260200101519050611b698160026124e290919063ffffffff16565b15611bb85760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611b2e565b5060005b81518110156112e3576000828281518110611be257611be2613c57565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c265750611c82565b611c31600282612504565b15611c805760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611bc5565b60008181526001830160205260408120541515610ccd565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611d375760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610996565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611de5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e099190613b98565b15611e40576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e4d8160400151612526565b611e5a81602001516125a5565b61177f816020015182606001516126f3565b6009546060820151611eb99173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911690612737565b60095460408083015183516060850151602086015193517f9687544500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694639687544594611f2194939291600401613f8c565b6000604051808303816000875af1158015611f40573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119af9190810190613fec565b60606000610ccd836127c4565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261202182606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426120059190614089565b85608001516fffffffffffffffffffffffffffffffff1661281f565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61204e83610cd4565b612090576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610996565b61209b82600061212f565b67ffffffffffffffff831660009081526007602052604090206120be9083612849565b6120c981600061212f565b67ffffffffffffffff831660009081526007602052604090206120ef9060020182612849565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b8383836040516121229392919061409c565b60405180910390a1505050565b8151156121f65781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580612185575060408201516fffffffffffffffffffffffffffffffff16155b156121be57816040517f8020d124000000000000000000000000000000000000000000000000000000008152600401610996919061411f565b80156119af576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff1615158061222f575060208201516fffffffffffffffffffffffffffffffff1615155b156119af57816040517fd68af9cc000000000000000000000000000000000000000000000000000000008152600401610996919061411f565b6000610ccd83836129eb565b6000610ccd8383612a3a565b3373ffffffffffffffffffffffffffffffffffffffff8216036122ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610996565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61237e81610cd4565b6123c0576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610996565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa15801561243f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124639190613b98565b61177f576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b67ffffffffffffffff821660009081526007602052604090206119af90600201827f0000000000000000000000000000000000000000000000000000000000000000612b2d565b6000610ccd8373ffffffffffffffffffffffffffffffffffffffff8416612a3a565b6000610ccd8373ffffffffffffffffffffffffffffffffffffffff84166129eb565b7f00000000000000000000000000000000000000000000000000000000000000001561177f57612557600282612eb0565b61177f576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610996565b6125ae81610cd4565b6125f0576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610996565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015612669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268d919061415b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461177f576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b67ffffffffffffffff821660009081526007602052604090206119af90827f0000000000000000000000000000000000000000000000000000000000000000612b2d565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526112e3908490612edf565b6060816000018054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b8154815260200190600101908083116128005750505050509050919050565b600061283e8561282f8486614178565b612839908761418f565b612feb565b90505b949350505050565b815460009061287290700100000000000000000000000000000000900463ffffffff1642614089565b9050801561291457600183015483546128ba916fffffffffffffffffffffffffffffffff8082169281169185917001000000000000000000000000000000009091041661281f565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461293a916fffffffffffffffffffffffffffffffff9081169116612feb565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061212290849061411f565b6000818152600183016020526040812054612a3257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610642565b506000610642565b60008181526001830160205260408120548015612b23576000612a5e600183614089565b8554909150600090612a7290600190614089565b9050808214612ad7576000866000018281548110612a9257612a92613c57565b9060005260206000200154905080876000018481548110612ab557612ab5613c57565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612ae857612ae86141a2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610642565b6000915050610642565b825474010000000000000000000000000000000000000000900460ff161580612b54575081155b15612b5e57505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612ba490700100000000000000000000000000000000900463ffffffff1642614089565b90508015612c645781831115612be6576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612c209083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661281f565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612d1b5773ffffffffffffffffffffffffffffffffffffffff8416612cc3576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610996565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610996565b84831015612e2e5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612d5f9082614089565b612d69878a614089565b612d73919061418f565b612d7d91906141d1565b905073ffffffffffffffffffffffffffffffffffffffff8616612dd6576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610996565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610996565b612e388584614089565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610ccd565b6000612f41826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166130019092919063ffffffff16565b8051909150156112e35780806020019051810190612f5f9190613b98565b6112e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610996565b6000818310612ffa5781610ccd565b5090919050565b60606128418484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051613035919061420c565b60006040518083038185875af1925050503d8060008114613072576040519150601f19603f3d011682016040523d82523d6000602084013e613077565b606091505b509150915061308887838387613093565b979650505050505050565b606083156131295782516000036131225773ffffffffffffffffffffffffffffffffffffffff85163b613122576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610996565b5081612841565b612841838381511561313e5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099691906132a8565b50805461317e906137e6565b6000825580601f1061318e575050565b601f01602090049060005260206000209081019061177f91905b808211156131bc57600081556001016131a8565b5090565b6000602082840312156131d257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ccd57600080fd5b803567ffffffffffffffff8116811461321a57600080fd5b919050565b60006020828403121561323157600080fd5b610ccd82613202565b60005b8381101561325557818101518382015260200161323d565b50506000910152565b6000815180845261327681602086016020860161323a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ccd602083018461325e565b73ffffffffffffffffffffffffffffffffffffffff8116811461177f57600080fd5b803561321a816132bb565b6000602082840312156132fa57600080fd5b8135610ccd816132bb565b60006020828403121561331757600080fd5b813567ffffffffffffffff81111561332e57600080fd5b82016101008185031215610ccd57600080fd5b60008083601f84011261335357600080fd5b50813567ffffffffffffffff81111561336b57600080fd5b6020830191508360208260051b850101111561338657600080fd5b9250929050565b600080600080604085870312156133a357600080fd5b843567ffffffffffffffff808211156133bb57600080fd5b6133c788838901613341565b909650945060208701359150808211156133e057600080fd5b506133ed87828801613341565b95989497509550505050565b60008060006040848603121561340e57600080fd5b61341784613202565b9250602084013567ffffffffffffffff8082111561343457600080fd5b818601915086601f83011261344857600080fd5b81358181111561345757600080fd5b87602082850101111561346957600080fd5b6020830194508093505050509250925092565b6000806040838503121561348f57600080fd5b61349883613202565b915060208301356134a8816132bb565b809150509250929050565b6000602082840312156134c557600080fd5b813567ffffffffffffffff8111156134dc57600080fd5b820160a08185031215610ccd57600080fd5b60208152600082516040602084015261350a606084018261325e565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152613545828261325e565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561359c57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161356a565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561359c57835167ffffffffffffffff16835292840192918401916001016135c4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff8111828210171561363d5761363d6135ea565b60405290565b60405160c0810167ffffffffffffffff8111828210171561363d5761363d6135ea565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156136ad576136ad6135ea565b604052919050565b801515811461177f57600080fd5b803561321a816136b5565b80356fffffffffffffffffffffffffffffffff8116811461321a57600080fd5b60006060828403121561370057600080fd5b6040516060810181811067ffffffffffffffff82111715613723576137236135ea565b6040529050808235613734816136b5565b8152613742602084016136ce565b6020820152613753604084016136ce565b60408201525092915050565b600080600060e0848603121561377457600080fd5b61377d84613202565b925061378c85602086016136ee565b915061379b85608086016136ee565b90509250925092565b600080602083850312156137b757600080fd5b823567ffffffffffffffff8111156137ce57600080fd5b6137da85828601613341565b90969095509350505050565b600181811c908216806137fa57607f821691505b602082108103613833577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600067ffffffffffffffff821115613853576138536135ea565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261389057600080fd5b81356138a361389e82613839565b613666565b8181528460208386010111156138b857600080fd5b816020850160208301376000918101602001919091529392505050565b600061010082360312156138e857600080fd5b6138f0613619565b823567ffffffffffffffff8082111561390857600080fd5b6139143683870161387f565b835261392260208601613202565b6020840152613933604086016132dd565b60408401526060850135606084015261394e608086016132dd565b608084015260a085013591508082111561396757600080fd5b6139733683870161387f565b60a084015260c085013591508082111561398c57600080fd5b6139983683870161387f565b60c084015260e08501359150808211156139b157600080fd5b506139be3682860161387f565b60e08301525092915050565b601f8211156112e3576000816000526020600020601f850160051c810160208610156139f35750805b601f850160051c820191505b81811015613a12578281556001016139ff565b505050505050565b67ffffffffffffffff831115613a3257613a326135ea565b613a4683613a4083546137e6565b836139ca565b6000601f841160018114613a985760008515613a625750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611a4a565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613ae75786850135825560209485019460019092019101613ac7565b5086821015613b22577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b604081526000613b47604083018661325e565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060208284031215613baa57600080fd5b8151610ccd816136b5565b600060a08236031215613bc757600080fd5b60405160a0810167ffffffffffffffff8282108183111715613beb57613beb6135ea565b816040528435915080821115613c0057600080fd5b50613c0d3682860161387f565b825250613c1c60208401613202565b60208201526040830135613c2f816132bb565b6040820152606083810135908201526080830135613c4c816132bb565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60006101408236031215613cd757600080fd5b613cdf613643565b613ce883613202565b8152613cf6602084016136c3565b6020820152604083013567ffffffffffffffff80821115613d1657600080fd5b613d223683870161387f565b60408401526060850135915080821115613d3b57600080fd5b50613d483682860161387f565b606083015250613d5b36608085016136ee565b6080820152613d6d3660e085016136ee565b60a082015292915050565b815167ffffffffffffffff811115613d9257613d926135ea565b613da681613da084546137e6565b846139ca565b602080601f831160018114613df95760008415613dc35750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a12565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613e4657888601518255948401946001909101908401613e27565b5085821015613e8257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152613eb68184018761325e565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff9081166060870152908701511660808501529150613ef49050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152613545565b60a081526000613f3e60a083018761325e565b73ffffffffffffffffffffffffffffffffffffffff8616602084015284604084015267ffffffffffffffff841660608401528281036080840152600081526020810191505095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815260a060208201526000613fbb60a083018661325e565b60408301949094525067ffffffffffffffff9190911660608201528082036080909101526000815260200192915050565b600060208284031215613ffe57600080fd5b815167ffffffffffffffff81111561401557600080fd5b8201601f8101841361402657600080fd5b805161403461389e82613839565b81815285602083850101111561404957600080fd5b61354582602083016020860161323a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106425761064261405a565b67ffffffffffffffff8416815260e081016140e860208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612841565b6060810161064282848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561416d57600080fd5b8151610ccd816132bb565b80820281158282048414176106425761064261405a565b808201808211156106425761064261405a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614207577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613cba81846020870161323a56fe4275726e46726f6d4d696e74546f6b656e506f6f6c416e6450726f787920312e352e30a164736f6c6343000818000a", + Bin: "0x60e06040523480156200001157600080fd5b5060405162004dde38038062004dde8339810160408190526200003491620008cc565b83838383838383833380600081620000935760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c657620000c6816200019b565b5050506001600160a01b0384161580620000e757506001600160a01b038116155b80620000fa57506001600160a01b038216155b1562000119576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016c576040805160008152602081019091526200016c908462000246565b50620001919650506001600160a01b038a169450309350600019925050620003a39050565b5050505062000b08565b336001600160a01b03821603620001f55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c05162000267576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002f25760008382815181106200028b576200028b620009dc565b60209081029190910101519050620002a560028262000489565b15620002e8576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200026a565b5060005b81518110156200039e576000828281518110620003175762000317620009dc565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000343575062000395565b62000350600282620004a9565b1562000393576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002f6565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620003f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041b9190620009f2565b62000427919062000a22565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091529192506200048391869190620004c016565b50505050565b6000620004a0836001600160a01b03841662000591565b90505b92915050565b6000620004a0836001600160a01b03841662000695565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201526000906200050f906001600160a01b038516908490620006e7565b8051909150156200039e578080602001905181019062000530919062000a38565b6200039e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200008a565b600081815260018301602052604081205480156200068a576000620005b860018362000a63565b8554909150600090620005ce9060019062000a63565b90508082146200063a576000866000018281548110620005f257620005f2620009dc565b9060005260206000200154905080876000018481548110620006185762000618620009dc565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200064e576200064e62000a79565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620004a3565b6000915050620004a3565b6000818152600183016020526040812054620006de57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004a3565b506000620004a3565b6060620006f8848460008562000700565b949350505050565b606082471015620007635760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200008a565b600080866001600160a01b0316858760405162000781919062000ab5565b60006040518083038185875af1925050503d8060008114620007c0576040519150601f19603f3d011682016040523d82523d6000602084013e620007c5565b606091505b509092509050620007d987838387620007e4565b979650505050505050565b606083156200085857825160000362000850576001600160a01b0385163b620008505760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200008a565b5081620006f8565b620006f883838151156200086f5781518083602001fd5b8060405162461bcd60e51b81526004016200008a919062000ad3565b6001600160a01b0381168114620008a157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620008c7816200088b565b919050565b60008060008060808587031215620008e357600080fd5b8451620008f0816200088b565b602086810151919550906001600160401b03808211156200091057600080fd5b818801915088601f8301126200092557600080fd5b8151818111156200093a576200093a620008a4565b8060051b604051601f19603f83011681018181108582111715620009625762000962620008a4565b60405291825284820192508381018501918b8311156200098157600080fd5b938501935b82851015620009aa576200099a85620008ba565b8452938501939285019262000986565b809850505050505050620009c160408601620008ba565b9150620009d160608601620008ba565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b60006020828403121562000a0557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115620004a357620004a362000a0c565b60006020828403121562000a4b57600080fd5b8151801515811462000a5c57600080fd5b9392505050565b81810381811115620004a357620004a362000a0c565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000aac57818101518382015260200162000a92565b50506000910152565b6000825162000ac981846020870162000a8f565b9190910192915050565b602081526000825180602084015262000af481604085016020870162000a8f565b601f01601f19169190910160400192915050565b60805160a05160c05161425262000b8c6000396000818161052c01528181611ad60152612528015260008181610506015281816118690152611d89015260008181610231015281816102860152818161076801528181610df40152818161178901528181611ca901528181611e8f015281816124be015261271301526142526000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639a4575b911610104578063c0d78655116100a2578063db6327dc11610071578063db6327dc146104f1578063dc0bd97114610504578063e0351e131461052a578063f2fde38b1461055057600080fd5b8063c0d78655146104a3578063c4bffe2b146104b6578063c75eea9c146104cb578063cf7401f3146104de57600080fd5b8063a8d87a3b116100de578063a8d87a3b146103f0578063af58d59f14610403578063b0f479a114610472578063b79465801461049057600080fd5b80639a4575b91461039d578063a2b261d8146103bd578063a7cd63b7146103db57600080fd5b80636d3d1a581161017c57806383826b2b1161014b57806383826b2b146103465780638926f54f146103595780638da5cb5b1461036c5780639766b9321461038a57600080fd5b80636d3d1a58146102fa57806378a010b21461031857806379ba50971461032b5780637d54534e1461033357600080fd5b806321df0da7116101b857806321df0da71461022f578063240028e81461027657806339077537146102c357806354c8a4f3146102e557600080fd5b806301ffc9a7146101df5780630a2fd49314610207578063181f5a7714610227575b600080fd5b6101f26101ed3660046131c0565b610563565b60405190151581526020015b60405180910390f35b61021a61021536600461321f565b610648565b6040516101fe91906132a8565b61021a6106f8565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b6101f26102843660046132e8565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102d66102d1366004613305565b610714565b604051905181526020016101fe565b6102f86102f336600461338d565b6108cc565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610251565b6102f86103263660046133f9565b610947565b6102f8610abb565b6102f86103413660046132e8565b610bb8565b6101f261035436600461347c565b610c07565b6101f261036736600461321f565b610cd4565b60005473ffffffffffffffffffffffffffffffffffffffff16610251565b6102f86103983660046132e8565b610ceb565b6103b06103ab3660046134b3565b610d7a565b6040516101fe91906134ee565b60095473ffffffffffffffffffffffffffffffffffffffff16610251565b6103e3610ef0565b6040516101fe919061354e565b6102516103fe36600461321f565b503090565b61041661041136600461321f565b610f01565b6040516101fe919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610251565b61021a61049e36600461321f565b610fd6565b6102f86104b13660046132e8565b611001565b6104be6110d5565b6040516101fe91906135a8565b6104166104d936600461321f565b61118d565b6102f86104ec36600461375f565b61125f565b6102f86104ff3660046137a4565b6112e8565b7f0000000000000000000000000000000000000000000000000000000000000000610251565b7f00000000000000000000000000000000000000000000000000000000000000006101f2565b6102f861055e3660046132e8565b61176e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806105f657507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061064257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff81166000908152600760205260409020600401805460609190610673906137e6565b80601f016020809104026020016040519081016040528092919081815260200182805461069f906137e6565b80156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b50505050509050919050565b60405180606001604052806027815260200161421f6027913981565b60408051602081019091526000815261073461072f836138d5565b611782565b60095473ffffffffffffffffffffffffffffffffffffffff1661082a5773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f1961079d60608501604086016132e8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b5050505061083b565b61083b610836836138d5565b6119b3565b61084b60608301604084016132e8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f084606001356040516108ad91815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108d4611a51565b61094184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611ad492505050565b50505050565b61094f611a51565b61095883610cd4565b61099f576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109c6906137e6565b80601f01602080910402602001604051908101604052809291908181526020018280546109f2906137e6565b8015610a3f5780601f10610a1457610100808354040283529160200191610a3f565b820191906000526020600020905b815481529060010190602001808311610a2257829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610a6e838583613a1a565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610aad93929190613b34565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610996565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610bc0611a51565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff8216301480610ccd5750600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169281019290925273ffffffffffffffffffffffffffffffffffffffff848116602484015216906383826b2b90604401602060405180830381865afa158015610ca9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccd9190613b98565b9392505050565b6000610642600567ffffffffffffffff8416611c8a565b610cf3611a51565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f22891015b60405180910390a15050565b6040805180820190915260608082526020820152610d9f610d9a83613bb5565b611ca2565b60095473ffffffffffffffffffffffffffffffffffffffff16610e6a576040517f79cc6790000000000000000000000000000000000000000000000000000000008152306004820152606083013560248201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906379cc679090604401600060405180830381600087803b158015610e4d57600080fd5b505af1158015610e61573d6000803e3d6000fd5b50505050610e7b565b610e7b610e7683613bb5565b611e6c565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610ed584602001602081019061049e919061321f565b81526040805160208181019092526000815291015292915050565b6060610efc6002611f86565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261064290611f93565b67ffffffffffffffff81166000908152600760205260409020600501805460609190610673906137e6565b611009611a51565b73ffffffffffffffffffffffffffffffffffffffff8116611056576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610d6e565b606060006110e36005611f86565b90506000815167ffffffffffffffff811115611101576111016135ea565b60405190808252806020026020018201604052801561112a578160200160208202803683370190505b50905060005b82518110156111865782818151811061114b5761114b613c57565b602002602001015182828151811061116557611165613c57565b67ffffffffffffffff90921660209283029190910190910152600101611130565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261064290611f93565b60085473ffffffffffffffffffffffffffffffffffffffff16331480159061129f575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156112d8576040517f8e4a23d6000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b6112e3838383612045565b505050565b6112f0611a51565b60005b818110156112e357600083838381811061130f5761130f613c57565b90506020028101906113219190613c86565b61132a90613cc4565b905061133f816080015182602001511561212f565b6113528160a0015182602001511561212f565b80602001511561164e5780516113749060059067ffffffffffffffff16612268565b6113b95780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610996565b60408101515115806113ce5750606081015151155b15611405576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906115e69082613d78565b50606082015160058201906115fb9082613d78565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506116419493929190613e92565b60405180910390a1611765565b80516116669060059067ffffffffffffffff16612274565b6116ab5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610996565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906117146004830182613172565b611722600583016000613172565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b506001016112f3565b611776611a51565b61177f81612280565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146118175760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610996565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa1580156118c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e99190613b98565b15611920576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61192d8160200151612375565b600061193c8260200151610648565b9050805160001480611960575080805190602001208260a001518051906020012014155b1561199d578160a001516040517f24eb47e500000000000000000000000000000000000000000000000000000000815260040161099691906132a8565b6119af8260200151836060015161249b565b5050565b60095481516040808401516060850151602086015192517f8627fad600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694638627fad694611a1c9490939291600401613f2b565b600060405180830381600087803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ad2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610996565b565b7f0000000000000000000000000000000000000000000000000000000000000000611b2b576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611bc1576000838281518110611b4b57611b4b613c57565b60200260200101519050611b698160026124e290919063ffffffff16565b15611bb85760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611b2e565b5060005b81518110156112e3576000828281518110611be257611be2613c57565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c265750611c82565b611c31600282612504565b15611c805760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611bc5565b60008181526001830160205260408120541515610ccd565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611d375760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610996565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611de5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e099190613b98565b15611e40576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e4d8160400151612526565b611e5a81602001516125a5565b61177f816020015182606001516126f3565b6009546060820151611eb99173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911690612737565b60095460408083015183516060850151602086015193517f9687544500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694639687544594611f2194939291600401613f8c565b6000604051808303816000875af1158015611f40573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119af9190810190613fec565b60606000610ccd836127c4565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261202182606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426120059190614089565b85608001516fffffffffffffffffffffffffffffffff1661281f565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61204e83610cd4565b612090576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610996565b61209b82600061212f565b67ffffffffffffffff831660009081526007602052604090206120be9083612849565b6120c981600061212f565b67ffffffffffffffff831660009081526007602052604090206120ef9060020182612849565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b8383836040516121229392919061409c565b60405180910390a1505050565b8151156121f65781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580612185575060408201516fffffffffffffffffffffffffffffffff16155b156121be57816040517f8020d124000000000000000000000000000000000000000000000000000000008152600401610996919061411f565b80156119af576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff1615158061222f575060208201516fffffffffffffffffffffffffffffffff1615155b156119af57816040517fd68af9cc000000000000000000000000000000000000000000000000000000008152600401610996919061411f565b6000610ccd83836129eb565b6000610ccd8383612a3a565b3373ffffffffffffffffffffffffffffffffffffffff8216036122ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610996565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61237e81610cd4565b6123c0576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610996565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa15801561243f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124639190613b98565b61177f576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b67ffffffffffffffff821660009081526007602052604090206119af90600201827f0000000000000000000000000000000000000000000000000000000000000000612b2d565b6000610ccd8373ffffffffffffffffffffffffffffffffffffffff8416612a3a565b6000610ccd8373ffffffffffffffffffffffffffffffffffffffff84166129eb565b7f00000000000000000000000000000000000000000000000000000000000000001561177f57612557600282612eb0565b61177f576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610996565b6125ae81610cd4565b6125f0576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610996565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015612669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268d919061415b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461177f576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b67ffffffffffffffff821660009081526007602052604090206119af90827f0000000000000000000000000000000000000000000000000000000000000000612b2d565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526112e3908490612edf565b6060816000018054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b8154815260200190600101908083116128005750505050509050919050565b600061283e8561282f8486614178565b612839908761418f565b612feb565b90505b949350505050565b815460009061287290700100000000000000000000000000000000900463ffffffff1642614089565b9050801561291457600183015483546128ba916fffffffffffffffffffffffffffffffff8082169281169185917001000000000000000000000000000000009091041661281f565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461293a916fffffffffffffffffffffffffffffffff9081169116612feb565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061212290849061411f565b6000818152600183016020526040812054612a3257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610642565b506000610642565b60008181526001830160205260408120548015612b23576000612a5e600183614089565b8554909150600090612a7290600190614089565b9050808214612ad7576000866000018281548110612a9257612a92613c57565b9060005260206000200154905080876000018481548110612ab557612ab5613c57565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612ae857612ae86141a2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610642565b6000915050610642565b825474010000000000000000000000000000000000000000900460ff161580612b54575081155b15612b5e57505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612ba490700100000000000000000000000000000000900463ffffffff1642614089565b90508015612c645781831115612be6576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612c209083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661281f565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612d1b5773ffffffffffffffffffffffffffffffffffffffff8416612cc3576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610996565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610996565b84831015612e2e5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612d5f9082614089565b612d69878a614089565b612d73919061418f565b612d7d91906141d1565b905073ffffffffffffffffffffffffffffffffffffffff8616612dd6576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610996565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610996565b612e388584614089565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610ccd565b6000612f41826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166130019092919063ffffffff16565b8051909150156112e35780806020019051810190612f5f9190613b98565b6112e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610996565b6000818310612ffa5781610ccd565b5090919050565b60606128418484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051613035919061420c565b60006040518083038185875af1925050503d8060008114613072576040519150601f19603f3d011682016040523d82523d6000602084013e613077565b606091505b509150915061308887838387613093565b979650505050505050565b606083156131295782516000036131225773ffffffffffffffffffffffffffffffffffffffff85163b613122576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610996565b5081612841565b612841838381511561313e5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099691906132a8565b50805461317e906137e6565b6000825580601f1061318e575050565b601f01602090049060005260206000209081019061177f91905b808211156131bc57600081556001016131a8565b5090565b6000602082840312156131d257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ccd57600080fd5b803567ffffffffffffffff8116811461321a57600080fd5b919050565b60006020828403121561323157600080fd5b610ccd82613202565b60005b8381101561325557818101518382015260200161323d565b50506000910152565b6000815180845261327681602086016020860161323a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ccd602083018461325e565b73ffffffffffffffffffffffffffffffffffffffff8116811461177f57600080fd5b803561321a816132bb565b6000602082840312156132fa57600080fd5b8135610ccd816132bb565b60006020828403121561331757600080fd5b813567ffffffffffffffff81111561332e57600080fd5b82016101008185031215610ccd57600080fd5b60008083601f84011261335357600080fd5b50813567ffffffffffffffff81111561336b57600080fd5b6020830191508360208260051b850101111561338657600080fd5b9250929050565b600080600080604085870312156133a357600080fd5b843567ffffffffffffffff808211156133bb57600080fd5b6133c788838901613341565b909650945060208701359150808211156133e057600080fd5b506133ed87828801613341565b95989497509550505050565b60008060006040848603121561340e57600080fd5b61341784613202565b9250602084013567ffffffffffffffff8082111561343457600080fd5b818601915086601f83011261344857600080fd5b81358181111561345757600080fd5b87602082850101111561346957600080fd5b6020830194508093505050509250925092565b6000806040838503121561348f57600080fd5b61349883613202565b915060208301356134a8816132bb565b809150509250929050565b6000602082840312156134c557600080fd5b813567ffffffffffffffff8111156134dc57600080fd5b820160a08185031215610ccd57600080fd5b60208152600082516040602084015261350a606084018261325e565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152613545828261325e565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561359c57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161356a565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561359c57835167ffffffffffffffff16835292840192918401916001016135c4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff8111828210171561363d5761363d6135ea565b60405290565b60405160c0810167ffffffffffffffff8111828210171561363d5761363d6135ea565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156136ad576136ad6135ea565b604052919050565b801515811461177f57600080fd5b803561321a816136b5565b80356fffffffffffffffffffffffffffffffff8116811461321a57600080fd5b60006060828403121561370057600080fd5b6040516060810181811067ffffffffffffffff82111715613723576137236135ea565b6040529050808235613734816136b5565b8152613742602084016136ce565b6020820152613753604084016136ce565b60408201525092915050565b600080600060e0848603121561377457600080fd5b61377d84613202565b925061378c85602086016136ee565b915061379b85608086016136ee565b90509250925092565b600080602083850312156137b757600080fd5b823567ffffffffffffffff8111156137ce57600080fd5b6137da85828601613341565b90969095509350505050565b600181811c908216806137fa57607f821691505b602082108103613833577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600067ffffffffffffffff821115613853576138536135ea565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261389057600080fd5b81356138a361389e82613839565b613666565b8181528460208386010111156138b857600080fd5b816020850160208301376000918101602001919091529392505050565b600061010082360312156138e857600080fd5b6138f0613619565b823567ffffffffffffffff8082111561390857600080fd5b6139143683870161387f565b835261392260208601613202565b6020840152613933604086016132dd565b60408401526060850135606084015261394e608086016132dd565b608084015260a085013591508082111561396757600080fd5b6139733683870161387f565b60a084015260c085013591508082111561398c57600080fd5b6139983683870161387f565b60c084015260e08501359150808211156139b157600080fd5b506139be3682860161387f565b60e08301525092915050565b601f8211156112e3576000816000526020600020601f850160051c810160208610156139f35750805b601f850160051c820191505b81811015613a12578281556001016139ff565b505050505050565b67ffffffffffffffff831115613a3257613a326135ea565b613a4683613a4083546137e6565b836139ca565b6000601f841160018114613a985760008515613a625750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611a4a565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613ae75786850135825560209485019460019092019101613ac7565b5086821015613b22577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b604081526000613b47604083018661325e565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060208284031215613baa57600080fd5b8151610ccd816136b5565b600060a08236031215613bc757600080fd5b60405160a0810167ffffffffffffffff8282108183111715613beb57613beb6135ea565b816040528435915080821115613c0057600080fd5b50613c0d3682860161387f565b825250613c1c60208401613202565b60208201526040830135613c2f816132bb565b6040820152606083810135908201526080830135613c4c816132bb565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60006101408236031215613cd757600080fd5b613cdf613643565b613ce883613202565b8152613cf6602084016136c3565b6020820152604083013567ffffffffffffffff80821115613d1657600080fd5b613d223683870161387f565b60408401526060850135915080821115613d3b57600080fd5b50613d483682860161387f565b606083015250613d5b36608085016136ee565b6080820152613d6d3660e085016136ee565b60a082015292915050565b815167ffffffffffffffff811115613d9257613d926135ea565b613da681613da084546137e6565b846139ca565b602080601f831160018114613df95760008415613dc35750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a12565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613e4657888601518255948401946001909101908401613e27565b5085821015613e8257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152613eb68184018761325e565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff9081166060870152908701511660808501529150613ef49050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152613545565b60a081526000613f3e60a083018761325e565b73ffffffffffffffffffffffffffffffffffffffff8616602084015284604084015267ffffffffffffffff841660608401528281036080840152600081526020810191505095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815260a060208201526000613fbb60a083018661325e565b60408301949094525067ffffffffffffffff9190911660608201528082036080909101526000815260200192915050565b600060208284031215613ffe57600080fd5b815167ffffffffffffffff81111561401557600080fd5b8201601f8101841361402657600080fd5b805161403461389e82613839565b81815285602083850101111561404957600080fd5b61354582602083016020860161323a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106425761064261405a565b67ffffffffffffffff8416815260e081016140e860208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612841565b6060810161064282848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561416d57600080fd5b8151610ccd816132bb565b80820281158282048414176106425761064261405a565b808201808211156106425761064261405a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614207577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613cba81846020870161323a56fe4275726e5769746846726f6d4d696e74546f6b656e506f6f6c416e6450726f787920312e352e30a164736f6c6343000818000a", } var BurnWithFromMintTokenPoolAndProxyABI = BurnWithFromMintTokenPoolAndProxyMetaData.ABI 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 d13dadc2b0..0000000000 --- a/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go +++ /dev/null @@ -1,1304 +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 - RmnHomeAddress []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\":\"RMNHomeAddressCannotBeZero\",\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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: "0x60a06040523480156200001157600080fd5b5060405162004367380380620043678339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051614165620002026000396000818161010301528181610eee015261115e01526141656000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638318ed5d11610081578063f2fde38b1161005b578063f2fde38b14610230578063f442c89a14610243578063fba64a7c1461025657600080fd5b80638318ed5d146101d15780638da5cb5b146101f2578063b74b23561461021057600080fd5b80634bd0473f116100b25780634bd0473f1461019157806379ba5097146101b15780637ac0d41e146101bb57600080fd5b806301ffc9a7146100d9578063020330e614610101578063181f5a7714610148575b600080fd5b6100ec6100e7366004612f10565b610269565b60405190151581526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f8565b6101846040518060400160405280601481526020017f43434950436f6e66696720312e362e302d64657600000000000000000000000081525081565b6040516100f89190612fb6565b6101a461019f366004612ffa565b610302565b6040516100f8919061311e565b6101b961078f565b005b6101c3610891565b6040519081526020016100f8565b6101846101df3660046132bb565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff16610123565b61022361021e3660046132d8565b6108a2565b6040516100f89190613368565b6101b961023e3660046133f8565b610b23565b6101b961025136600461347a565b610b37565b6101b96102643660046134fe565b610ed6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f78bea7210000000000000000000000000000000000000000000000000000000014806102fc57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b63ffffffff8216600090815260056020526040812060609183600181111561032c5761032c61302f565b600181111561033d5761033d61302f565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561078357600084815260209020604080516101608101909152600784029091018054829060608201908390829060ff1660018111156103b0576103b061302f565b60018111156103c1576103c161302f565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a0100000000000000000000909104166060820152600182018054608090920191610419906135bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610445906135bb565b80156104925780601f1061046757610100808354040283529160200191610492565b820191906000526020600020905b81548152906001019060200180831161047557829003601f168201915b505050505081526020016002820180546104ab906135bb565b80601f01602080910402602001604051908101604052809291908181526020018280546104d7906135bb565b80156105245780601f106104f957610100808354040283529160200191610524565b820191906000526020600020905b81548152906001019060200180831161050757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156106b257838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461058f906135bb565b80601f01602080910402602001604051908101604052809291908181526020018280546105bb906135bb565b80156106085780601f106105dd57610100808354040283529160200191610608565b820191906000526020600020905b8154815290600101906020018083116105eb57829003601f168201915b50505050508152602001600282018054610621906135bb565b80601f016020809104026020016040519081016040528092919081815260200182805461064d906135bb565b801561069a5780601f1061066f5761010080835404028352916020019161069a565b820191906000526020600020905b81548152906001019060200180831161067d57829003601f168201915b50505050508152505081526020019060010190610552565b5050505081526020016004820180546106ca906135bb565b80601f01602080910402602001604051908101604052809291908181526020018280546106f6906135bb565b80156107435780601f1061071857610100808354040283529160200191610743565b820191906000526020600020905b81548152906001019060200180831161072657829003601f168201915b505050919092525050508152600582015467ffffffffffffffff16602080830191909152600690920154604090910152908252600192909201910161036b565b50505050905092915050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610815576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600061089d6003610f91565b905090565b606060006108b06003610f91565b905060006108be848661363d565b90508315806108cd5750818110155b1561090d576040805160008082526020820190925290610903565b6108f0612cfc565b8152602001906001900390816108e85790505b50925050506102fc565b60006109198583613683565b9050828111156109265750815b60006109328383613696565b67ffffffffffffffff81111561094a5761094a613654565b60405190808252806020026020018201604052801561098357816020015b610970612cfc565b8152602001906001900390816109685790505b50905060006109926003610f9b565b9050835b83811015610b165760008282815181106109b2576109b26136a9565b60209081029190910181015160408051808201825267ffffffffffffffff831680825260009081526002855282902082518154608081880283018101909552606082018181529597509295860194909391928492849190840182828015610a3857602002820191906000526020600020905b815481526020019060010190808311610a24575b5050509183525050600182015460ff166020820152600282018054604090920191610a62906135bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8e906135bb565b8015610adb5780601f10610ab057610100808354040283529160200191610adb565b820191906000526020600020905b815481529060010190602001808311610abe57829003601f168201915b50505091909252505050905284610af28885613696565b81518110610b0257610b026136a9565b602090810291909101015250600101610996565b5090979650505050505050565b610b2b610faf565b610b3481611032565b50565b610b3f610faf565b60005b83811015610d2557610b86858583818110610b5f57610b5f6136a9565b9050602002016020810190610b7491906136d8565b60039067ffffffffffffffff16611127565b610bf057848482818110610b9c57610b9c6136a9565b9050602002016020810190610bb191906136d8565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161080c565b60026000868684818110610c0657610c066136a9565b9050602002016020810190610c1b91906136d8565b67ffffffffffffffff1681526020810191909152604001600090812090610c428282612d44565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610c7a600283016000612d62565b5050610cb8858583818110610c9157610c916136a9565b9050602002016020810190610ca691906136d8565b60039067ffffffffffffffff1661113f565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610cec57610cec6136a9565b9050602002016020810190610d0191906136d8565b60405167ffffffffffffffff909116815260200160405180910390a1600101610b42565b5060005b81811015610ecf576000838383818110610d4557610d456136a9565b9050602002810190610d5791906136f3565b610d65906020810190613731565b610d6e906138e7565b90506000848484818110610d8457610d846136a9565b9050602002810190610d9691906136f3565b610da49060208101906136d8565b9050610db3826000015161114b565b816020015160ff16600003610df4576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120835180518593610e24928492910190612d9c565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610e719082613a0f565b50610e8b91506003905067ffffffffffffffff8316611297565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051610ebd929190613b29565b60405180910390a15050600101610d29565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f45576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610f5c610f5786880188613c67565b6112a3565b8151919350915015610f7457610f74836000846114e0565b805115610f8757610f87836001836114e0565b5050505050505050565b60006102fc825490565b60606000610fa883611db9565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161080c565b565b3373ffffffffffffffffffffffffffffffffffffffff8216036110b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161080c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610fa8565b6000610fa88383611e15565b60005b81518110156112935760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe8484815181106111aa576111aa6136a9565b60200260200101516040518263ffffffff1660e01b81526004016111d091815260200190565b600060405180830381865afa1580156111ed573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526112339190810190613e8b565b608001510361128b5781818151811061124e5761124e6136a9565b60200260200101516040517f8907a4fa00000000000000000000000000000000000000000000000000000000815260040161080c91815260200190565b60010161114e565b5050565b6000610fa88383611f0f565b606080600460ff16835111156112e5576040517f8854586400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160028082526060820190925290816020015b61135b6040805161010081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff168152602001606081526020016060815260200160608152602001606081525090565b8152602001906001900390816112fb57505060408051600280825260608201909252919350602082015b6113e56040805161010081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff168152602001606081526020016060815260200160608152602001606081525090565b81526020019060019003908161138557905050905060008060005b85518110156114d357600086828151811061141d5761141d6136a9565b602002602001015160000151600181111561143a5761143a61302f565b0361148757858181518110611451576114516136a9565b602002602001015185848151811061146b5761146b6136a9565b60200260200101819052508261148090613f63565b92506114cb565b858181518110611499576114996136a9565b60200260200101518483815181106114b3576114b36136a9565b6020026020010181905250816114c890613f63565b91505b600101611400565b5090835281529092909150565b63ffffffff83166000908152600560205260408120818460018111156115085761150861302f565b60018111156115195761151961302f565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561195f57600084815260209020604080516101608101909152600784029091018054829060608201908390829060ff16600181111561158c5761158c61302f565b600181111561159d5761159d61302f565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a01000000000000000000009091041660608201526001820180546080909201916115f5906135bb565b80601f0160208091040260200160405190810160405280929190818152602001828054611621906135bb565b801561166e5780601f106116435761010080835404028352916020019161166e565b820191906000526020600020905b81548152906001019060200180831161165157829003601f168201915b50505050508152602001600282018054611687906135bb565b80601f01602080910402602001604051908101604052809291908181526020018280546116b3906135bb565b80156117005780601f106116d557610100808354040283529160200191611700565b820191906000526020600020905b8154815290600101906020018083116116e357829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b8282101561188e57838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461176b906135bb565b80601f0160208091040260200160405190810160405280929190818152602001828054611797906135bb565b80156117e45780601f106117b9576101008083540402835291602001916117e4565b820191906000526020600020905b8154815290600101906020018083116117c757829003601f168201915b505050505081526020016002820180546117fd906135bb565b80601f0160208091040260200160405190810160405280929190818152602001828054611829906135bb565b80156118765780601f1061184b57610100808354040283529160200191611876565b820191906000526020600020905b81548152906001019060200180831161185957829003601f168201915b5050505050815250508152602001906001019061172e565b5050505081526020016004820180546118a6906135bb565b80601f01602080910402602001604051908101604052809291908181526020018280546118d2906135bb565b801561191f5780601f106118f45761010080835404028352916020019161191f565b820191906000526020600020905b81548152906001019060200180831161190257829003601f168201915b505050919092525050508152600582015467ffffffffffffffff166020808301919091526006909201546040909101529082526001929092019101611547565b50505050905060006119718251611f5e565b9050600061197f8451611f5e565b905061198b8282611fb0565b600061199a878587868661206c565b90506119a68482612448565b63ffffffff87166000908152600560205260408120908760018111156119ce576119ce61302f565b60018111156119df576119df61302f565b815260200190815260200160002060006119f99190612de7565b60005b8151811015611d5c5763ffffffff8816600090815260056020526040812081896001811115611a2d57611a2d61302f565b6001811115611a3e57611a3e61302f565b81526020019081526020016000206001816001815401808255809150500390600052602060002090600702019050828281518110611a7e57611a7e6136a9565b6020026020010151604001518160060181905550828281518110611aa457611aa46136a9565b6020026020010151602001518160050160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060008160000190506000848481518110611af657611af66136a9565b602090810291909101015151805183549192509083907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115611b4157611b4161302f565b021790555060208101518254604083015160608401517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a0100000000000000000000929091169190910217825560808101516001830190611c109082613a0f565b5060a08101516002830190611c259082613a0f565b5060e08101516004830190611c3a9082613a0f565b505b60c08101515160038301541115611cbb5781600301805480611c6057611c60613f9b565b60008281526020812060037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9093019283020181815590611ca46001830182612d62565b611cb2600283016000612d62565b50509055611c3c565b60005b8160c0015151811015611d4d5760038301548110611d4557826003018260c001518281518110611cf057611cf06136a9565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519092820190611d2c9082613a0f565b5060408201516002820190611d419082613a0f565b5050505b600101611cbe565b505050508060010190506119fc565b50856001811115611d6f57611d6f61302f565b60ff168763ffffffff167ff4095525e757e2fec7f3d3ffb3482db215dbbc7e7c4f63a11e04529ea827171f83604051611da8919061311e565b60405180910390a350505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611e0957602002820191906000526020600020905b815481526020019060010190808311611df5575b50505050509050919050565b60008181526001830160205260408120548015611efe576000611e39600183613696565b8554909150600090611e4d90600190613696565b9050808214611eb2576000866000018281548110611e6d57611e6d6136a9565b9060005260206000200154905080876000018481548110611e9057611e906136a9565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611ec357611ec3613f9b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102fc565b60009150506102fc565b5092915050565b6000818152600183016020526040812054611f56575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102fc565b5060006102fc565b60006002821115611f9e576040517f3e4785260000000000000000000000000000000000000000000000000000000081526004810183905260240161080c565b8160028111156102fc576102fc61302f565b6000826002811115611fc457611fc461302f565b826002811115611fd657611fd661302f565b611fe09190613fca565b9050806001148061202c5750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14801561202c5750600283600281111561202a5761202a61302f565b145b1561203657505050565b82826040517f0a6b675b00000000000000000000000000000000000000000000000000000000815260040161080c929190613ffa565b60606000845167ffffffffffffffff81111561208a5761208a613654565b6040519080825280602002602001820160405280156120b3578160200160208202803683370190505b50905060008460028111156120ca576120ca61302f565b1480156120e8575060018360028111156120e6576120e661302f565b145b1561212957600181600081518110612102576121026136a9565b602002602001019067ffffffffffffffff16908167ffffffffffffffff1681525050612291565b600184600281111561213d5761213d61302f565b14801561215b575060028360028111156121595761215961302f565b145b156121f25785600081518110612173576121736136a9565b60200260200101516020015181600081518110612192576121926136a9565b602002602001019067ffffffffffffffff16908167ffffffffffffffff1681525050856000815181106121c7576121c76136a9565b60200260200101516020015160016121df9190614015565b81600181518110612102576121026136a9565b60028460028111156122065761220661302f565b148015612224575060018360028111156122225761222261302f565b145b1561225b578560018151811061223c5761223c6136a9565b60200260200101516020015181600081518110612102576121026136a9565b83836040517f0a6b675b00000000000000000000000000000000000000000000000000000000815260040161080c929190613ffa565b6000855167ffffffffffffffff8111156122ad576122ad613654565b60405190808252806020026020018201604052801561235357816020015b6040805161016081018252600060608083018281526080840183905260a0840183905260c0840183905260e0840182905261010084018290526101208401829052610140840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816122cb5790505b50905060005b825181101561243c57612384878281518110612377576123776136a9565b60200260200101516127c7565b60405180606001604052808883815181106123a1576123a16136a9565b602002602001015181526020018483815181106123c0576123c06136a9565b602002602001015167ffffffffffffffff1681526020016124148b8685815181106123ed576123ed6136a9565b60200260200101518b8681518110612407576124076136a9565b6020026020010151612c35565b815250828281518110612429576124296136a9565b6020908102919091010152600101612359565b50979650505050505050565b815181518115801561245a5750806001145b156124fc5782600081518110612472576124726136a9565b60200260200101516020015167ffffffffffffffff166001146124f657826000815181106124a2576124a26136a9565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001602482015260440161080c565b50505050565b81600114801561250c5750806002145b156126c25783600081518110612524576125246136a9565b60200260200101516040015183600081518110612543576125436136a9565b602002602001015160400151146125cf5782600081518110612567576125676136a9565b60200260200101516040015184600081518110612586576125866136a9565b6020026020010151604001516040517fc7ccdd7f00000000000000000000000000000000000000000000000000000000815260040161080c929190918252602082015260400190565b836000815181106125e2576125e26136a9565b60200260200101516020015160016125fa9190614015565b67ffffffffffffffff1683600181518110612617576126176136a9565b60200260200101516020015167ffffffffffffffff16146124f65782600181518110612645576126456136a9565b60200260200101516020015184600081518110612664576126646136a9565b602002602001015160200151600161267c9190614015565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff92831660048201529116602482015260440161080c565b8160021480156126d25750806001145b1561279557836001815181106126ea576126ea6136a9565b60200260200101516040015183600081518110612709576127096136a9565b602002602001015160400151146124f6578260008151811061272d5761272d6136a9565b6020026020010151604001518460018151811061274c5761274c6136a9565b6020026020010151604001516040517f9e97567000000000000000000000000000000000000000000000000000000000815260040161080c929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806020015167ffffffffffffffff1660000361280f576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815160018111156128245761282461302f565b1415801561284557506001815160018111156128425761284261302f565b14155b1561287c576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101515115806128b9575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b156128f0576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a081015151158061292d5750604080516000602082015201604051602081830303815290604052805190602001208160a0015180519060200120145b15612964576040517fdee9857400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602081015161297f9060039067ffffffffffffffff16611127565b6129c75760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161080c565b60408082015160208084015167ffffffffffffffff1660009081526002909152919091206001015460ff918216911681811115612a3a576040517f2db22040000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161080c565b60c083015151610100811115612a7c576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a8783600361363d565b8111612abf576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808267ffffffffffffffff811115612adb57612adb613654565b604051908082528060200260200182016040528015612b04578160200160208202803683370190505b50905060005b83811015612bc45760008760c001518281518110612b2a57612b2a6136a9565b60200260200101519050806040015151600014612b4f5783612b4b81613f63565b9450505b6020810151511580612b6057508051155b15612b9957806040517f9fa4031400000000000000000000000000000000000000000000000000000000815260040161080c9190614036565b8060000151838381518110612bb057612bb06136a9565b602090810291909101015250600101612b0a565b506000612bd285600361363d565b612bdd906001613683565b905080831015612c23576040517f548dd21f000000000000000000000000000000000000000000000000000000008152600481018490526024810182905260440161080c565b612c2c8261114b565b50505050505050565b600080826020015185846000015185608001518660a00151888860c0015189604001518a606001518b60e00151604051602001612c7b9a99989796959493929190614049565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a000000000000000000000000000000000000000000000000000000000000179150509392505050565b6040518060400160405280600067ffffffffffffffff168152602001612d3f604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b5080546000825590600052602060002090810190610b349190612e08565b508054612d6e906135bb565b6000825580601f10612d7e575050565b601f016020900490600052602060002090810190610b349190612e08565b828054828255906000526020600020908101928215612dd7579160200282015b82811115612dd7578251825591602001919060010190612dbc565b50612de3929150612e08565b5090565b5080546000825560070290600052602060002090810190610b349190612e1d565b5b80821115612de35760008155600101612e09565b80821115612de35780547fffffffffffffffffffffffffffff00000000000000000000000000000000000016815560008181612e5c6001830182612d62565b612e6a600283016000612d62565b612e78600383016000612ec2565b612e86600483016000612d62565b5050506005810180547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016905560006006820155600701612e1d565b5080546000825560030290600052602060002090810190610b3491905b80821115612de3576000808255612ef96001830182612d62565b612f07600283016000612d62565b50600301612edf565b600060208284031215612f2257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610fa857600080fd5b6000815180845260005b81811015612f7857602081850181015186830182015201612f5c565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610fa86020830184612f52565b63ffffffff81168114610b3457600080fd5b8035612fe681612fc9565b919050565b803560028110612fe657600080fd5b6000806040838503121561300d57600080fd5b823561301881612fc9565b915061302660208401612feb565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061306e5761306e61302f565b9052565b8051825260006020820151606060208501526130916060850182612f52565b9050604083015184820360408601526130aa8282612f52565b95945050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015610b16577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086840301895261310c838351613072565b988401989250908301906001016130d2565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b838110156132ad577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc089840301855281516060815181865261318c828701825161305e565b8981015160806131a78189018367ffffffffffffffff169052565b8a830151915060a06131bd818a018460ff169052565b938301519360c092506131db8984018667ffffffffffffffff169052565b818401519450610100915060e082818b01526131fb6101608b0187612f52565b95508185015191507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0808b880301848c01526132378784612f52565b948601518b860382016101208d015294965061325387866130b3565b9650818601519550808b8803016101408c015250505050506132758282612f52565b915050888201516132918a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101613147565b509098975050505050505050565b6000602082840312156132cd57600080fd5b8135610fa881612fc9565b600080604083850312156132eb57600080fd5b50508035926020909101359150565b805160608084528151908401819052600091602091908201906080860190845b818110156133365783518352928401929184019160010161331a565b505060ff602086015116602087015260408501519250858103604087015261335e8184612f52565b9695505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b838110156132ad578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff1684528701518784018790526133e5878501826132fa565b9588019593505090860190600101613391565b60006020828403121561340a57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610fa857600080fd5b60008083601f84011261344057600080fd5b50813567ffffffffffffffff81111561345857600080fd5b6020830191508360208260051b850101111561347357600080fd5b9250929050565b6000806000806040858703121561349057600080fd5b843567ffffffffffffffff808211156134a857600080fd5b6134b48883890161342e565b909650945060208701359150808211156134cd57600080fd5b506134da8782880161342e565b95989497509550505050565b803567ffffffffffffffff81168114612fe657600080fd5b6000806000806000806080878903121561351757600080fd5b863567ffffffffffffffff8082111561352f57600080fd5b61353b8a838b0161342e565b9098509650602089013591508082111561355457600080fd5b818901915089601f83011261356857600080fd5b81358181111561357757600080fd5b8a602082850101111561358957600080fd5b6020830196508095505050506135a1604088016134e6565b91506135af60608801612fdb565b90509295509295509295565b600181811c908216806135cf57607f821691505b602082108103613608577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176102fc576102fc61360e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b808201808211156102fc576102fc61360e565b818103818111156102fc576102fc61360e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156136ea57600080fd5b610fa8826134e6565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261372757600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261372757600080fd5b6040516060810167ffffffffffffffff8111828210171561378857613788613654565b60405290565b604051610100810167ffffffffffffffff8111828210171561378857613788613654565b60405160e0810167ffffffffffffffff8111828210171561378857613788613654565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561381c5761381c613654565b604052919050565b600067ffffffffffffffff82111561383e5761383e613654565b5060051b60200190565b803560ff81168114612fe657600080fd5b600082601f83011261386a57600080fd5b813567ffffffffffffffff81111561388457613884613654565b6138b560207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016137d5565b8181528460208386010111156138ca57600080fd5b816020850160208301376000918101602001919091529392505050565b6000606082360312156138f957600080fd5b613901613765565b823567ffffffffffffffff8082111561391957600080fd5b9084019036601f83011261392c57600080fd5b8135602061394161393c83613824565b6137d5565b82815260059290921b8401810191818101903684111561396057600080fd5b948201945b8386101561397e57853582529482019490820190613965565b86525061398c878201613848565b908501525060408501359150808211156139a557600080fd5b506139b236828601613859565b60408301525092915050565b601f821115613a0a576000816000526020600020601f850160051c810160208610156139e75750805b601f850160051c820191505b81811015613a06578281556001016139f3565b5050505b505050565b815167ffffffffffffffff811115613a2957613a29613654565b613a3d81613a3784546135bb565b846139be565b602080601f831160018114613a905760008415613a5a5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a06565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613add57888601518255948401946001909101908401613abe565b5085821015613b1957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff83168152604060208201526000613b4c60408301846132fa565b949350505050565b600082601f830112613b6557600080fd5b81356020613b7561393c83613824565b82815260059290921b84018101918181019086841115613b9457600080fd5b8286015b84811015613c5c57803567ffffffffffffffff80821115613bb95760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215613bf25760008081fd5b613bfa613765565b87840135815260408085013584811115613c145760008081fd5b613c228e8b83890101613859565b838b015250918401359183831115613c3a5760008081fd5b613c488d8a85880101613859565b908201528652505050918301918301613b98565b509695505050505050565b60006020808385031215613c7a57600080fd5b823567ffffffffffffffff80821115613c9257600080fd5b818501915085601f830112613ca657600080fd5b8135613cb461393c82613824565b81815260059190911b83018401908481019088831115613cd357600080fd5b8585015b83811015613e1457803585811115613cee57600080fd5b8601610100818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001811315613d2457600080fd5b613d2c61378e565b613d378a8401612feb565b8152613d45604084016134e6565b8a820152613d5560608401613848565b6040820152613d66608084016134e6565b606082015260a083013588811115613d7d57600080fd5b613d8b8e8c83870101613859565b60808301525060c083013588811115613da45760008081fd5b613db28e8c83870101613859565b60a08301525060e08084013589811115613dcc5760008081fd5b613dda8f8d83880101613b54565b60c084015250918301359188831115613df35760008081fd5b613e018e8c85870101613859565b9082015285525050918601918601613cd7565b5098975050505050505050565b8051612fe681612fc9565b600082601f830112613e3d57600080fd5b81516020613e4d61393c83613824565b8083825260208201915060208460051b870101935086841115613e6f57600080fd5b602086015b84811015613c5c5780518352918301918301613e74565b600060208284031215613e9d57600080fd5b815167ffffffffffffffff80821115613eb557600080fd5b9083019060e08286031215613ec957600080fd5b613ed16137b2565b613eda83613e21565b8152613ee860208401613e21565b6020820152613ef960408401613e21565b6040820152606083015160608201526080830151608082015260a083015182811115613f2457600080fd5b613f3087828601613e2c565b60a08301525060c083015182811115613f4857600080fd5b613f5487828601613e2c565b60c08301525095945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613f9457613f9461360e565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b8181036000831280158383131683831282161715611f0857611f0861360e565b6003811061306e5761306e61302f565b604081016140088285613fea565b610fa86020830184613fea565b67ffffffffffffffff818116838216019080821115611f0857611f0861360e565b602081526000610fa86020830184613072565b600061014067ffffffffffffffff808e168452602063ffffffff8e1681860152614076604086018e61305e565b8260608601526140888386018d612f52565b9250848303608086015261409c838c612f52565b918a1660a086015284820360c0860152885180835291925080830191600581901b84018201828b0160005b83811015614113577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0878403018652614101838351613072565b958501959250908401906001016140c7565b505060ff8a1660e088015267ffffffffffffffff89166101008801528681036101208801526141428189612f52565b955050505050509b9a505050505050505050505056fea164736f6c6343000818000a", -} - -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("0xf4095525e757e2fec7f3d3ffb3482db215dbbc7e7c4f63a11e04529ea827171f") -} - -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_encoding_utils/ccip_encoding_utils.go b/core/gethwrappers/ccip/generated/ccip_encoding_utils/ccip_encoding_utils.go index 6331211b4b..9a89029e16 100644 --- a/core/gethwrappers/ccip/generated/ccip_encoding_utils/ccip_encoding_utils.go +++ b/core/gethwrappers/ccip/generated/ccip_encoding_utils/ccip_encoding_utils.go @@ -28,6 +28,23 @@ var ( _ = abi.ConvertType ) +type CCIPHomeOCR3Config struct { + PluginType uint8 + ChainSelector uint64 + FRoleDON uint8 + OffchainConfigVersion uint64 + OfframpAddress []byte + RmnHomeAddress []byte + Nodes []CCIPHomeOCR3Node + OffchainConfig []byte +} + +type CCIPHomeOCR3Node struct { + P2pId [32]byte + SignerKey []byte + TransmitterKey []byte +} + type InternalMerkleRoot struct { SourceChainSelector uint64 OnRampAddress []byte @@ -46,30 +63,11 @@ type RMNRemoteReport struct { } var EncodingUtilsMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DoNotDeploy\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"rmnReportVersion\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnRemoteContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"offrampAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"}],\"internalType\":\"structRMNRemote.Report\",\"name\":\"rmnReport\",\"type\":\"tuple\"}],\"name\":\"_rmnReport\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b50604051636f1e4f5f60e01b815260040160405180910390fdfe", + 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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"rmnReportVersion\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnRemoteContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"offrampAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"}],\"internalType\":\"structRMNRemote.Report\",\"name\":\"rmnReport\",\"type\":\"tuple\"}],\"name\":\"exposeRmnReport\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } var EncodingUtilsABI = EncodingUtilsMetaData.ABI -var EncodingUtilsBin = EncodingUtilsMetaData.Bin - -func DeployEncodingUtils(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EncodingUtils, error) { - parsed, err := EncodingUtilsMetaData.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(EncodingUtilsBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &EncodingUtils{address: address, abi: *parsed, EncodingUtilsCaller: EncodingUtilsCaller{contract: contract}, EncodingUtilsTransactor: EncodingUtilsTransactor{contract: contract}, EncodingUtilsFilterer: EncodingUtilsFilterer{contract: contract}}, nil -} - type EncodingUtils struct { address common.Address abi abi.ABI @@ -186,16 +184,38 @@ func (_EncodingUtils *EncodingUtilsTransactorRaw) Transact(opts *bind.TransactOp return _EncodingUtils.Contract.contract.Transact(opts, method, params...) } -func (_EncodingUtils *EncodingUtilsTransactor) RmnReport(opts *bind.TransactOpts, rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) { - return _EncodingUtils.contract.Transact(opts, "_rmnReport", rmnReportVersion, rmnReport) +func (_EncodingUtils *EncodingUtilsCaller) ExposeOCR3Config(opts *bind.CallOpts, config []CCIPHomeOCR3Config) ([]byte, error) { + var out []interface{} + err := _EncodingUtils.contract.Call(opts, &out, "exposeOCR3Config", config) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + } -func (_EncodingUtils *EncodingUtilsSession) RmnReport(rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) { - return _EncodingUtils.Contract.RmnReport(&_EncodingUtils.TransactOpts, rmnReportVersion, rmnReport) +func (_EncodingUtils *EncodingUtilsSession) ExposeOCR3Config(config []CCIPHomeOCR3Config) ([]byte, error) { + return _EncodingUtils.Contract.ExposeOCR3Config(&_EncodingUtils.CallOpts, config) } -func (_EncodingUtils *EncodingUtilsTransactorSession) RmnReport(rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) { - return _EncodingUtils.Contract.RmnReport(&_EncodingUtils.TransactOpts, rmnReportVersion, rmnReport) +func (_EncodingUtils *EncodingUtilsCallerSession) ExposeOCR3Config(config []CCIPHomeOCR3Config) ([]byte, error) { + return _EncodingUtils.Contract.ExposeOCR3Config(&_EncodingUtils.CallOpts, config) +} + +func (_EncodingUtils *EncodingUtilsTransactor) ExposeRmnReport(opts *bind.TransactOpts, rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) { + return _EncodingUtils.contract.Transact(opts, "exposeRmnReport", rmnReportVersion, rmnReport) +} + +func (_EncodingUtils *EncodingUtilsSession) ExposeRmnReport(rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) { + return _EncodingUtils.Contract.ExposeRmnReport(&_EncodingUtils.TransactOpts, rmnReportVersion, rmnReport) +} + +func (_EncodingUtils *EncodingUtilsTransactorSession) ExposeRmnReport(rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) { + return _EncodingUtils.Contract.ExposeRmnReport(&_EncodingUtils.TransactOpts, rmnReportVersion, rmnReport) } func (_EncodingUtils *EncodingUtils) Address() common.Address { @@ -203,7 +223,9 @@ func (_EncodingUtils *EncodingUtils) Address() common.Address { } type EncodingUtilsInterface interface { - RmnReport(opts *bind.TransactOpts, rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, error) + ExposeOCR3Config(opts *bind.CallOpts, config []CCIPHomeOCR3Config) ([]byte, error) + + ExposeRmnReport(opts *bind.TransactOpts, rmnReportVersion [32]byte, rmnReport RMNRemoteReport) (*types.Transaction, 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..3f1246dbb4 --- /dev/null +++ b/core/gethwrappers/ccip/generated/ccip_home/ccip_home.go @@ -0,0 +1,1894 @@ +// 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 CCIPHomeChainConfigArgs struct { + ChainSelector uint64 + ChainConfig CCIPHomeChainConfig +} + +type CCIPHomeOCR3Config struct { + PluginType uint8 + ChainSelector uint64 + FRoleDON uint8 + OffchainConfigVersion uint64 + OfframpAddress []byte + RmnHomeAddress []byte + Nodes []CCIPHomeOCR3Node + OffchainConfig []byte +} + +type CCIPHomeOCR3Node struct { + P2pId [32]byte + SignerKey []byte + TransmitterKey []byte +} + +type CCIPHomeVersionedConfig struct { + Version uint32 + ConfigDigest [32]byte + Config CCIPHomeOCR3Config +} + +var CCIPHomeMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expectedConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"gotConfigDigest\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"callDonId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"capabilityRegistryDonId\",\"type\":\"uint32\"}],\"name\":\"DONIdMismatch\",\"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\":[{\"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\":\"bytes4\",\"name\":\"selector\",\"type\":\"bytes4\"}],\"name\":\"InvalidSelector\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"currentActiveDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"currentCandidateDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"proposedActiveDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"proposedCandidateDigest\",\"type\":\"bytes32\"}],\"name\":\"InvalidStateTransition\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoOpStateTransitionNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"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\":\"RMNHomeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RevokingZeroDigestNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"ActiveConfigRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"CandidateConfigRevoked\",\"type\":\"event\"},{\"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\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"ConfigPromoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\"}],\"indexed\":false,\"internalType\":\"structCCIPHome.OCR3Config\",\"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.ChainConfigArgs[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"update\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getActiveDigest\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"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.ChainConfigArgs[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getAllConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\":\"structCCIPHome.VersionedConfig\",\"name\":\"activeConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\":\"structCCIPHome.VersionedConfig\",\"name\":\"candidateConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getCandidateDigest\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"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\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\":\"structCCIPHome.VersionedConfig\",\"name\":\"versionedConfig\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"ok\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getConfigDigests\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"activeConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"candidateConfigDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumChainConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"digestToPromote\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"digestToRevoke\",\"type\":\"bytes32\"}],\"name\":\"promoteCandidateAndRevokeActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"revokeCandidate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\":\"bytes32\",\"name\":\"digestToOverwrite\",\"type\":\"bytes32\"}],\"name\":\"setCandidate\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"newConfigDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a0604052600680546001600160401b03191690553480156200002157600080fd5b5060405162004eb738038062004eb78339810160408190526200004491620001b6565b33806000816200009b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000ce57620000ce816200010b565b5050506001600160a01b038116620000f9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001e8565b336001600160a01b03821603620001655760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000092565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001c957600080fd5b81516001600160a01b0381168114620001e157600080fd5b9392505050565b608051614ca56200021260003960008181610180015281816122730152612c880152614ca56000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806379ba5097116100cd578063b74b235611610081578063f2fde38b11610066578063f2fde38b14610356578063f442c89a14610369578063fba64a7c1461037c57600080fd5b8063b74b235614610323578063bae4e0fa1461034357600080fd5b80638318ed5d116100b25780638318ed5d146102d15780638da5cb5b146102f2578063922ea4061461031057600080fd5b806379ba5097146102c15780637ac0d41e146102c957600080fd5b80633df45a72116101245780635a837f97116101095780635a837f97146102785780635f1edd9c1461028d5780637524051a146102ae57600080fd5b80633df45a721461022f5780634851d5491461025057600080fd5b806301ffc9a714610156578063020330e61461017e578063181f5a77146101c557806333d9704a1461020e575b600080fd5b6101696101643660046130e2565b61038f565b60405190151581526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610175565b6102016040518060400160405280601281526020017f43434950486f6d6520312e362e302d646576000000000000000000000000000081525081565b6040516101759190613192565b61022161021c3660046131df565b610428565b604051610175929190613437565b61024261023d36600461345b565b610922565b604051610175929190613494565b61026361025e36600461345b565b61123c565b60408051928352602083019190915201610175565b61028b6102863660046134b9565b61134c565b005b6102a061029b36600461345b565b611639565b604051908152602001610175565b61028b6102bc3660046131df565b6116be565b61028b6118ad565b6102a06119aa565b6102016102df3660046134ff565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff166101a0565b6102a061031e36600461345b565b6119bb565b61033661033136600461351c565b611a1d565b60405161017591906135ac565b6102a061035136600461364a565b611c9e565b61028b6103643660046136ba565b611ea8565b61028b610377366004613735565b611ebc565b61028b61038a3660046137c2565b61225b565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f78bea72100000000000000000000000000000000000000000000000000000000148061042257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b610430612f6b565b6000805b60028110156109145763ffffffff86166000908152600560205260408120859187600181111561046657610466613220565b600181111561047757610477613220565b815260200190815260200160002082600281106104965761049661387f565b60070201600101541480156104aa57508315155b1561090c5763ffffffff86166000908152600560205260408120908660018111156104d7576104d7613220565b60018111156104e8576104e8613220565b815260200190815260200160002081600281106105075761050761387f565b6040805160608101825260079290920292909201805463ffffffff1682526001808201546020840152835161010081018552600283018054939592949386938501929190829060ff168781111561056057610560613220565b600181111561057157610571613220565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a01000000000000000000009091041660608201526001820180546080909201916105c9906138ae565b80601f01602080910402602001604051908101604052809291908181526020018280546105f5906138ae565b80156106425780601f1061061757610100808354040283529160200191610642565b820191906000526020600020905b81548152906001019060200180831161062557829003601f168201915b5050505050815260200160028201805461065b906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610687906138ae565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b8282101561086257838290600052602060002090600302016040518060600160405290816000820154815260200160018201805461073f906138ae565b80601f016020809104026020016040519081016040528092919081815260200182805461076b906138ae565b80156107b85780601f1061078d576101008083540402835291602001916107b8565b820191906000526020600020905b81548152906001019060200180831161079b57829003601f168201915b505050505081526020016002820180546107d1906138ae565b80601f01602080910402602001604051908101604052809291908181526020018280546107fd906138ae565b801561084a5780601f1061081f5761010080835404028352916020019161084a565b820191906000526020600020905b81548152906001019060200180831161082d57829003601f168201915b50505050508152505081526020019060010190610702565b50505050815260200160048201805461087a906138ae565b80601f01602080910402602001604051908101604052809291908181526020018280546108a6906138ae565b80156108f35780601f106108c8576101008083540402835291602001916108f3565b820191906000526020600020905b8154815290600101906020018083116108d657829003601f168201915b505050505081525050815250509150925092505061091a565b600101610434565b50600090505b935093915050565b61092a612f6b565b610932612f6b565b63ffffffff841660009081526005602052604081208185600181111561095a5761095a613220565b600181111561096b5761096b613220565b815260200190815260200160002061099160065463ffffffff6401000000009091041690565b63ffffffff16600281106109a7576109a761387f565b6040805160608101825260079290920292909201805463ffffffff1682526001808201546020840152835161010081018552600283018054949593949386019391929091839160ff90911690811115610a0257610a02613220565b6001811115610a1357610a13613220565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a0100000000000000000000909104166060820152600182018054608090920191610a6b906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610a97906138ae565b8015610ae45780601f10610ab957610100808354040283529160200191610ae4565b820191906000526020600020905b815481529060010190602001808311610ac757829003601f168201915b50505050508152602001600282018054610afd906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610b29906138ae565b8015610b765780601f10610b4b57610100808354040283529160200191610b76565b820191906000526020600020905b815481529060010190602001808311610b5957829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610d04578382906000526020600020906003020160405180606001604052908160008201548152602001600182018054610be1906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610c0d906138ae565b8015610c5a5780601f10610c2f57610100808354040283529160200191610c5a565b820191906000526020600020905b815481529060010190602001808311610c3d57829003601f168201915b50505050508152602001600282018054610c73906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9f906138ae565b8015610cec5780601f10610cc157610100808354040283529160200191610cec565b820191906000526020600020905b815481529060010190602001808311610ccf57829003601f168201915b50505050508152505081526020019060010190610ba4565b505050508152602001600482018054610d1c906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610d48906138ae565b8015610d955780601f10610d6a57610100808354040283529160200191610d95565b820191906000526020600020905b815481529060010190602001808311610d7857829003601f168201915b50505091909252505050905250602081015190915015610db3578092505b63ffffffff8516600090815260056020526040812081866001811115610ddb57610ddb613220565b6001811115610dec57610dec613220565b81526020810191909152604001600020600654640100000000900463ffffffff1660011863ffffffff1660028110610e2657610e2661387f565b6040805160608101825260079290920292909201805463ffffffff1682526001808201546020840152835161010081018552600283018054949593949386019391929091839160ff90911690811115610e8157610e81613220565b6001811115610e9257610e92613220565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a0100000000000000000000909104166060820152600182018054608090920191610eea906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610f16906138ae565b8015610f635780601f10610f3857610100808354040283529160200191610f63565b820191906000526020600020905b815481529060010190602001808311610f4657829003601f168201915b50505050508152602001600282018054610f7c906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610fa8906138ae565b8015610ff55780601f10610fca57610100808354040283529160200191610ff5565b820191906000526020600020905b815481529060010190602001808311610fd857829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015611183578382906000526020600020906003020160405180606001604052908160008201548152602001600182018054611060906138ae565b80601f016020809104026020016040519081016040528092919081815260200182805461108c906138ae565b80156110d95780601f106110ae576101008083540402835291602001916110d9565b820191906000526020600020905b8154815290600101906020018083116110bc57829003601f168201915b505050505081526020016002820180546110f2906138ae565b80601f016020809104026020016040519081016040528092919081815260200182805461111e906138ae565b801561116b5780601f106111405761010080835404028352916020019161116b565b820191906000526020600020905b81548152906001019060200180831161114e57829003601f168201915b50505050508152505081526020019060010190611023565b50505050815260200160048201805461119b906138ae565b80601f01602080910402602001604051908101604052809291908181526020018280546111c7906138ae565b80156112145780601f106111e957610100808354040283529160200191611214565b820191906000526020600020905b8154815290600101906020018083116111f757829003601f168201915b50505091909252505050905250602081015190915015611232578092505b50505b9250929050565b63ffffffff8216600090815260056020526040812081908184600181111561126657611266613220565b600181111561127757611277613220565b815260200190815260200160002061129d60065463ffffffff6401000000009091041690565b63ffffffff16600281106112b3576112b361387f565b6007020160010154600560008663ffffffff1663ffffffff16815260200190815260200160002060008560018111156112ee576112ee613220565b60018111156112ff576112ff613220565b81526020810191909152604001600020600654640100000000900463ffffffff1660011863ffffffff16600281106113395761133961387f565b6007020160010154915091509250929050565b611354612518565b81158015611360575080155b15611397576040517f7b4d1e4f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60065463ffffffff8581166000908152600560205260408120600164010000000090940483168418909216928592919087908111156113d8576113d8613220565b60018111156113e9576113e9613220565b815260200190815260200160002082600281106114085761140861387f565b6007020160010154146114bc5763ffffffff851660009081526005602052604081209085600181111561143d5761143d613220565b600181111561144e5761144e613220565b8152602001908152602001600020816002811061146d5761146d61387f565b6007020160010154836040517f93df584c0000000000000000000000000000000000000000000000000000000081526004016114b3929190918252602082015260400190565b60405180910390fd5b63ffffffff85166000908152600560205260408120818660018111156114e4576114e4613220565b60018111156114f5576114f5613220565b815260200190815260200160002061151b60065463ffffffff6401000000009091041690565b63ffffffff16600281106115315761153161387f565b600702019050828160010154146115845760018101546040517f93df584c0000000000000000000000000000000000000000000000000000000081526004810191909152602481018490526044016114b3565b60006001808301919091556006805463ffffffff6401000000008083048216909418169092027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff90921691909117905582156116065760405183907f0b31c0055e2d464bef7781994b98c4ff9ef4ae0d05f59feb6a68c42de5e201b890600090a25b60405184907ffc3e98dbbd47c3fa7c1c05b6ec711caeaf70eca4554192b9ada8fc11a37f298e90600090a2505050505050565b63ffffffff821660009081526005602052604081208183600181111561166157611661613220565b600181111561167257611672613220565b815260200190815260200160002061169860065463ffffffff6401000000009091041690565b63ffffffff16600281106116ae576116ae61387f565b6007020160010154905092915050565b6116c6612518565b806116fd576040517f0849d8cc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60065463ffffffff84811660009081526005602052604081206001640100000000909404831684189092169284929190869081111561173e5761173e613220565b600181111561174f5761174f613220565b8152602001908152602001600020826002811061176e5761176e61387f565b6007020160010154146118195763ffffffff84166000908152600560205260408120908460018111156117a3576117a3613220565b60018111156117b4576117b4613220565b815260200190815260200160002081600281106117d3576117d361387f565b6007020160010154826040517f93df584c0000000000000000000000000000000000000000000000000000000081526004016114b3929190918252602082015260400190565b60405182907f53f5d9228f0a4173bea6e5931c9b3afe6eeb6692ede1d182952970f152534e3b90600090a263ffffffff841660009081526005602052604081209084600181111561186c5761186c613220565b600181111561187d5761187d613220565b8152602001908152602001600020816002811061189c5761189c61387f565b600702016001016000905550505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016114b3565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60006119b66003612553565b905090565b63ffffffff82166000908152600560205260408120818360018111156119e3576119e3613220565b60018111156119f4576119f4613220565b81526020810191909152604001600020600654640100000000900463ffffffff16600118611698565b60606000611a2b6003612553565b90506000611a398486613930565b9050831580611a485750818110155b15611a88576040805160008082526020820190925290611a7e565b611a6b612fe7565b815260200190600190039081611a635790505b5092505050610422565b6000611a948583613976565b905082811115611aa15750815b6000611aad8383613989565b67ffffffffffffffff811115611ac557611ac5613947565b604051908082528060200260200182016040528015611afe57816020015b611aeb612fe7565b815260200190600190039081611ae35790505b5090506000611b0d600361255d565b9050835b83811015611c91576000828281518110611b2d57611b2d61387f565b60209081029190910181015160408051808201825267ffffffffffffffff831680825260009081526002855282902082518154608081880283018101909552606082018181529597509295860194909391928492849190840182828015611bb357602002820191906000526020600020905b815481526020019060010190808311611b9f575b5050509183525050600182015460ff166020820152600282018054604090920191611bdd906138ae565b80601f0160208091040260200160405190810160405280929190818152602001828054611c09906138ae565b8015611c565780601f10611c2b57610100808354040283529160200191611c56565b820191906000526020600020905b815481529060010190602001808311611c3957829003601f168201915b50505091909252505050905284611c6d8885613989565b81518110611c7d57611c7d61387f565b602090810291909101015250600101611b11565b5090979650505050505050565b6000611ca8612518565b611cb9611cb484613c3f565b612571565b6000611cc586866119bb565b9050828114611d0a576040517f93df584c00000000000000000000000000000000000000000000000000000000815260048101829052602481018490526044016114b3565b8015611d3c5760405183907f53f5d9228f0a4173bea6e5931c9b3afe6eeb6692ede1d182952970f152534e3b90600090a25b60068054600091908290611d559063ffffffff16613d3b565b91906101000a81548163ffffffff021916908363ffffffff16021790559050611d9f878787604051602001611d8a9190614049565b604051602081830303815290604052846129df565b63ffffffff881660009081526005602052604081209194509081886001811115611dcb57611dcb613220565b6001811115611ddc57611ddc613220565b81526020810191909152604001600020600654640100000000900463ffffffff1660011863ffffffff1660028110611e1657611e1661387f565b600702016001810185905580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff841617815590508560028201611e60828261456b565b905050837f94f085b7c57ec2a270befd0b7b2ec7452580040edee8bb0fb04609c81f0359c68388604051611e95929190614732565b60405180910390a2505050949350505050565b611eb0612adb565b611eb981612b5c565b50565b611ec4612adb565b60005b838110156120aa57611f0b858583818110611ee457611ee461387f565b9050602002016020810190611ef99190614759565b60039067ffffffffffffffff16612c51565b611f7557848482818110611f2157611f2161387f565b9050602002016020810190611f369190614759565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016114b3565b60026000868684818110611f8b57611f8b61387f565b9050602002016020810190611fa09190614759565b67ffffffffffffffff1681526020810191909152604001600090812090611fc7828261302a565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611fff600283016000613048565b505061203d8585838181106120165761201661387f565b905060200201602081019061202b9190614759565b60039067ffffffffffffffff16612c69565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f08585838181106120715761207161387f565b90506020020160208101906120869190614759565b60405167ffffffffffffffff909116815260200160405180910390a1600101611ec7565b5060005b818110156122545760008383838181106120ca576120ca61387f565b90506020028101906120dc9190614776565b6120ea9060208101906142b0565b6120f3906147aa565b905060008484848181106121095761210961387f565b905060200281019061211b9190614776565b612129906020810190614759565b90506121388260000151612c75565b816020015160ff16600003612179576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660009081526002602090815260409091208351805185936121a9928492910190613082565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055604082015160028201906121f6908261487c565b5061221091506003905067ffffffffffffffff8316612dc1565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051612242929190614996565b60405180910390a150506001016120ae565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146122ca576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122d960048286886149b9565b6122e2916149e3565b90507fffffffff0000000000000000000000000000000000000000000000000000000081167fbae4e0fa000000000000000000000000000000000000000000000000000000001480159061237857507fffffffff0000000000000000000000000000000000000000000000000000000081167f7524051a0000000000000000000000000000000000000000000000000000000014155b80156123c657507fffffffff0000000000000000000000000000000000000000000000000000000081167f5a837f970000000000000000000000000000000000000000000000000000000014155b15612421576040517f12ba286f0000000000000000000000000000000000000000000000000000000081527fffffffff00000000000000000000000000000000000000000000000000000000821660048201526024016114b3565b60006124316024600487896149b9565b81019061243e9190614a2b565b90508263ffffffff16811461248f576040517f8a6e4ce800000000000000000000000000000000000000000000000000000000815263ffffffff8083166004830152841660248201526044016114b3565b6000803073ffffffffffffffffffffffffffffffffffffffff1688886040516124b9929190614a44565b6000604051808303816000865af19150503d80600081146124f6576040519150601f19603f3d011682016040523d82523d6000602084013e6124fb565b606091505b50915091508161250c573d60208201fd5b50505050505050505050565b333014612551576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6000610422825490565b6060600061256a83612dcd565b9392505050565b806020015167ffffffffffffffff166000036125b9576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815160018111156125ce576125ce613220565b141580156125ef57506001815160018111156125ec576125ec613220565b14155b15612626576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151511580612663575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b1561269a576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a08101515115806126d75750604080516000602082015201604051602081830303815290604052805190602001208160a0015180519060200120145b1561270e576040517fdee9857400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516127299060039067ffffffffffffffff16612c51565b6127715760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016114b3565b60408082015160208084015167ffffffffffffffff1660009081526002909152919091206001015460ff9182169116818111156127e4576040517f2db2204000000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016114b3565b60c083015151610100811115612826576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612831836003613930565b8111612869576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808267ffffffffffffffff81111561288557612885613947565b6040519080825280602002602001820160405280156128ae578160200160208202803683370190505b50905060005b8381101561296e5760008760c0015182815181106128d4576128d461387f565b602002602001015190508060400151516000146128f957836128f581614a54565b9450505b602081015151158061290a57508051155b1561294357806040517f9fa403140000000000000000000000000000000000000000000000000000000081526004016114b39190614a8c565b806000015183838151811061295a5761295a61387f565b6020908102919091010152506001016128b4565b50600061297c856003613930565b612987906001613976565b9050808310156129cd576040517f548dd21f00000000000000000000000000000000000000000000000000000000815260048101849052602481018290526044016114b3565b6129d682612c75565b50505050505050565b6040516000907dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90612a3d907f45564d000000000000000000000000000000000000000000000000000000000090469030908a908a908990602001614a9f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052612a7a918690602001614af8565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529190528051602090910120167e0a0000000000000000000000000000000000000000000000000000000000001795945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016114b3565b3373ffffffffffffffffffffffffffffffffffffffff821603612bdb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016114b3565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000818152600183016020526040812054151561256a565b600061256a8383612e29565b60005b8151811015612dbd5760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe848481518110612cd457612cd461387f565b60200260200101516040518263ffffffff1660e01b8152600401612cfa91815260200190565b600060405180830381865afa158015612d17573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052612d5d9190810190614b91565b6080015103612db557818181518110612d7857612d7861387f565b60200260200101516040517f8907a4fa0000000000000000000000000000000000000000000000000000000081526004016114b391815260200190565b600101612c78565b5050565b600061256a8383612f1c565b606081600001805480602002602001604051908101604052809291908181526020018280548015612e1d57602002820191906000526020600020905b815481526020019060010190808311612e09575b50505050509050919050565b60008181526001830160205260408120548015612f12576000612e4d600183613989565b8554909150600090612e6190600190613989565b9050808214612ec6576000866000018281548110612e8157612e8161387f565b9060005260206000200154905080876000018481548110612ea457612ea461387f565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612ed757612ed7614c69565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610422565b6000915050610422565b6000818152600183016020526040812054612f6357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610422565b506000610422565b6040805160608101825260008082526020820152908101612fe26040805161010081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff168152602001606081526020016060815260200160608152602001606081525090565b905290565b6040518060400160405280600067ffffffffffffffff168152602001612fe2604051806060016040528060608152602001600060ff168152602001606081525090565b5080546000825590600052602060002090810190611eb991906130cd565b508054613054906138ae565b6000825580601f10613064575050565b601f016020900490600052602060002090810190611eb991906130cd565b8280548282559060005260206000209081019282156130bd579160200282015b828111156130bd5782518255916020019190600101906130a2565b506130c99291506130cd565b5090565b5b808211156130c957600081556001016130ce565b6000602082840312156130f457600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461256a57600080fd5b60005b8381101561313f578181015183820152602001613127565b50506000910152565b60008151808452613160816020860160208601613124565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061256a6020830184613148565b63ffffffff81168114611eb957600080fd5b80356131c2816131a5565b919050565b60028110611eb957600080fd5b80356131c2816131c7565b6000806000606084860312156131f457600080fd5b83356131ff816131a5565b9250602084013561320f816131c7565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110613286577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b8051825260006020820151606060208501526132a96060850182613148565b9050604083015184820360408601526132c28282613148565b95945050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015611c91577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086840301895261332483835161328a565b988401989250908301906001016132ea565b63ffffffff815116825260208101516020830152600060408201516060604085015261336660608501825161324f565b602081015167ffffffffffffffff8116608086015250604081015160ff811660a086015250606081015167ffffffffffffffff811660c08601525060808101516101008060e08701526133bd610160870183613148565b915060a08301517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08088850301838901526133f88483613148565b935060c08501519250808885030161012089015261341684846132cb565b935060e0850151945080888503016101408901525050506132c28183613148565b60408152600061344a6040830185613336565b905082151560208301529392505050565b6000806040838503121561346e57600080fd5b8235613479816131a5565b91506020830135613489816131c7565b809150509250929050565b6040815260006134a76040830185613336565b82810360208401526132c28185613336565b600080600080608085870312156134cf57600080fd5b84356134da816131a5565b935060208501356134ea816131c7565b93969395505050506040820135916060013590565b60006020828403121561351157600080fd5b813561256a816131a5565b6000806040838503121561352f57600080fd5b50508035926020909101359150565b805160608084528151908401819052600091602091908201906080860190845b8181101561357a5783518352928401929184019160010161355e565b505060ff60208601511660208701526040850151925085810360408701526135a28184613148565b9695505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561363c578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff1684528701518784018790526136298785018261353e565b95880195935050908601906001016135d5565b509098975050505050505050565b6000806000806080858703121561366057600080fd5b843561366b816131a5565b9350602085013561367b816131c7565b9250604085013567ffffffffffffffff81111561369757600080fd5b850161010081880312156136aa57600080fd5b9396929550929360600135925050565b6000602082840312156136cc57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461256a57600080fd5b60008083601f84011261370257600080fd5b50813567ffffffffffffffff81111561371a57600080fd5b6020830191508360208260051b850101111561123557600080fd5b6000806000806040858703121561374b57600080fd5b843567ffffffffffffffff8082111561376357600080fd5b61376f888389016136f0565b9096509450602087013591508082111561378857600080fd5b50613795878288016136f0565b95989497509550505050565b67ffffffffffffffff81168114611eb957600080fd5b80356131c2816137a1565b600080600080600080608087890312156137db57600080fd5b863567ffffffffffffffff808211156137f357600080fd5b6137ff8a838b016136f0565b9098509650602089013591508082111561381857600080fd5b818901915089601f83011261382c57600080fd5b81358181111561383b57600080fd5b8a602082850101111561384d57600080fd5b602083019650809550505050613865604088016137b7565b9150613873606088016131b7565b90509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600181811c908216806138c257607f821691505b6020821081036138fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761042257610422613901565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8082018082111561042257610422613901565b8181038181111561042257610422613901565b6040516060810167ffffffffffffffff811182821017156139bf576139bf613947565b60405290565b604051610100810167ffffffffffffffff811182821017156139bf576139bf613947565b60405160e0810167ffffffffffffffff811182821017156139bf576139bf613947565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613a5357613a53613947565b604052919050565b60ff81168114611eb957600080fd5b80356131c281613a5b565b600082601f830112613a8657600080fd5b813567ffffffffffffffff811115613aa057613aa0613947565b613ad160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613a0c565b818152846020838601011115613ae657600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613b1d57613b1d613947565b5060051b60200190565b600082601f830112613b3857600080fd5b81356020613b4d613b4883613b03565b613a0c565b82815260059290921b84018101918181019086841115613b6c57600080fd5b8286015b84811015613c3457803567ffffffffffffffff80821115613b915760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215613bca5760008081fd5b613bd261399c565b87840135815260408085013584811115613bec5760008081fd5b613bfa8e8b83890101613a75565b838b015250918401359183831115613c125760008081fd5b613c208d8a85880101613a75565b908201528652505050918301918301613b70565b509695505050505050565b60006101008236031215613c5257600080fd5b613c5a6139c5565b613c63836131d4565b8152613c71602084016137b7565b6020820152613c8260408401613a6a565b6040820152613c93606084016137b7565b6060820152608083013567ffffffffffffffff80821115613cb357600080fd5b613cbf36838701613a75565b608084015260a0850135915080821115613cd857600080fd5b613ce436838701613a75565b60a084015260c0850135915080821115613cfd57600080fd5b613d0936838701613b27565b60c084015260e0850135915080821115613d2257600080fd5b50613d2f36828601613a75565b60e08301525092915050565b600063ffffffff808316818103613d5457613d54613901565b6001019392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613d9357600080fd5b830160208101925035905067ffffffffffffffff811115613db357600080fd5b80360382131561123557600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613e4057600080fd5b830160208101925035905067ffffffffffffffff811115613e6057600080fd5b8060051b360382131561123557600080fd5b60008383855260208086019550808560051b830101846000805b88811015613f4e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868503018a5282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1893603018112613eec578283fd5b8801803585526060613f0087830183613d5e565b8289890152613f128389018284613dc2565b925050506040613f2481840184613d5e565b935087830382890152613f38838583613dc2565b9d89019d97505050938601935050600101613e8c565b509198975050505050505050565b6000610100613f7384613f6e856131d4565b61324f565b613f7f602084016137b7565b67ffffffffffffffff166020850152613f9a60408401613a6a565b60ff166040850152613fae606084016137b7565b67ffffffffffffffff166060850152613fca6080840184613d5e565b826080870152613fdd8387018284613dc2565b92505050613fee60a0840184613d5e565b85830360a0870152614001838284613dc2565b9250505061401260c0840184613e0b565b85830360c0870152614025838284613e72565b9250505061403660e0840184613d5e565b85830360e08701526135a2838284613dc2565b60208152600061256a6020830184613f5c565b60008135610422816137a1565b6000813561042281613a5b565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126140ab57600080fd5b83018035915067ffffffffffffffff8211156140c657600080fd5b60200191503681900382131561123557600080fd5b5b81811015612dbd57600081556001016140dc565b601f82111561412957806000526020600020601f840160051c810160208510156141175750805b612254601f850160051c8301826140db565b505050565b67ffffffffffffffff83111561414657614146613947565b61415a8361415483546138ae565b836140f0565b6000601f8411600181146141ac57600085156141765750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355612254565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156141fb57868501358255602094850194600190920191016141db565b5086821015614236577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261427d57600080fd5b83018035915067ffffffffffffffff82111561429857600080fd5b6020019150600581901b360382131561123557600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126142e457600080fd5b9190910192915050565b6142f881546138ae565b8015612dbd57601f81116001811461431257505060009055565b826000526020600020614330601f840160051c8201600183016140db565b60008085559055505050565b81358155600180820160206143546020860186614076565b67ffffffffffffffff81111561436c5761436c613947565b6143808161437a86546138ae565b866140f0565b6000601f8211600181146143d2576000831561439c5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600385901b1c1916600184901b178655614465565b6000868152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0841690835b8281101561441e5786850135825593870193908901908701614401565b5084821015614459577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88660031b161c19848701351681555b505060018360011b0186555b505050505050506144796040830183614076565b61448781836002860161412e565b50505050565b680100000000000000008311156144a6576144a6613947565b805483825580841015614525576003816003026003810483146144cb576144cb613901565b856003026003810487146144e1576144e1613901565b6000858152602081209283019291909101905b828210156145205780825561450b600183016142ee565b614517600283016142ee565b908301906144f4565b505050505b5060008181526020812083915b858110156145635761454d61454784876142b0565b8361433c565b6020929092019160039190910190600101614532565b505050505050565b8135614576816131c7565b600281106145ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541660ff82168117835550506146246145ea6020840161405c565b82547fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ff1660089190911b68ffffffffffffffff0016178255565b61466e61463360408401614069565b82547fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1660489190911b69ff00000000000000000016178255565b6146c061467d6060840161405c565b82547fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff1660509190911b71ffffffffffffffff0000000000000000000016178255565b6146cd6080830183614076565b6146db81836001860161412e565b50506146ea60a0830183614076565b6146f881836002860161412e565b505061470760c0830183614248565b61471581836003860161448d565b505061472460e0830183614076565b61448781836004860161412e565b63ffffffff831681526040602082015260006147516040830184613f5c565b949350505050565b60006020828403121561476b57600080fd5b813561256a816137a1565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126142e457600080fd5b6000606082360312156147bc57600080fd5b6147c461399c565b823567ffffffffffffffff808211156147dc57600080fd5b9084019036601f8301126147ef57600080fd5b813560206147ff613b4883613b03565b82815260059290921b8401810191818101903684111561481e57600080fd5b948201945b8386101561483c57853582529482019490820190614823565b86525061484a878201613a6a565b9085015250604085013591508082111561486357600080fd5b5061487036828601613a75565b60408301525092915050565b815167ffffffffffffffff81111561489657614896613947565b6148aa816148a484546138ae565b846140f0565b602080601f8311600181146148fd57600084156148c75750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614563565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561494a5788860151825594840194600190910190840161492b565b508582101561498657878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff83168152604060208201526000614751604083018461353e565b600080858511156149c957600080fd5b838611156149d657600080fd5b5050820193919092039150565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015614a235780818660040360031b1b83161692505b505092915050565b600060208284031215614a3d57600080fd5b5035919050565b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614a8557614a85613901565b5060010190565b60208152600061256a602083018461328a565b8681526020810186905273ffffffffffffffffffffffffffffffffffffffff8516604082015263ffffffff848116606083015260c0820190614ae4608084018661324f565b80841660a084015250979650505050505050565b60008351614b0a818460208801613124565b835190830190614b1e818360208801613124565b01949350505050565b80516131c2816131a5565b600082601f830112614b4357600080fd5b81516020614b53613b4883613b03565b8083825260208201915060208460051b870101935086841115614b7557600080fd5b602086015b84811015613c345780518352918301918301614b7a565b600060208284031215614ba357600080fd5b815167ffffffffffffffff80821115614bbb57600080fd5b9083019060e08286031215614bcf57600080fd5b614bd76139e9565b614be083614b27565b8152614bee60208401614b27565b6020820152614bff60408401614b27565b6040820152606083015160608201526080830151608082015260a083015182811115614c2a57600080fd5b614c3687828601614b32565b60a08301525060c083015182811115614c4e57600080fd5b614c5a87828601614b32565b60c08301525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", +} + +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) GetActiveDigest(opts *bind.CallOpts, donId uint32, pluginType uint8) ([32]byte, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getActiveDigest", donId, pluginType) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetActiveDigest(donId uint32, pluginType uint8) ([32]byte, error) { + return _CCIPHome.Contract.GetActiveDigest(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetActiveDigest(donId uint32, pluginType uint8) ([32]byte, error) { + return _CCIPHome.Contract.GetActiveDigest(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCaller) GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigArgs, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getAllChainConfigs", pageIndex, pageSize) + + if err != nil { + return *new([]CCIPHomeChainConfigArgs), err + } + + out0 := *abi.ConvertType(out[0], new([]CCIPHomeChainConfigArgs)).(*[]CCIPHomeChainConfigArgs) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigArgs, error) { + return _CCIPHome.Contract.GetAllChainConfigs(&_CCIPHome.CallOpts, pageIndex, pageSize) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigArgs, error) { + return _CCIPHome.Contract.GetAllChainConfigs(&_CCIPHome.CallOpts, pageIndex, pageSize) +} + +func (_CCIPHome *CCIPHomeCaller) GetAllConfigs(opts *bind.CallOpts, donId uint32, pluginType uint8) (GetAllConfigs, + + error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getAllConfigs", donId, pluginType) + + outstruct := new(GetAllConfigs) + if err != nil { + return *outstruct, err + } + + outstruct.ActiveConfig = *abi.ConvertType(out[0], new(CCIPHomeVersionedConfig)).(*CCIPHomeVersionedConfig) + outstruct.CandidateConfig = *abi.ConvertType(out[1], new(CCIPHomeVersionedConfig)).(*CCIPHomeVersionedConfig) + + return *outstruct, err + +} + +func (_CCIPHome *CCIPHomeSession) GetAllConfigs(donId uint32, pluginType uint8) (GetAllConfigs, + + error) { + return _CCIPHome.Contract.GetAllConfigs(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetAllConfigs(donId uint32, pluginType uint8) (GetAllConfigs, + + error) { + return _CCIPHome.Contract.GetAllConfigs(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCaller) GetCandidateDigest(opts *bind.CallOpts, donId uint32, pluginType uint8) ([32]byte, error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getCandidateDigest", donId, pluginType) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_CCIPHome *CCIPHomeSession) GetCandidateDigest(donId uint32, pluginType uint8) ([32]byte, error) { + return _CCIPHome.Contract.GetCandidateDigest(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetCandidateDigest(donId uint32, pluginType uint8) ([32]byte, error) { + return _CCIPHome.Contract.GetCandidateDigest(&_CCIPHome.CallOpts, donId, pluginType) +} + +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) GetConfig(opts *bind.CallOpts, donId uint32, pluginType uint8, configDigest [32]byte) (GetConfig, + + error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getConfig", donId, pluginType, configDigest) + + outstruct := new(GetConfig) + if err != nil { + return *outstruct, err + } + + outstruct.VersionedConfig = *abi.ConvertType(out[0], new(CCIPHomeVersionedConfig)).(*CCIPHomeVersionedConfig) + outstruct.Ok = *abi.ConvertType(out[1], new(bool)).(*bool) + + return *outstruct, err + +} + +func (_CCIPHome *CCIPHomeSession) GetConfig(donId uint32, pluginType uint8, configDigest [32]byte) (GetConfig, + + error) { + return _CCIPHome.Contract.GetConfig(&_CCIPHome.CallOpts, donId, pluginType, configDigest) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetConfig(donId uint32, pluginType uint8, configDigest [32]byte) (GetConfig, + + error) { + return _CCIPHome.Contract.GetConfig(&_CCIPHome.CallOpts, donId, pluginType, configDigest) +} + +func (_CCIPHome *CCIPHomeCaller) GetConfigDigests(opts *bind.CallOpts, donId uint32, pluginType uint8) (GetConfigDigests, + + error) { + var out []interface{} + err := _CCIPHome.contract.Call(opts, &out, "getConfigDigests", donId, pluginType) + + outstruct := new(GetConfigDigests) + if err != nil { + return *outstruct, err + } + + outstruct.ActiveConfigDigest = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.CandidateConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CCIPHome *CCIPHomeSession) GetConfigDigests(donId uint32, pluginType uint8) (GetConfigDigests, + + error) { + return _CCIPHome.Contract.GetConfigDigests(&_CCIPHome.CallOpts, donId, pluginType) +} + +func (_CCIPHome *CCIPHomeCallerSession) GetConfigDigests(donId uint32, pluginType uint8) (GetConfigDigests, + + error) { + return _CCIPHome.Contract.GetConfigDigests(&_CCIPHome.CallOpts, donId, pluginType) +} + +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) 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) 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") + + 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 []CCIPHomeChainConfigArgs) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "applyChainConfigUpdates", chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPHome *CCIPHomeSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPHomeChainConfigArgs) (*types.Transaction, error) { + return _CCIPHome.Contract.ApplyChainConfigUpdates(&_CCIPHome.TransactOpts, chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPHome *CCIPHomeTransactorSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPHomeChainConfigArgs) (*types.Transaction, error) { + return _CCIPHome.Contract.ApplyChainConfigUpdates(&_CCIPHome.TransactOpts, chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPHome *CCIPHomeTransactor) BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, update []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "beforeCapabilityConfigSet", arg0, update, arg2, donId) +} + +func (_CCIPHome *CCIPHomeSession) BeforeCapabilityConfigSet(arg0 [][32]byte, update []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPHome.Contract.BeforeCapabilityConfigSet(&_CCIPHome.TransactOpts, arg0, update, arg2, donId) +} + +func (_CCIPHome *CCIPHomeTransactorSession) BeforeCapabilityConfigSet(arg0 [][32]byte, update []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPHome.Contract.BeforeCapabilityConfigSet(&_CCIPHome.TransactOpts, arg0, update, arg2, donId) +} + +func (_CCIPHome *CCIPHomeTransactor) PromoteCandidateAndRevokeActive(opts *bind.TransactOpts, donId uint32, pluginType uint8, digestToPromote [32]byte, digestToRevoke [32]byte) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "promoteCandidateAndRevokeActive", donId, pluginType, digestToPromote, digestToRevoke) +} + +func (_CCIPHome *CCIPHomeSession) PromoteCandidateAndRevokeActive(donId uint32, pluginType uint8, digestToPromote [32]byte, digestToRevoke [32]byte) (*types.Transaction, error) { + return _CCIPHome.Contract.PromoteCandidateAndRevokeActive(&_CCIPHome.TransactOpts, donId, pluginType, digestToPromote, digestToRevoke) +} + +func (_CCIPHome *CCIPHomeTransactorSession) PromoteCandidateAndRevokeActive(donId uint32, pluginType uint8, digestToPromote [32]byte, digestToRevoke [32]byte) (*types.Transaction, error) { + return _CCIPHome.Contract.PromoteCandidateAndRevokeActive(&_CCIPHome.TransactOpts, donId, pluginType, digestToPromote, digestToRevoke) +} + +func (_CCIPHome *CCIPHomeTransactor) RevokeCandidate(opts *bind.TransactOpts, donId uint32, pluginType uint8, configDigest [32]byte) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "revokeCandidate", donId, pluginType, configDigest) +} + +func (_CCIPHome *CCIPHomeSession) RevokeCandidate(donId uint32, pluginType uint8, configDigest [32]byte) (*types.Transaction, error) { + return _CCIPHome.Contract.RevokeCandidate(&_CCIPHome.TransactOpts, donId, pluginType, configDigest) +} + +func (_CCIPHome *CCIPHomeTransactorSession) RevokeCandidate(donId uint32, pluginType uint8, configDigest [32]byte) (*types.Transaction, error) { + return _CCIPHome.Contract.RevokeCandidate(&_CCIPHome.TransactOpts, donId, pluginType, configDigest) +} + +func (_CCIPHome *CCIPHomeTransactor) SetCandidate(opts *bind.TransactOpts, donId uint32, pluginType uint8, config CCIPHomeOCR3Config, digestToOverwrite [32]byte) (*types.Transaction, error) { + return _CCIPHome.contract.Transact(opts, "setCandidate", donId, pluginType, config, digestToOverwrite) +} + +func (_CCIPHome *CCIPHomeSession) SetCandidate(donId uint32, pluginType uint8, config CCIPHomeOCR3Config, digestToOverwrite [32]byte) (*types.Transaction, error) { + return _CCIPHome.Contract.SetCandidate(&_CCIPHome.TransactOpts, donId, pluginType, config, digestToOverwrite) +} + +func (_CCIPHome *CCIPHomeTransactorSession) SetCandidate(donId uint32, pluginType uint8, config CCIPHomeOCR3Config, digestToOverwrite [32]byte) (*types.Transaction, error) { + return _CCIPHome.Contract.SetCandidate(&_CCIPHome.TransactOpts, donId, pluginType, config, digestToOverwrite) +} + +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 CCIPHomeActiveConfigRevokedIterator struct { + Event *CCIPHomeActiveConfigRevoked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeActiveConfigRevokedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeActiveConfigRevoked) + 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(CCIPHomeActiveConfigRevoked) + 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 *CCIPHomeActiveConfigRevokedIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeActiveConfigRevokedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeActiveConfigRevoked struct { + ConfigDigest [32]byte + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterActiveConfigRevoked(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeActiveConfigRevokedIterator, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "ActiveConfigRevoked", configDigestRule) + if err != nil { + return nil, err + } + return &CCIPHomeActiveConfigRevokedIterator{contract: _CCIPHome.contract, event: "ActiveConfigRevoked", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchActiveConfigRevoked(opts *bind.WatchOpts, sink chan<- *CCIPHomeActiveConfigRevoked, configDigest [][32]byte) (event.Subscription, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "ActiveConfigRevoked", configDigestRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeActiveConfigRevoked) + if err := _CCIPHome.contract.UnpackLog(event, "ActiveConfigRevoked", 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) ParseActiveConfigRevoked(log types.Log) (*CCIPHomeActiveConfigRevoked, error) { + event := new(CCIPHomeActiveConfigRevoked) + if err := _CCIPHome.contract.UnpackLog(event, "ActiveConfigRevoked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPHomeCandidateConfigRevokedIterator struct { + Event *CCIPHomeCandidateConfigRevoked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeCandidateConfigRevokedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeCandidateConfigRevoked) + 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(CCIPHomeCandidateConfigRevoked) + 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 *CCIPHomeCandidateConfigRevokedIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeCandidateConfigRevokedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeCandidateConfigRevoked struct { + ConfigDigest [32]byte + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterCandidateConfigRevoked(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeCandidateConfigRevokedIterator, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "CandidateConfigRevoked", configDigestRule) + if err != nil { + return nil, err + } + return &CCIPHomeCandidateConfigRevokedIterator{contract: _CCIPHome.contract, event: "CandidateConfigRevoked", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchCandidateConfigRevoked(opts *bind.WatchOpts, sink chan<- *CCIPHomeCandidateConfigRevoked, configDigest [][32]byte) (event.Subscription, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "CandidateConfigRevoked", configDigestRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeCandidateConfigRevoked) + if err := _CCIPHome.contract.UnpackLog(event, "CandidateConfigRevoked", 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) ParseCandidateConfigRevoked(log types.Log) (*CCIPHomeCandidateConfigRevoked, error) { + event := new(CCIPHomeCandidateConfigRevoked) + if err := _CCIPHome.contract.UnpackLog(event, "CandidateConfigRevoked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +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 CCIPHomeConfigPromotedIterator struct { + Event *CCIPHomeConfigPromoted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPHomeConfigPromotedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPHomeConfigPromoted) + 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(CCIPHomeConfigPromoted) + 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 *CCIPHomeConfigPromotedIterator) Error() error { + return it.fail +} + +func (it *CCIPHomeConfigPromotedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPHomeConfigPromoted struct { + ConfigDigest [32]byte + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterConfigPromoted(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeConfigPromotedIterator, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "ConfigPromoted", configDigestRule) + if err != nil { + return nil, err + } + return &CCIPHomeConfigPromotedIterator{contract: _CCIPHome.contract, event: "ConfigPromoted", logs: logs, sub: sub}, nil +} + +func (_CCIPHome *CCIPHomeFilterer) WatchConfigPromoted(opts *bind.WatchOpts, sink chan<- *CCIPHomeConfigPromoted, configDigest [][32]byte) (event.Subscription, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "ConfigPromoted", configDigestRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPHomeConfigPromoted) + if err := _CCIPHome.contract.UnpackLog(event, "ConfigPromoted", 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) ParseConfigPromoted(log types.Log) (*CCIPHomeConfigPromoted, error) { + event := new(CCIPHomeConfigPromoted) + if err := _CCIPHome.contract.UnpackLog(event, "ConfigPromoted", 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 { + ConfigDigest [32]byte + Version uint32 + Config CCIPHomeOCR3Config + Raw types.Log +} + +func (_CCIPHome *CCIPHomeFilterer) FilterConfigSet(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeConfigSetIterator, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.FilterLogs(opts, "ConfigSet", configDigestRule) + 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, configDigest [][32]byte) (event.Subscription, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _CCIPHome.contract.WatchLogs(opts, "ConfigSet", configDigestRule) + 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 +} + +type GetAllConfigs struct { + ActiveConfig CCIPHomeVersionedConfig + CandidateConfig CCIPHomeVersionedConfig +} +type GetConfig struct { + VersionedConfig CCIPHomeVersionedConfig + Ok bool +} +type GetConfigDigests struct { + ActiveConfigDigest [32]byte + CandidateConfigDigest [32]byte +} + +func (_CCIPHome *CCIPHome) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CCIPHome.abi.Events["ActiveConfigRevoked"].ID: + return _CCIPHome.ParseActiveConfigRevoked(log) + case _CCIPHome.abi.Events["CandidateConfigRevoked"].ID: + return _CCIPHome.ParseCandidateConfigRevoked(log) + 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["ConfigPromoted"].ID: + return _CCIPHome.ParseConfigPromoted(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 (CCIPHomeActiveConfigRevoked) Topic() common.Hash { + return common.HexToHash("0x0b31c0055e2d464bef7781994b98c4ff9ef4ae0d05f59feb6a68c42de5e201b8") +} + +func (CCIPHomeCandidateConfigRevoked) Topic() common.Hash { + return common.HexToHash("0x53f5d9228f0a4173bea6e5931c9b3afe6eeb6692ede1d182952970f152534e3b") +} + +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 (CCIPHomeConfigPromoted) Topic() common.Hash { + return common.HexToHash("0xfc3e98dbbd47c3fa7c1c05b6ec711caeaf70eca4554192b9ada8fc11a37f298e") +} + +func (CCIPHomeConfigSet) Topic() common.Hash { + return common.HexToHash("0x94f085b7c57ec2a270befd0b7b2ec7452580040edee8bb0fb04609c81f0359c6") +} + +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 { + GetActiveDigest(opts *bind.CallOpts, donId uint32, pluginType uint8) ([32]byte, error) + + GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPHomeChainConfigArgs, error) + + GetAllConfigs(opts *bind.CallOpts, donId uint32, pluginType uint8) (GetAllConfigs, + + error) + + GetCandidateDigest(opts *bind.CallOpts, donId uint32, pluginType uint8) ([32]byte, error) + + GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) + + GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) + + GetConfig(opts *bind.CallOpts, donId uint32, pluginType uint8, configDigest [32]byte) (GetConfig, + + error) + + GetConfigDigests(opts *bind.CallOpts, donId uint32, pluginType uint8) (GetConfigDigests, + + error) + + GetNumChainConfigurations(opts *bind.CallOpts) (*big.Int, 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 []CCIPHomeChainConfigArgs) (*types.Transaction, error) + + BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, update []byte, arg2 uint64, donId uint32) (*types.Transaction, error) + + PromoteCandidateAndRevokeActive(opts *bind.TransactOpts, donId uint32, pluginType uint8, digestToPromote [32]byte, digestToRevoke [32]byte) (*types.Transaction, error) + + RevokeCandidate(opts *bind.TransactOpts, donId uint32, pluginType uint8, configDigest [32]byte) (*types.Transaction, error) + + SetCandidate(opts *bind.TransactOpts, donId uint32, pluginType uint8, config CCIPHomeOCR3Config, digestToOverwrite [32]byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterActiveConfigRevoked(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeActiveConfigRevokedIterator, error) + + WatchActiveConfigRevoked(opts *bind.WatchOpts, sink chan<- *CCIPHomeActiveConfigRevoked, configDigest [][32]byte) (event.Subscription, error) + + ParseActiveConfigRevoked(log types.Log) (*CCIPHomeActiveConfigRevoked, error) + + FilterCandidateConfigRevoked(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeCandidateConfigRevokedIterator, error) + + WatchCandidateConfigRevoked(opts *bind.WatchOpts, sink chan<- *CCIPHomeCandidateConfigRevoked, configDigest [][32]byte) (event.Subscription, error) + + ParseCandidateConfigRevoked(log types.Log) (*CCIPHomeCandidateConfigRevoked, 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) + + FilterConfigPromoted(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeConfigPromotedIterator, error) + + WatchConfigPromoted(opts *bind.WatchOpts, sink chan<- *CCIPHomeConfigPromoted, configDigest [][32]byte) (event.Subscription, error) + + ParseConfigPromoted(log types.Log) (*CCIPHomeConfigPromoted, error) + + FilterConfigSet(opts *bind.FilterOpts, configDigest [][32]byte) (*CCIPHomeConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPHomeConfigSet, configDigest [][32]byte) (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 deleted file mode 100644 index 7dfa6869e7..0000000000 --- a/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package ocr3_config_encoder - -import ( - "errors" - "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" -) - -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -type CCIPConfigTypesOCR3Config struct { - PluginType uint8 - ChainSelector uint64 - FRoleDON uint8 - OffchainConfigVersion uint64 - OfframpAddress []byte - RmnHomeAddress []byte - Nodes []CCIPConfigTypesOCR3Node - OffchainConfig []byte -} - -type CCIPConfigTypesOCR3Node 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\"},{\"internalType\":\"bytes\",\"name\":\"rmnHomeAddress\",\"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\"}]", -} - -var IOCR3ConfigEncoderABI = IOCR3ConfigEncoderMetaData.ABI - -type IOCR3ConfigEncoder struct { - address common.Address - abi abi.ABI - IOCR3ConfigEncoderCaller - IOCR3ConfigEncoderTransactor - IOCR3ConfigEncoderFilterer -} - -type IOCR3ConfigEncoderCaller struct { - contract *bind.BoundContract -} - -type IOCR3ConfigEncoderTransactor struct { - contract *bind.BoundContract -} - -type IOCR3ConfigEncoderFilterer struct { - contract *bind.BoundContract -} - -type IOCR3ConfigEncoderSession struct { - Contract *IOCR3ConfigEncoder - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type IOCR3ConfigEncoderCallerSession struct { - Contract *IOCR3ConfigEncoderCaller - CallOpts bind.CallOpts -} - -type IOCR3ConfigEncoderTransactorSession struct { - Contract *IOCR3ConfigEncoderTransactor - TransactOpts bind.TransactOpts -} - -type IOCR3ConfigEncoderRaw struct { - Contract *IOCR3ConfigEncoder -} - -type IOCR3ConfigEncoderCallerRaw struct { - Contract *IOCR3ConfigEncoderCaller -} - -type IOCR3ConfigEncoderTransactorRaw struct { - Contract *IOCR3ConfigEncoderTransactor -} - -func NewIOCR3ConfigEncoder(address common.Address, backend bind.ContractBackend) (*IOCR3ConfigEncoder, error) { - abi, err := abi.JSON(strings.NewReader(IOCR3ConfigEncoderABI)) - if err != nil { - return nil, err - } - contract, err := bindIOCR3ConfigEncoder(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IOCR3ConfigEncoder{address: address, abi: abi, IOCR3ConfigEncoderCaller: IOCR3ConfigEncoderCaller{contract: contract}, IOCR3ConfigEncoderTransactor: IOCR3ConfigEncoderTransactor{contract: contract}, IOCR3ConfigEncoderFilterer: IOCR3ConfigEncoderFilterer{contract: contract}}, nil -} - -func NewIOCR3ConfigEncoderCaller(address common.Address, caller bind.ContractCaller) (*IOCR3ConfigEncoderCaller, error) { - contract, err := bindIOCR3ConfigEncoder(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IOCR3ConfigEncoderCaller{contract: contract}, nil -} - -func NewIOCR3ConfigEncoderTransactor(address common.Address, transactor bind.ContractTransactor) (*IOCR3ConfigEncoderTransactor, error) { - contract, err := bindIOCR3ConfigEncoder(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IOCR3ConfigEncoderTransactor{contract: contract}, nil -} - -func NewIOCR3ConfigEncoderFilterer(address common.Address, filterer bind.ContractFilterer) (*IOCR3ConfigEncoderFilterer, error) { - contract, err := bindIOCR3ConfigEncoder(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IOCR3ConfigEncoderFilterer{contract: contract}, nil -} - -func bindIOCR3ConfigEncoder(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IOCR3ConfigEncoderMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderCaller.contract.Call(opts, result, method, params...) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderTransactor.contract.Transfer(opts) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderTransactor.contract.Transact(opts, method, params...) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IOCR3ConfigEncoder.Contract.contract.Call(opts, result, method, params...) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IOCR3ConfigEncoder.Contract.contract.Transfer(opts) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IOCR3ConfigEncoder.Contract.contract.Transact(opts, method, params...) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCaller) ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) { - var out []interface{} - err := _IOCR3ConfigEncoder.contract.Call(opts, &out, "exposeOCR3Config", config) - - if err != nil { - return *new([]byte), err - } - - out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) - - return out0, err - -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { - return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { - return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) -} - -func (_IOCR3ConfigEncoder *IOCR3ConfigEncoder) Address() common.Address { - return _IOCR3ConfigEncoder.address -} - -type IOCR3ConfigEncoderInterface interface { - ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]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 215ac3988f..b4c5c52e82 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 @@ -3,9 +3,9 @@ burn_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnFromMintTokenPool burn_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.bin 3e8e3358f0bb520af069a7d37ea625940a88461a54418b1d5925eabced8c74df 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 a63406386676963a292fa6ef41bf6302fbf0421599a3fc83c786fa5d3adb063a -ccip_encoding_utils: ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.bin ebabd5311ad4374df0f2f5cd5640bb58d938d92f5a82962ac4df7b6e5af2c197 +burn_with_from_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.bin 1ed5c299f928529081dc01b7a46db2b5e6728001767863495a7675d8db99a9e2 +ccip_encoding_utils: ../../../contracts/solc/v0.8.24/ICCIPEncodingUtils/ICCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/ICCIPEncodingUtils/ICCIPEncodingUtils.bin 2e6fa009821d30a24efdc9f9d14b2269fb9a51cb7d536ea8b2d29d97dd8b591c +ccip_home: ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.abi ../../../contracts/solc/v0.8.24/CCIPHome/CCIPHome.bin 87de30d71a511f936bdeecb01a88a70ad3f323117202ebb17cdbdc84d65a3857 ccip_reader_tester: ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin 32916b41e0070cb6853d558bbff06ab367324fa52cac59893065e8f616ff14f0 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,6 @@ 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 eaec75ca5276a95f934f4da6ea7351520541813628ed1450ef5e6cf7005b2724 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 4f29f05261bdaf9b99e675c1169c0d5cba841b6dd7ca3a8997cc0d3cae7ba850 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..e6f76fb8bc 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 @@ -41,12 +41,11 @@ package ccip //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.abi ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.bin ReportCodec report_codec //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.abi ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.bin EtherSenderReceiver ether_sender_receiver //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/WETH9/WETH9.abi ../../../contracts/solc/v0.8.24/WETH9/WETH9.bin WETH9 weth9 -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin IOCR3ConfigEncoder ocr3_config_encoder //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.abi ../../../contracts/solc/v0.8.24/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.bin MockE2EUSDCTokenMessenger mock_usdc_token_messenger //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.abi ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.bin MockE2EUSDCTransmitter mock_usdc_token_transmitter // EncodingUtils -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/CCIPEncodingUtils/CCIPEncodingUtils.bin EncodingUtils ccip_encoding_utils +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ICCIPEncodingUtils/ICCIPEncodingUtils.abi ../../../contracts/solc/v0.8.24/ICCIPEncodingUtils/ICCIPEncodingUtils.bin EncodingUtils ccip_encoding_utils // To run these commands, you must either install docker, or the correct version // of abigen. The latter can be installed with these commands, at least on linux: