From ffc4a2f38e044a46555a276ce5d36aa0fab90c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Evaldas=20Lato=C5=A1kinas?= <34982762+elatoskinas@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:31:29 +0200 Subject: [PATCH] PriceRegistry - remove token price staleness validations (#993) ## Motivation The token price & gas price staleness validations in the PriceRegistry serve as an update staleness validation. However, since this is already captured by the gas price updates, the token price staleness checks can be removed completely, especially since most tokens will be priced through data feeds (where the staleness check should be skipped for decoupling) ## Solution * Removes the staleness threshold check for all token price flows, keeping the check only on `getTokenAndGasPrices` * Refactors PriceRegistry price updaters to use the `AuthorizedCallers` shared contract --- contracts/.husky/pre-push | 1 - contracts/gas-snapshots/ccip.gas-snapshot | 218 ++++++----- contracts/src/v0.8/ccip/PriceRegistry.sol | 88 ++--- .../ccip/test/commitStore/CommitStore.t.sol | 5 +- .../offRamp/EVM2EVMMultiOffRampSetup.t.sol | 9 +- .../ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol | 18 - .../v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol | 18 - .../test/priceRegistry/PriceRegistry.t.sol | 156 +++----- .../price_registry/price_registry.go | 343 ++++++++++++++++-- ...rapper-dependency-versions-do-not-edit.txt | 2 +- .../ccip/mocks/price_registry_interface.go | 272 +++++++++++--- .../ccip/testhelpers/ccip_contracts.go | 31 +- .../ccip-tests/contracts/contract_models.go | 8 +- 13 files changed, 748 insertions(+), 421 deletions(-) diff --git a/contracts/.husky/pre-push b/contracts/.husky/pre-push index e3a7a6dcb1..dfa33c3942 100644 --- a/contracts/.husky/pre-push +++ b/contracts/.husky/pre-push @@ -17,7 +17,6 @@ if ! [[ -n $changes_root ]]; then exit 0 fi -./contracts/.husky/verify-changeset.sh cd contracts FOUNDRY_PROFILE=$FOUNDRY_PROFILE forge build diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index bb3b9771f7..b7078f8594 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -84,22 +84,22 @@ CCIPCapabilityConfiguration_validateConfig:test__validateConfig_TooManyBootstrap CCIPCapabilityConfiguration_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 1120660) CCIPCapabilityConfiguration_validateConfig:test__validateConfig_TooManyTransmitters_Reverts() (gas: 1119000) CCIPCapabilityConfiguration_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9540) -CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2133850) +CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2132891) CommitStore_constructor:test_Constructor_Success() (gas: 3091440) CommitStore_isUnpausedAndRMNHealthy:test_RMN_Success() (gas: 75331) CommitStore_report:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 28784) CommitStore_report:test_InvalidInterval_Revert() (gas: 28724) CommitStore_report:test_InvalidRootRevert() (gas: 27957) -CommitStore_report:test_OnlyGasPriceUpdates_Success() (gas: 55480) -CommitStore_report:test_OnlyPriceUpdateStaleReport_Revert() (gas: 61390) -CommitStore_report:test_OnlyTokenPriceUpdates_Success() (gas: 55478) +CommitStore_report:test_OnlyGasPriceUpdates_Success() (gas: 55519) +CommitStore_report:test_OnlyPriceUpdateStaleReport_Revert() (gas: 61429) +CommitStore_report:test_OnlyTokenPriceUpdates_Success() (gas: 55517) CommitStore_report:test_Paused_Revert() (gas: 21259) -CommitStore_report:test_ReportAndPriceUpdate_Success() (gas: 86469) +CommitStore_report:test_ReportAndPriceUpdate_Success() (gas: 86508) CommitStore_report:test_ReportOnlyRootSuccess_gas() (gas: 56427) CommitStore_report:test_RootAlreadyCommitted_Revert() (gas: 64197) CommitStore_report:test_StaleReportWithRoot_Success() (gas: 119502) CommitStore_report:test_Unhealthy_Revert() (gas: 44801) -CommitStore_report:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 103026) +CommitStore_report:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 103065) CommitStore_report:test_ZeroEpochAndRound_Revert() (gas: 27740) CommitStore_resetUnblessedRoots:test_OnlyOwner_Revert() (gas: 11325) CommitStore_resetUnblessedRoots:test_ResetUnblessedRoots_Success() (gas: 140460) @@ -115,7 +115,7 @@ CommitStore_verify:test_Paused_Revert() (gas: 18496) CommitStore_verify:test_TooManyLeaves_Revert() (gas: 36785) DefensiveExampleTest:test_HappyPath_Success() (gas: 200018) DefensiveExampleTest:test_Recovery() (gas: 424253) -E2E:test_E2E_3MessagesSuccess_gas() (gas: 1106837) +E2E:test_E2E_3MessagesSuccess_gas() (gas: 1106426) EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_NotACompatiblePool_Revert() (gas: 38297) EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 108537) EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_TokenHandlingError_revert_Revert() (gas: 116989) @@ -139,20 +139,20 @@ EVM2EVMMultiOffRamp_ccipReceive:test_Reverts() (gas: 17112) EVM2EVMMultiOffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 66098) EVM2EVMMultiOffRamp_commit:test_InvalidInterval_Revert() (gas: 59748) EVM2EVMMultiOffRamp_commit:test_InvalidRootRevert() (gas: 58828) -EVM2EVMMultiOffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6589672) -EVM2EVMMultiOffRamp_commit:test_NoConfig_Revert() (gas: 6172841) -EVM2EVMMultiOffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 108294) -EVM2EVMMultiOffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 118230) -EVM2EVMMultiOffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 108270) -EVM2EVMMultiOffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 160084) +EVM2EVMMultiOffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6589848) +EVM2EVMMultiOffRamp_commit:test_NoConfig_Revert() (gas: 6173017) +EVM2EVMMultiOffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 108333) +EVM2EVMMultiOffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 118269) +EVM2EVMMultiOffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 108309) +EVM2EVMMultiOffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 160123) EVM2EVMMultiOffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 135123) EVM2EVMMultiOffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 136820) EVM2EVMMultiOffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 59096) EVM2EVMMultiOffRamp_commit:test_StaleReportWithRoot_Success() (gas: 225356) -EVM2EVMMultiOffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 119693) +EVM2EVMMultiOffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 119732) EVM2EVMMultiOffRamp_commit:test_Unhealthy_Revert() (gas: 77594) -EVM2EVMMultiOffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 207937) -EVM2EVMMultiOffRamp_commit:test_WrongConfigWithoutSigners_Revert() (gas: 6584042) +EVM2EVMMultiOffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 207976) +EVM2EVMMultiOffRamp_commit:test_WrongConfigWithoutSigners_Revert() (gas: 6584218) EVM2EVMMultiOffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 47717) EVM2EVMMultiOffRamp_constructor:test_Constructor_Success() (gas: 6242606) EVM2EVMMultiOffRamp_constructor:test_SourceChainSelector_Revert() (gas: 101021) @@ -164,12 +164,12 @@ EVM2EVMMultiOffRamp_execute:test_IncorrectArrayType_Revert() (gas: 17299) EVM2EVMMultiOffRamp_execute:test_LargeBatch_Success() (gas: 1490148) EVM2EVMMultiOffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 330086) EVM2EVMMultiOffRamp_execute:test_MultipleReports_Success() (gas: 247239) -EVM2EVMMultiOffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6640018) -EVM2EVMMultiOffRamp_execute:test_NoConfig_Revert() (gas: 6222985) +EVM2EVMMultiOffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6640155) +EVM2EVMMultiOffRamp_execute:test_NoConfig_Revert() (gas: 6223122) EVM2EVMMultiOffRamp_execute:test_NonArray_Revert() (gas: 30044) EVM2EVMMultiOffRamp_execute:test_SingleReport_Success() (gas: 156627) EVM2EVMMultiOffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 140575) -EVM2EVMMultiOffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 7002111) +EVM2EVMMultiOffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 7002248) EVM2EVMMultiOffRamp_execute:test_ZeroReports_Revert() (gas: 17174) EVM2EVMMultiOffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 20709) EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 255851) @@ -213,7 +213,7 @@ EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedNonceStartsAtV1Nonce_Success() EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() (gas: 270573) EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() (gas: 247753) EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedSenderNoncesReadsPreviousRamp_Success() (gas: 235728) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedWithMultiRamp_Revert() (gas: 7174963) +EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedWithMultiRamp_Revert() (gas: 7175100) EVM2EVMMultiOffRamp_execute_upgrade:test_Upgraded_Success() (gas: 136472) EVM2EVMMultiOffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3652910) EVM2EVMMultiOffRamp_getExecutionState:test_GetDifferentChainExecutionState_Success() (gas: 118102) @@ -292,11 +292,11 @@ EVM2EVMMultiOnRamp_forwardFromRouter:test_Paused_Revert() (gas: 41601) EVM2EVMMultiOnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 25974) EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 210126) EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 140440) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 167563) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 167289) EVM2EVMMultiOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3776784) EVM2EVMMultiOnRamp_forwardFromRouter:test_TooManyTokens_Revert() (gas: 30892) EVM2EVMMultiOnRamp_forwardFromRouter:test_Unhealthy_Revert() (gas: 44285) -EVM2EVMMultiOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 133274) +EVM2EVMMultiOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 133270) EVM2EVMMultiOnRamp_forwardFromRouter:test_ZeroAddressReceiver_Revert() (gas: 260742) EVM2EVMMultiOnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 96398) EVM2EVMMultiOnRamp_forwardFromRouter:test_forwardFromRouter_WithValidation_Success() (gas: 278652) @@ -304,27 +304,26 @@ EVM2EVMMultiOnRamp_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvaila EVM2EVMMultiOnRamp_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() (gas: 11969) EVM2EVMMultiOnRamp_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 24460) EVM2EVMMultiOnRamp_getFee:test_DestinationChainNotEnabled_Revert() (gas: 15458) -EVM2EVMMultiOnRamp_getFee:test_EmptyMessage_Success() (gas: 92317) -EVM2EVMMultiOnRamp_getFee:test_HighGasMessage_Success() (gas: 248867) +EVM2EVMMultiOnRamp_getFee:test_EmptyMessage_Success() (gas: 92043) +EVM2EVMMultiOnRamp_getFee:test_HighGasMessage_Success() (gas: 248593) EVM2EVMMultiOnRamp_getFee:test_MessageGasLimitTooHigh_Revert() (gas: 17098) EVM2EVMMultiOnRamp_getFee:test_MessageTooLarge_Revert() (gas: 95727) -EVM2EVMMultiOnRamp_getFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 174129) +EVM2EVMMultiOnRamp_getFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 172895) EVM2EVMMultiOnRamp_getFee:test_NotAFeeToken_Revert() (gas: 20074) -EVM2EVMMultiOnRamp_getFee:test_SingleTokenMessage_Success() (gas: 132065) +EVM2EVMMultiOnRamp_getFee:test_SingleTokenMessage_Success() (gas: 131471) EVM2EVMMultiOnRamp_getFee:test_TooManyTokens_Revert() (gas: 18235) -EVM2EVMMultiOnRamp_getFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 77374) +EVM2EVMMultiOnRamp_getFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 77237) EVM2EVMMultiOnRamp_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10438) EVM2EVMMultiOnRamp_getTokenPool:test_GetTokenPool_Success() (gas: 35261) -EVM2EVMMultiOnRamp_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 47457) +EVM2EVMMultiOnRamp_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 47297) EVM2EVMMultiOnRamp_getTokenTransferCost:test_FeeTokenBpsFee_Success() (gas: 35287) EVM2EVMMultiOnRamp_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas_Success() (gas: 28361) -EVM2EVMMultiOnRamp_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 130857) +EVM2EVMMultiOnRamp_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 129897) EVM2EVMMultiOnRamp_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 15253) EVM2EVMMultiOnRamp_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Success() (gas: 28169) EVM2EVMMultiOnRamp_getTokenTransferCost:test_UnsupportedToken_Revert() (gas: 21263) -EVM2EVMMultiOnRamp_getTokenTransferCost:test_ValidatedPriceStaleness_Revert() (gas: 43490) EVM2EVMMultiOnRamp_getTokenTransferCost:test_WETHTokenBpsFee_Success() (gas: 41222) -EVM2EVMMultiOnRamp_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28214) +EVM2EVMMultiOnRamp_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28192) EVM2EVMMultiOnRamp_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 40577) EVM2EVMMultiOnRamp_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 31690) EVM2EVMMultiOnRamp_setDynamicConfig:test_SetConfigInvalidConfigFeeAggregatorEqAddressZero_Revert() (gas: 11334) @@ -336,8 +335,8 @@ EVM2EVMMultiOnRamp_withdrawFeeTokens:test_WithdrawFeeTokens_Success() (gas: 9712 EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_NotACompatiblePool_Revert() (gas: 38076) EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_Success() (gas: 108365) EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_TokenHandlingError_revert_Revert() (gas: 116906) -EVM2EVMOffRamp__releaseOrMintTokens:test_OverValueWithARLOff_Success() (gas: 392221) -EVM2EVMOffRamp__releaseOrMintTokens:test_PriceNotFoundForToken_Reverts() (gas: 145344) +EVM2EVMOffRamp__releaseOrMintTokens:test_OverValueWithARLOff_Success() (gas: 392217) +EVM2EVMOffRamp__releaseOrMintTokens:test_PriceNotFoundForToken_Reverts() (gas: 145340) EVM2EVMOffRamp__releaseOrMintTokens:test_RateLimitErrors_Reverts() (gas: 789345) EVM2EVMOffRamp__releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 176477) EVM2EVMOffRamp__releaseOrMintTokens:test__releaseOrMintTokens_NotACompatiblePool_Reverts() (gas: 29724) @@ -433,17 +432,17 @@ EVM2EVMOnRamp_forwardFromRouter:test_MaxFeeBalanceReached_Revert() (gas: 36581) EVM2EVMOnRamp_forwardFromRouter:test_MessageGasLimitTooHigh_Revert() (gas: 29163) EVM2EVMOnRamp_forwardFromRouter:test_MessageTooLarge_Revert() (gas: 107646) EVM2EVMOnRamp_forwardFromRouter:test_OriginalSender_Revert() (gas: 22755) -EVM2EVMOnRamp_forwardFromRouter:test_OverValueWithARLOff_Success() (gas: 224153) +EVM2EVMOnRamp_forwardFromRouter:test_OverValueWithARLOff_Success() (gas: 224149) EVM2EVMOnRamp_forwardFromRouter:test_Paused_Revert() (gas: 54055) EVM2EVMOnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 25601) -EVM2EVMOnRamp_forwardFromRouter:test_PriceNotFoundForToken_Revert() (gas: 59218) +EVM2EVMOnRamp_forwardFromRouter:test_PriceNotFoundForToken_Revert() (gas: 59214) EVM2EVMOnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 182848) EVM2EVMOnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 178451) -EVM2EVMOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 137739) +EVM2EVMOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 137465) EVM2EVMOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3735328) EVM2EVMOnRamp_forwardFromRouter:test_TooManyTokens_Revert() (gas: 30285) EVM2EVMOnRamp_forwardFromRouter:test_Unhealthy_Revert() (gas: 43401) -EVM2EVMOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 109475) +EVM2EVMOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 109471) EVM2EVMOnRamp_forwardFromRouter:test_ZeroAddressReceiver_Revert() (gas: 336597) EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_ShouldStoreLinkFees_Success() (gas: 112694) EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 72534) @@ -453,28 +452,27 @@ EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2SenderNoncesReadsPreviousRamp_Suc EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2_Success() (gas: 95509) EVM2EVMOnRamp_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 20760) EVM2EVMOnRamp_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 21128) -EVM2EVMOnRamp_getFee:test_EmptyMessage_Success() (gas: 78468) -EVM2EVMOnRamp_getFee:test_HighGasMessage_Success() (gas: 234316) +EVM2EVMOnRamp_getFee:test_EmptyMessage_Success() (gas: 78194) +EVM2EVMOnRamp_getFee:test_HighGasMessage_Success() (gas: 234042) EVM2EVMOnRamp_getFee:test_MessageGasLimitTooHigh_Revert() (gas: 16715) EVM2EVMOnRamp_getFee:test_MessageTooLarge_Revert() (gas: 95271) -EVM2EVMOnRamp_getFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 160232) +EVM2EVMOnRamp_getFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 158998) EVM2EVMOnRamp_getFee:test_NotAFeeToken_Revert() (gas: 24093) -EVM2EVMOnRamp_getFee:test_SingleTokenMessage_Success() (gas: 118358) +EVM2EVMOnRamp_getFee:test_SingleTokenMessage_Success() (gas: 117764) EVM2EVMOnRamp_getFee:test_TooManyTokens_Revert() (gas: 19902) -EVM2EVMOnRamp_getFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 65776) +EVM2EVMOnRamp_getFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 65639) EVM2EVMOnRamp_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10460) EVM2EVMOnRamp_getTokenPool:test_GetTokenPool_Success() (gas: 35195) -EVM2EVMOnRamp_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 45213) -EVM2EVMOnRamp_getTokenTransferCost:test_FeeTokenBpsFee_Success() (gas: 33019) +EVM2EVMOnRamp_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 45008) +EVM2EVMOnRamp_getTokenTransferCost:test_FeeTokenBpsFee_Success() (gas: 33041) EVM2EVMOnRamp_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas_Success() (gas: 28296) -EVM2EVMOnRamp_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 130975) -EVM2EVMOnRamp_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 15238) +EVM2EVMOnRamp_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 130015) +EVM2EVMOnRamp_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 15260) EVM2EVMOnRamp_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Success() (gas: 28104) EVM2EVMOnRamp_getTokenTransferCost:test_UnsupportedToken_Revert() (gas: 21248) -EVM2EVMOnRamp_getTokenTransferCost:test_ValidatedPriceStaleness_Revert() (gas: 43460) -EVM2EVMOnRamp_getTokenTransferCost:test_WETHTokenBpsFee_Success() (gas: 38989) +EVM2EVMOnRamp_getTokenTransferCost:test_WETHTokenBpsFee_Success() (gas: 38922) EVM2EVMOnRamp_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28149) -EVM2EVMOnRamp_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 38619) +EVM2EVMOnRamp_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 38641) EVM2EVMOnRamp_getTokenTransferCost:test__getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 29527) EVM2EVMOnRamp_linkAvailableForPayment:test_InsufficientLinkBalance_Success() (gas: 32615) EVM2EVMOnRamp_linkAvailableForPayment:test_LinkAvailableForPayment_Success() (gas: 134879) @@ -648,7 +646,7 @@ MultiOCR3Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 24191) MultiOCR3Base_transmit:test_UnauthorizedSigner_Revert() (gas: 61409) MultiOCR3Base_transmit:test_UnconfiguredPlugin_Revert() (gas: 39890) MultiOCR3Base_transmit:test_ZeroSignatures_Revert() (gas: 32973) -MultiRampsE2E:test_E2E_3MessagesSuccess_gas() (gas: 1382250) +MultiRampsE2E:test_E2E_3MessagesSuccess_gas() (gas: 1381839) NonceManagerTest_getIncrementedOutboundNonce:test_getIncrementedOutboundNonce_Success() (gas: 40392) NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 68976) NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOnRamp_Revert() (gas: 38712) @@ -683,51 +681,47 @@ OCR2Base_transmit:test_Transmit2SignersSuccess_gas() (gas: 51686) OCR2Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 23484) OCR2Base_transmit:test_UnauthorizedSigner_Revert() (gas: 39665) OCR2Base_transmit:test_WrongNumberOfSignatures_Revert() (gas: 20557) -OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 381362) -PingPong_ccipReceive:test_CcipReceive_Success() (gas: 148868) +OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 380951) +PingPong_ccipReceive:test_CcipReceive_Success() (gas: 148731) PingPong_plumbing:test_Pausing_Success() (gas: 17803) -PingPong_startPingPong:test_StartPingPong_Success() (gas: 178941) +PingPong_startPingPong:test_StartPingPong_Success() (gas: 178667) PriceRegistry_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates_Success() (gas: 79823) PriceRegistry_applyFeeTokensUpdates:test_OnlyCallableByOwner_Revert() (gas: 12580) -PriceRegistry_applyPriceUpdatersUpdates:test_ApplyPriceUpdaterUpdates_Success() (gas: 82654) -PriceRegistry_applyPriceUpdatersUpdates:test_OnlyCallableByOwner_Revert() (gas: 12624) -PriceRegistry_constructor:test_InvalidStalenessThreshold_Revert() (gas: 67332) -PriceRegistry_constructor:test_Setup_Success() (gas: 1868487) -PriceRegistry_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 72964) -PriceRegistry_convertTokenAmount:test_LinkTokenNotSupported_Revert() (gas: 31054) -PriceRegistry_convertTokenAmount:test_StaleFeeToken_Revert() (gas: 36931) -PriceRegistry_convertTokenAmount:test_StaleLinkToken_Revert() (gas: 33954) -PriceRegistry_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices_Success() (gas: 70558) -PriceRegistry_getTokenAndGasPrices:test_StaleGasPrice_Revert() (gas: 16838) -PriceRegistry_getTokenAndGasPrices:test_StaleTokenPrice_Revert() (gas: 32343) -PriceRegistry_getTokenAndGasPrices:test_UnsupportedChain_Revert() (gas: 16140) -PriceRegistry_getTokenAndGasPrices:test_ZeroGasPrice_Success() (gas: 45707) -PriceRegistry_getTokenPrice:test_GetTokenPriceFromFeed_Success() (gas: 62174) -PriceRegistry_getTokenPrices:test_GetTokenPrices_Success() (gas: 84717) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 2094577) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 2094557) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 2074676) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 2094396) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 2094535) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 2094347) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 62042) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 61989) -PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 61129) -PriceRegistry_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 2093891) -PriceRegistry_getValidatedTokenPrice:test_StaleFeeToken_Revert() (gas: 19511) -PriceRegistry_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 109043) -PriceRegistry_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 13858) -PriceRegistry_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 2092591) -PriceRegistry_updatePrices:test_OnlyCallableByUpdaterOrOwner_Revert() (gas: 14051) -PriceRegistry_updatePrices:test_OnlyGasPrice_Success() (gas: 23484) -PriceRegistry_updatePrices:test_OnlyTokenPrice_Success() (gas: 30495) -PriceRegistry_updatePrices:test_UpdateMultiplePrices_Success() (gas: 151016) -PriceRegistry_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 50615) -PriceRegistry_updateTokenPriceFeeds:test_FeedUnset_Success() (gas: 63624) -PriceRegistry_updateTokenPriceFeeds:test_FeedUpdatedByNonOwner_Revert() (gas: 19976) -PriceRegistry_updateTokenPriceFeeds:test_MultipleFeedUpdate_Success() (gas: 89016) -PriceRegistry_updateTokenPriceFeeds:test_SingleFeedUpdate_Success() (gas: 50865) -PriceRegistry_updateTokenPriceFeeds:test_ZeroFeeds_Success() (gas: 12340) +PriceRegistry_constructor:test_InvalidStalenessThreshold_Revert() (gas: 67418) +PriceRegistry_constructor:test_Setup_Success() (gas: 1870666) +PriceRegistry_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 72712) +PriceRegistry_convertTokenAmount:test_LinkTokenNotSupported_Revert() (gas: 30917) +PriceRegistry_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices_Success() (gas: 70421) +PriceRegistry_getTokenAndGasPrices:test_StaleGasPrice_Revert() (gas: 16816) +PriceRegistry_getTokenAndGasPrices:test_UnsupportedChain_Revert() (gas: 16118) +PriceRegistry_getTokenAndGasPrices:test_ZeroGasPrice_Success() (gas: 45566) +PriceRegistry_getTokenPrice:test_GetTokenPriceFromFeed_Success() (gas: 62166) +PriceRegistry_getTokenPrices:test_GetTokenPrices_Success() (gas: 84739) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 2094281) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 2094239) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 2074358) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 2094013) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 2094217) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 2094029) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 61896) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 61776) +PriceRegistry_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 60969) +PriceRegistry_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 2093741) +PriceRegistry_getValidatedTokenPrice:test_StaleFeeToken_Success() (gas: 61496) +PriceRegistry_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 109012) +PriceRegistry_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 13790) +PriceRegistry_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 2092419) +PriceRegistry_updatePrices:test_OnlyCallableByUpdaterOrOwner_Revert() (gas: 14240) +PriceRegistry_updatePrices:test_OnlyGasPrice_Success() (gas: 23436) +PriceRegistry_updatePrices:test_OnlyTokenPrice_Success() (gas: 30424) +PriceRegistry_updatePrices:test_UpdatableByAuthorizedCaller_Success() (gas: 89738) +PriceRegistry_updatePrices:test_UpdateMultiplePrices_Success() (gas: 151078) +PriceRegistry_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 50483) +PriceRegistry_updateTokenPriceFeeds:test_FeedUnset_Success() (gas: 63448) +PriceRegistry_updateTokenPriceFeeds:test_FeedUpdatedByNonOwner_Revert() (gas: 19932) +PriceRegistry_updateTokenPriceFeeds:test_MultipleFeedUpdate_Success() (gas: 88796) +PriceRegistry_updateTokenPriceFeeds:test_SingleFeedUpdate_Success() (gas: 50733) +PriceRegistry_updateTokenPriceFeeds:test_ZeroFeeds_Success() (gas: 12296) RMN_constructor:test_Constructor_Success() (gas: 58091) RMN_ownerUnbless:test_Unbless_Success() (gas: 71926) RMN_ownerUnvoteToCurse:test_CanBlessAndCurseAfterRecovery() (gas: 236626) @@ -784,24 +778,24 @@ Router_applyRampUpdates:test_OffRampMismatch_Revert() (gas: 89288) Router_applyRampUpdates:test_OffRampUpdatesWithRouting() (gas: 10643448) Router_applyRampUpdates:test_OnRampDisable() (gas: 55913) Router_applyRampUpdates:test_OnlyOwner_Revert() (gas: 12311) -Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 114349) -Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 201300) -Router_ccipSend:test_CCIPSendNativeFeeNoTokenSuccess_gas() (gas: 129231) -Router_ccipSend:test_CCIPSendNativeFeeOneTokenSuccess_gas() (gas: 216184) -Router_ccipSend:test_FeeTokenAmountTooLow_Revert() (gas: 66394) +Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 114212) +Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 201163) +Router_ccipSend:test_CCIPSendNativeFeeNoTokenSuccess_gas() (gas: 128820) +Router_ccipSend:test_CCIPSendNativeFeeOneTokenSuccess_gas() (gas: 215773) +Router_ccipSend:test_FeeTokenAmountTooLow_Revert() (gas: 66257) Router_ccipSend:test_InvalidMsgValue() (gas: 31969) -Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 68830) -Router_ccipSend:test_NativeFeeTokenOverpay_Success() (gas: 174441) -Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 56156) -Router_ccipSend:test_NativeFeeToken_Success() (gas: 173035) -Router_ccipSend:test_NonLinkFeeToken_Success() (gas: 243433) +Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 68693) +Router_ccipSend:test_NativeFeeTokenOverpay_Success() (gas: 173893) +Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 56019) +Router_ccipSend:test_NativeFeeToken_Success() (gas: 172487) +Router_ccipSend:test_NonLinkFeeToken_Success() (gas: 243022) Router_ccipSend:test_UnsupportedDestinationChain_Revert() (gas: 24755) Router_ccipSend:test_WhenNotHealthy_Revert() (gas: 44669) -Router_ccipSend:test_WrappedNativeFeeToken_Success() (gas: 175251) -Router_ccipSend:test_ZeroFeeAndGasPrice_Success() (gas: 243821) +Router_ccipSend:test_WrappedNativeFeeToken_Success() (gas: 174703) +Router_ccipSend:test_ZeroFeeAndGasPrice_Success() (gas: 243269) Router_constructor:test_Constructor_Success() (gas: 13074) Router_getArmProxy:test_getArmProxy() (gas: 10561) -Router_getFee:test_GetFeeSupportedChain_Success() (gas: 46577) +Router_getFee:test_GetFeeSupportedChain_Success() (gas: 46440) Router_getFee:test_UnsupportedDestinationChain_Revert() (gas: 17138) Router_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10460) Router_recoverTokens:test_RecoverTokensInvalidRecipient_Revert() (gas: 11316) @@ -816,7 +810,7 @@ Router_routeMessage:test_OnlyOffRamp_Revert() (gas: 25122) Router_routeMessage:test_WhenNotHealthy_Revert() (gas: 44669) Router_setWrappedNative:test_OnlyOwner_Revert() (gas: 10985) SelfFundedPingPong_ccipReceive:test_FundingIfNotANop_Revert() (gas: 53600) -SelfFundedPingPong_ccipReceive:test_Funding_Success() (gas: 419773) +SelfFundedPingPong_ccipReceive:test_Funding_Success() (gas: 418951) SelfFundedPingPong_setCountIncrBeforeFunding:test_setCountIncrBeforeFunding() (gas: 20157) TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole_OnlyPendingAdministrator_Revert() (gas: 51085) TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole_Success() (gas: 43947) @@ -842,8 +836,8 @@ TokenAdminRegistry_transferAdminRole:test_transferAdminRole_OnlyAdministrator_Re TokenAdminRegistry_transferAdminRole:test_transferAdminRole_Success() (gas: 49390) TokenPoolAndProxy:test_lockOrBurn_burnMint_Success() (gas: 6038283) TokenPoolAndProxy:test_lockOrBurn_lockRelease_Success() (gas: 6284039) -TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_2() (gas: 6886695) -TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_4() (gas: 7070798) +TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_2() (gas: 6886284) +TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_4() (gas: 7070387) TokenPoolWithAllowList_applyAllowListUpdates:test_AllowListNotEnabled_Revert() (gas: 2169749) TokenPoolWithAllowList_applyAllowListUpdates:test_OnlyOwner_Revert() (gas: 12089) TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowListSkipsZero_Success() (gas: 23280) @@ -872,16 +866,16 @@ TokenPool_setRemotePool:test_setRemotePool_NonExistentChain_Reverts() (gas: 1559 TokenPool_setRemotePool:test_setRemotePool_OnlyOwner_Reverts() (gas: 13173) TokenPool_setRemotePool:test_setRemotePool_Success() (gas: 281890) TokenProxy_ccipSend:test_CcipSendGasShouldBeZero_Revert() (gas: 17109) -TokenProxy_ccipSend:test_CcipSendInsufficientAllowance_Revert() (gas: 136464) +TokenProxy_ccipSend:test_CcipSendInsufficientAllowance_Revert() (gas: 136327) TokenProxy_ccipSend:test_CcipSendInvalidToken_Revert() (gas: 15919) -TokenProxy_ccipSend:test_CcipSendNative_Success() (gas: 245384) +TokenProxy_ccipSend:test_CcipSendNative_Success() (gas: 244973) TokenProxy_ccipSend:test_CcipSendNoDataAllowed_Revert() (gas: 16303) -TokenProxy_ccipSend:test_CcipSend_Success() (gas: 261723) +TokenProxy_ccipSend:test_CcipSend_Success() (gas: 261504) TokenProxy_constructor:test_Constructor() (gas: 13812) TokenProxy_getFee:test_GetFeeGasShouldBeZero_Revert() (gas: 16827) TokenProxy_getFee:test_GetFeeInvalidToken_Revert() (gas: 12658) TokenProxy_getFee:test_GetFeeNoDataAllowed_Revert() (gas: 15849) -TokenProxy_getFee:test_GetFee_Success() (gas: 87174) +TokenProxy_getFee:test_GetFee_Success() (gas: 86900) USDCTokenPool__validateMessage:test_ValidateInvalidMessage_Revert() (gas: 24960) USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35446) USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30189) diff --git a/contracts/src/v0.8/ccip/PriceRegistry.sol b/contracts/src/v0.8/ccip/PriceRegistry.sol index 44d63aff5f..e1baf1a345 100644 --- a/contracts/src/v0.8/ccip/PriceRegistry.sol +++ b/contracts/src/v0.8/ccip/PriceRegistry.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; import {IPriceRegistry} from "./interfaces/IPriceRegistry.sol"; -import {OwnerIsCreator} from "./../shared/access/OwnerIsCreator.sol"; +import {AuthorizedCallers} from "../shared/access/AuthorizedCallers.sol"; import {AggregatorV3Interface} from "./../shared/interfaces/AggregatorV3Interface.sol"; import {Internal} from "./libraries/Internal.sol"; import {USDPriceWith18Decimals} from "./libraries/USDPriceWith18Decimals.sol"; @@ -13,7 +13,8 @@ import {EnumerableSet} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/ut /// @notice The PriceRegistry contract responsibility is to store the current gas price in USD for a given destination chain, /// and the price of a token in USD allowing the owner or priceUpdater to update this value. -contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { +/// The authorized callers in the contract represent the fee price updaters. +contract PriceRegistry is AuthorizedCallers, IPriceRegistry, ITypeAndVersion { using EnumerableSet for EnumerableSet.AddressSet; using USDPriceWith18Decimals for uint224; @@ -25,9 +26,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { error TokenNotSupported(address token); error ChainNotSupported(uint64 chain); - error OnlyCallableByUpdaterOrOwner(); error StaleGasPrice(uint64 destChainSelector, uint256 threshold, uint256 timePassed); - error StaleTokenPrice(address token, uint256 threshold, uint256 timePassed); error InvalidStalenessThreshold(); error DataFeedValueOutOfUint224Range(); @@ -66,7 +65,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { EnumerableSet.AddressSet private s_priceUpdaters; // Subset of tokens which prices tracked by this registry which are fee tokens. EnumerableSet.AddressSet private s_feeTokens; - // The amount of time a price can be stale before it is considered invalid. + // The amount of time a gas price can be stale before it is considered invalid. uint32 private immutable i_stalenessThreshold; constructor( @@ -74,8 +73,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { address[] memory feeTokens, uint32 stalenessThreshold, TokenPriceFeedUpdate[] memory tokenPriceFeeds - ) { - _applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); + ) AuthorizedCallers(priceUpdaters) { _applyFeeTokensUpdates(feeTokens, new address[](0)); _updateTokenPriceFeeds(tokenPriceFeeds); if (stalenessThreshold == 0) revert InvalidStalenessThreshold(); @@ -86,23 +84,22 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { // │ Price calculations │ // ================================================================ - // @inheritdoc IPriceRegistry + /// @inheritdoc IPriceRegistry function getTokenPrice(address token) public view override returns (Internal.TimestampedPackedUint224 memory) { IPriceRegistry.TokenPriceFeedConfig memory priceFeedConfig = s_usdPriceFeedsPerToken[token]; if (priceFeedConfig.dataFeedAddress == address(0)) { return s_usdPerToken[token]; } - (uint224 price, uint32 timestamp) = _getTokenPriceFromDataFeed(priceFeedConfig); - return Internal.TimestampedPackedUint224({value: price, timestamp: timestamp}); + return _getTokenPriceFromDataFeed(priceFeedConfig); } - // @inheritdoc IPriceRegistry + /// @inheritdoc IPriceRegistry function getValidatedTokenPrice(address token) external view override returns (uint224) { return _getValidatedTokenPrice(token); } - // @inheritdoc IPriceRegistry + /// @inheritdoc IPriceRegistry function getTokenPrices(address[] calldata tokens) external view @@ -117,7 +114,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { return tokenPrices; } - // @inheritdoc IPriceRegistry + /// @inheritdoc IPriceRegistry function getTokenPriceFeedConfig(address token) external view @@ -133,7 +130,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { return i_stalenessThreshold; } - // @inheritdoc IPriceRegistry + /// @inheritdoc IPriceRegistry function getDestinationChainGasPrice(uint64 destChainSelector) external view @@ -143,6 +140,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { return s_usdPerUnitGasByDestChainSelector[destChainSelector]; } + /// @inheritdoc IPriceRegistry function getTokenAndGasPrices( address token, uint64 destChainSelector @@ -173,26 +171,23 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { return (fromTokenAmount * _getValidatedTokenPrice(fromToken)) / _getValidatedTokenPrice(toToken); } - /// @notice Gets the token price for a given token and revert if the token is either - /// not supported or the price is stale. + /// @notice Gets the token price for a given token and revert if the token is not supported /// @param token The address of the token to get the price for /// @return the token price function _getValidatedTokenPrice(address token) internal view returns (uint224) { Internal.TimestampedPackedUint224 memory tokenPrice = getTokenPrice(token); + // Token price must be set at least once if (tokenPrice.timestamp == 0 || tokenPrice.value == 0) revert TokenNotSupported(token); - uint256 timePassed = block.timestamp - tokenPrice.timestamp; - if (timePassed > i_stalenessThreshold) revert StaleTokenPrice(token, i_stalenessThreshold, timePassed); return tokenPrice.value; } /// @notice Gets the token price from a data feed address, rebased to the same units as s_usdPerToken /// @param priceFeedConfig token data feed configuration with valid data feed address (used to retrieve price & timestamp) - /// @return value data feed answer value (rebased to s_usdPerToken units) - /// @return timestamp data feed last updated timestamp + /// @return tokenPrice data feed price answer rebased to s_usdPerToken units, with latest block timestamp function _getTokenPriceFromDataFeed(IPriceRegistry.TokenPriceFeedConfig memory priceFeedConfig) internal view - returns (uint224 value, uint32 timestamp) + returns (Internal.TimestampedPackedUint224 memory tokenPrice) { AggregatorV3Interface dataFeedContract = AggregatorV3Interface(priceFeedConfig.dataFeedAddress); ( @@ -230,7 +225,9 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { if (rebasedValue > type(uint224).max) { revert DataFeedValueOutOfUint224Range(); } - return (uint224(rebasedValue), uint32(block.timestamp)); + + // Data feed staleness is unchecked to decouple the PriceRegistry from data feed delay issues + return Internal.TimestampedPackedUint224({value: uint224(rebasedValue), timestamp: uint32(block.timestamp)}); } // ================================================================ @@ -274,7 +271,7 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { // │ Price updates │ // ================================================================ - // @inheritdoc IPriceRegistry + /// @inheritdoc IPriceRegistry function updatePrices(Internal.PriceUpdates calldata priceUpdates) external override requireUpdaterOrOwner { uint256 tokenUpdatesLength = priceUpdates.tokenPriceUpdates.length; @@ -317,49 +314,12 @@ contract PriceRegistry is IPriceRegistry, OwnerIsCreator, ITypeAndVersion { // ================================================================ // │ Access │ // ================================================================ - - /// @notice Get the list of price updaters. - /// @return The price updaters. - function getPriceUpdaters() external view returns (address[] memory) { - return s_priceUpdaters.values(); - } - - /// @notice Adds new priceUpdaters and remove existing ones. - /// @param priceUpdatersToAdd The addresses of the priceUpdaters that are now allowed - /// to send fee updates. - /// @param priceUpdatersToRemove The addresses of the priceUpdaters that are no longer allowed - /// to send fee updates. - function applyPriceUpdatersUpdates( - address[] memory priceUpdatersToAdd, - address[] memory priceUpdatersToRemove - ) external onlyOwner { - _applyPriceUpdatersUpdates(priceUpdatersToAdd, priceUpdatersToRemove); - } - - /// @notice Adds new priceUpdaters and remove existing ones. - /// @param priceUpdatersToAdd The addresses of the priceUpdaters that are now allowed - /// to send fee updates. - /// @param priceUpdatersToRemove The addresses of the priceUpdaters that are no longer allowed - /// to send fee updates. - function _applyPriceUpdatersUpdates( - address[] memory priceUpdatersToAdd, - address[] memory priceUpdatersToRemove - ) private { - for (uint256 i = 0; i < priceUpdatersToAdd.length; ++i) { - if (s_priceUpdaters.add(priceUpdatersToAdd[i])) { - emit PriceUpdaterSet(priceUpdatersToAdd[i]); - } - } - for (uint256 i = 0; i < priceUpdatersToRemove.length; ++i) { - if (s_priceUpdaters.remove(priceUpdatersToRemove[i])) { - emit PriceUpdaterRemoved(priceUpdatersToRemove[i]); - } - } - } - /// @notice Require that the caller is the owner or a fee updater. modifier requireUpdaterOrOwner() { - if (msg.sender != owner() && !s_priceUpdaters.contains(msg.sender)) revert OnlyCallableByUpdaterOrOwner(); + if (msg.sender != owner()) { + // if not owner - check if the caller is a fee updater + _validateCaller(); + } _; } } diff --git a/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol b/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol index 5e8a1c0f39..d937b5654a 100644 --- a/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol +++ b/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.24; import {IPriceRegistry} from "../../interfaces/IPriceRegistry.sol"; import {IRMN} from "../../interfaces/IRMN.sol"; +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; import {CommitStore} from "../../CommitStore.sol"; import {PriceRegistry} from "../../PriceRegistry.sol"; import {RMN} from "../../RMN.sol"; @@ -36,7 +37,9 @@ contract CommitStoreSetup is PriceRegistrySetup, OCR2BaseSetup { address[] memory priceUpdaters = new address[](1); priceUpdaters[0] = address(s_commitStore); - s_priceRegistry.applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); + s_priceRegistry.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); } } diff --git a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol index 1bcece5559..c7b5233689 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol @@ -7,6 +7,7 @@ import {IAny2EVMOffRamp} from "../../interfaces/IAny2EVMOffRamp.sol"; import {ICommitStore} from "../../interfaces/ICommitStore.sol"; import {IRMN} from "../../interfaces/IRMN.sol"; +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; import {RMN} from "../../RMN.sol"; import {Router} from "../../Router.sol"; import {Client} from "../../libraries/Client.sol"; @@ -113,7 +114,9 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba address[] memory priceUpdaters = new address[](1); priceUpdaters[0] = address(s_offRamp); - s_priceRegistry.applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); + s_priceRegistry.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); } // TODO: function can be made common across OffRampSetup and MultiOffRampSetup @@ -463,7 +466,9 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba address[] memory priceUpdaters = new address[](1); priceUpdaters[0] = address(s_offRamp); - s_priceRegistry.applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); + s_priceRegistry.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); } function _setupRealRMN() internal { diff --git a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol index ba7c9e9b72..9004cd2f1d 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol @@ -1474,24 +1474,6 @@ contract EVM2EVMMultiOnRamp_getTokenTransferCost is EVM2EVMMultiOnRamp_getFeeSet s_onRamp.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); } - - function test_ValidatedPriceStaleness_Revert() public { - vm.warp(block.timestamp + TWELVE_HOURS + 1); - - Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); - message.tokenAmounts[0].token = s_sourceRouter.getWrappedNative(); - - vm.expectRevert( - abi.encodeWithSelector( - PriceRegistry.StaleTokenPrice.selector, - s_sourceRouter.getWrappedNative(), - uint128(TWELVE_HOURS), - uint128(TWELVE_HOURS + 1) - ) - ); - - s_onRamp.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); - } } contract EVM2EVMMultiOnRamp_setDynamicConfig is EVM2EVMMultiOnRampSetup { diff --git a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol index f632e0b6c1..c403e233b3 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol @@ -1337,24 +1337,6 @@ contract EVM2EVMOnRamp_getTokenTransferCost is EVM2EVMOnRamp_getFeeSetup { s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); } - - function test_ValidatedPriceStaleness_Revert() public { - vm.warp(block.timestamp + TWELVE_HOURS + 1); - - Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); - message.tokenAmounts[0].token = s_sourceRouter.getWrappedNative(); - - vm.expectRevert( - abi.encodeWithSelector( - PriceRegistry.StaleTokenPrice.selector, - s_sourceRouter.getWrappedNative(), - uint128(TWELVE_HOURS), - uint128(TWELVE_HOURS + 1) - ) - ); - - s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); - } } contract EVM2EVMOnRamp_getFee is EVM2EVMOnRamp_getFeeSetup { diff --git a/contracts/src/v0.8/ccip/test/priceRegistry/PriceRegistry.t.sol b/contracts/src/v0.8/ccip/test/priceRegistry/PriceRegistry.t.sol index 8a06422560..bc1a473f3c 100644 --- a/contracts/src/v0.8/ccip/test/priceRegistry/PriceRegistry.t.sol +++ b/contracts/src/v0.8/ccip/test/priceRegistry/PriceRegistry.t.sol @@ -1,12 +1,14 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; import {PriceRegistry} from "../../PriceRegistry.sol"; import {IPriceRegistry} from "../../interfaces/IPriceRegistry.sol"; import {Internal} from "../../libraries/Internal.sol"; import {TokenSetup} from "../TokenSetup.t.sol"; import {Vm} from "forge-std/Vm.sol"; +import {console} from "forge-std/console.sol"; contract PriceRegistrySetup is TokenSetup { uint112 internal constant USD_PER_GAS = 1e6; // 0.001 gwei @@ -175,7 +177,7 @@ contract PriceRegistry_constructor is PriceRegistrySetup { assertEq(feeTokens, s_priceRegistry.getFeeTokens()); assertEq(uint32(TWELVE_HOURS), s_priceRegistry.getStalenessThreshold()); - assertEq(priceUpdaters, s_priceRegistry.getPriceUpdaters()); + assertEq(priceUpdaters, s_priceRegistry.getAllAuthorizedCallers()); assertEq(s_priceRegistry.typeAndVersion(), "PriceRegistry 1.6.0-dev"); _assertTokenPriceFeedConfigEquality( @@ -348,6 +350,19 @@ contract PriceRegistry_getValidatedTokenPrice is PriceRegistrySetup { assertEq(tokenPriceAnswer, uint224(1e14)); } + function test_StaleFeeToken_Success() public { + vm.warp(block.timestamp + TWELVE_HOURS + 1); + + Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); + address token = priceUpdates.tokenPriceUpdates[0].sourceToken; + + uint224 tokenPrice = s_priceRegistry.getValidatedTokenPrice(token); + + assertEq(priceUpdates.tokenPriceUpdates[0].usdPerToken, tokenPrice); + } + + // Reverts + function test_OverflowFeedPrice_Revert() public { address tokenAddress = _deploySourceToken("testToken", 0, 18); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, int256(uint256(type(uint224).max) + 1)); @@ -372,15 +387,6 @@ contract PriceRegistry_getValidatedTokenPrice is PriceRegistrySetup { s_priceRegistry.getValidatedTokenPrice(tokenAddress); } - function test_StaleFeeToken_Revert() public { - vm.warp(block.timestamp + TWELVE_HOURS + 1); - - vm.expectRevert( - abi.encodeWithSelector(PriceRegistry.StaleTokenPrice.selector, s_sourceTokens[0], TWELVE_HOURS, TWELVE_HOURS + 1) - ); - s_priceRegistry.getValidatedTokenPrice(s_sourceTokens[0]); - } - function test_TokenNotSupported_Revert() public { vm.expectRevert(abi.encodeWithSelector(PriceRegistry.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); s_priceRegistry.getValidatedTokenPrice(DUMMY_CONTRACT_ADDRESS); @@ -395,43 +401,6 @@ contract PriceRegistry_getValidatedTokenPrice is PriceRegistrySetup { } } -contract PriceRegistry_applyPriceUpdatersUpdates is PriceRegistrySetup { - function test_ApplyPriceUpdaterUpdates_Success() public { - address[] memory priceUpdaters = new address[](1); - priceUpdaters[0] = STRANGER; - - vm.expectEmit(); - emit PriceRegistry.PriceUpdaterSet(STRANGER); - - s_priceRegistry.applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); - assertEq(s_priceRegistry.getPriceUpdaters().length, 1); - assertEq(s_priceRegistry.getPriceUpdaters()[0], STRANGER); - - // add same priceUpdater is no-op - s_priceRegistry.applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); - assertEq(s_priceRegistry.getPriceUpdaters().length, 1); - assertEq(s_priceRegistry.getPriceUpdaters()[0], STRANGER); - - vm.expectEmit(); - emit PriceRegistry.PriceUpdaterRemoved(STRANGER); - - s_priceRegistry.applyPriceUpdatersUpdates(new address[](0), priceUpdaters); - assertEq(s_priceRegistry.getPriceUpdaters().length, 0); - - // removing already removed priceUpdater is no-op - s_priceRegistry.applyPriceUpdatersUpdates(new address[](0), priceUpdaters); - assertEq(s_priceRegistry.getPriceUpdaters().length, 0); - } - - function test_OnlyCallableByOwner_Revert() public { - address[] memory priceUpdaters = new address[](1); - priceUpdaters[0] = STRANGER; - vm.startPrank(STRANGER); - vm.expectRevert("Only callable by owner"); - s_priceRegistry.applyPriceUpdatersUpdates(priceUpdaters, new address[](0)); - } -} - contract PriceRegistry_applyFeeTokensUpdates is PriceRegistrySetup { function test_ApplyFeeTokensUpdates_Success() public { address[] memory feeTokens = new address[](1); @@ -549,6 +518,45 @@ contract PriceRegistry_updatePrices is PriceRegistrySetup { } } + function test_UpdatableByAuthorizedCaller_Success() public { + Internal.PriceUpdates memory priceUpdates = Internal.PriceUpdates({ + tokenPriceUpdates: new Internal.TokenPriceUpdate[](1), + gasPriceUpdates: new Internal.GasPriceUpdate[](0) + }); + priceUpdates.tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[0], usdPerToken: 4e18}); + + // Revert when caller is not authorized + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_priceRegistry.updatePrices(priceUpdates); + + address[] memory priceUpdaters = new address[](1); + priceUpdaters[0] = STRANGER; + vm.startPrank(OWNER); + s_priceRegistry.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); + + // Stranger is now an authorized caller to update prices + vm.expectEmit(); + emit PriceRegistry.UsdPerTokenUpdated( + priceUpdates.tokenPriceUpdates[0].sourceToken, priceUpdates.tokenPriceUpdates[0].usdPerToken, block.timestamp + ); + s_priceRegistry.updatePrices(priceUpdates); + + assertEq(s_priceRegistry.getTokenPrice(s_sourceTokens[0]).value, priceUpdates.tokenPriceUpdates[0].usdPerToken); + + vm.startPrank(OWNER); + s_priceRegistry.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: new address[](0), removedCallers: priceUpdaters}) + ); + + // Revert when authorized caller is removed + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_priceRegistry.updatePrices(priceUpdates); + } + // Reverts function test_OnlyCallableByUpdaterOrOwner_Revert() public { @@ -558,7 +566,7 @@ contract PriceRegistry_updatePrices is PriceRegistrySetup { }); vm.startPrank(STRANGER); - vm.expectRevert(abi.encodeWithSelector(PriceRegistry.OnlyCallableByUpdaterOrOwner.selector)); + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); s_priceRegistry.updatePrices(priceUpdates); } } @@ -608,23 +616,6 @@ contract PriceRegistry_convertTokenAmount is PriceRegistrySetup { // Reverts - function test_StaleFeeToken_Revert() public { - vm.warp(block.timestamp + TWELVE_HOURS + 1); - - Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](1); - tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[0], usdPerToken: 4e18}); - Internal.PriceUpdates memory priceUpdates = - Internal.PriceUpdates({tokenPriceUpdates: tokenPriceUpdates, gasPriceUpdates: new Internal.GasPriceUpdate[](0)}); - s_priceRegistry.updatePrices(priceUpdates); - - vm.expectRevert( - abi.encodeWithSelector( - PriceRegistry.StaleTokenPrice.selector, s_weth, uint128(TWELVE_HOURS), uint128(TWELVE_HOURS + 1) - ) - ); - s_priceRegistry.convertTokenAmount(s_weth, 3e16, s_sourceTokens[0]); - } - function test_LinkTokenNotSupported_Revert() public { vm.expectRevert(abi.encodeWithSelector(PriceRegistry.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); s_priceRegistry.convertTokenAmount(DUMMY_CONTRACT_ADDRESS, 3e16, s_sourceTokens[0]); @@ -632,23 +623,6 @@ contract PriceRegistry_convertTokenAmount is PriceRegistrySetup { vm.expectRevert(abi.encodeWithSelector(PriceRegistry.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); s_priceRegistry.convertTokenAmount(s_sourceTokens[0], 3e16, DUMMY_CONTRACT_ADDRESS); } - - function test_StaleLinkToken_Revert() public { - vm.warp(block.timestamp + TWELVE_HOURS + 1); - - Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](1); - tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_weth, usdPerToken: 18e17}); - Internal.PriceUpdates memory priceUpdates = - Internal.PriceUpdates({tokenPriceUpdates: tokenPriceUpdates, gasPriceUpdates: new Internal.GasPriceUpdate[](0)}); - s_priceRegistry.updatePrices(priceUpdates); - - vm.expectRevert( - abi.encodeWithSelector( - PriceRegistry.StaleTokenPrice.selector, s_sourceTokens[0], uint128(TWELVE_HOURS), uint128(TWELVE_HOURS + 1) - ) - ); - s_priceRegistry.convertTokenAmount(s_weth, 3e16, s_sourceTokens[0]); - } } contract PriceRegistry_getTokenAndGasPrices is PriceRegistrySetup { @@ -689,24 +663,6 @@ contract PriceRegistry_getTokenAndGasPrices is PriceRegistrySetup { ); s_priceRegistry.getTokenAndGasPrices(s_sourceTokens[0], DEST_CHAIN_SELECTOR); } - - function test_StaleTokenPrice_Revert() public { - uint256 diff = TWELVE_HOURS + 1; - vm.warp(block.timestamp + diff); - - Internal.GasPriceUpdate[] memory gasPriceUpdates = new Internal.GasPriceUpdate[](1); - gasPriceUpdates[0] = - Internal.GasPriceUpdate({destChainSelector: DEST_CHAIN_SELECTOR, usdPerUnitGas: PACKED_USD_PER_GAS}); - - Internal.PriceUpdates memory priceUpdates = - Internal.PriceUpdates({tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), gasPriceUpdates: gasPriceUpdates}); - s_priceRegistry.updatePrices(priceUpdates); - - vm.expectRevert( - abi.encodeWithSelector(PriceRegistry.StaleTokenPrice.selector, s_sourceTokens[0], TWELVE_HOURS, diff) - ); - s_priceRegistry.getTokenAndGasPrices(s_sourceTokens[0], DEST_CHAIN_SELECTOR); - } } contract PriceRegistry_updateTokenPriceFeeds is PriceRegistrySetup { diff --git a/core/gethwrappers/ccip/generated/price_registry/price_registry.go b/core/gethwrappers/ccip/generated/price_registry/price_registry.go index 2c7de515f4..5b18229872 100644 --- a/core/gethwrappers/ccip/generated/price_registry/price_registry.go +++ b/core/gethwrappers/ccip/generated/price_registry/price_registry.go @@ -30,6 +30,11 @@ var ( _ = abi.ConvertType ) +type AuthorizedCallersAuthorizedCallerArgs struct { + AddedCallers []common.Address + RemovedCallers []common.Address +} + type IPriceRegistryTokenPriceFeedConfig struct { DataFeedAddress common.Address TokenDecimals uint8 @@ -61,8 +66,8 @@ type PriceRegistryTokenPriceFeedUpdate struct { } var PriceRegistryMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdaters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"stalenessThreshold\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"feedConfig\",\"type\":\"tuple\"}],\"internalType\":\"structPriceRegistry.TokenPriceFeedUpdate[]\",\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chain\",\"type\":\"uint64\"}],\"name\":\"ChainNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataFeedValueOutOfUint224Range\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidStalenessThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpdaterOrOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleGasPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleTokenPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenNotSupported\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenRemoved\",\"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\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"indexed\":false,\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"priceFeedConfig\",\"type\":\"tuple\"}],\"name\":\"PriceFeedPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChain\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerUnitGasUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"feeTokensToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokensToRemove\",\"type\":\"address[]\"}],\"name\":\"applyFeeTokensUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdatersToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"priceUpdatersToRemove\",\"type\":\"address[]\"}],\"name\":\"applyPriceUpdatersUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"fromToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fromTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"toToken\",\"type\":\"address\"}],\"name\":\"convertTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestinationChainGasPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPriceUpdaters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStalenessThreshold\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getTokenAndGasPrices\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"tokenPrice\",\"type\":\"uint224\"},{\"internalType\":\"uint224\",\"name\":\"gasPriceValue\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPriceFeedConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getTokenPrices\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getValidatedTokenPrice\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"}],\"name\":\"updatePrices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"feedConfig\",\"type\":\"tuple\"}],\"internalType\":\"structPriceRegistry.TokenPriceFeedUpdate[]\",\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\"}],\"name\":\"updateTokenPriceFeeds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b5060405162002b7038038062002b7083398101604081905262000034916200080a565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be816200013f565b5050604080516000815260208101909152620000dd91508590620001ea565b604080516000815260208101909152620000f990849062000332565b620001048162000475565b8163ffffffff166000036200012c57604051631151410960e11b815260040160405180910390fd5b5063ffffffff1660805250620009d99050565b336001600160a01b03821603620001995760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005b82518110156200028b57620002298382815181106200021057620002106200098b565b602002602001015160056200054660201b90919060201c565b1562000282578281815181106200024457620002446200098b565b60200260200101516001600160a01b03167f34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b860405160405180910390a25b600101620001ed565b5060005b81518110156200032d57620002cb828281518110620002b257620002b26200098b565b602002602001015160056200056660201b90919060201c565b156200032457818181518110620002e657620002e66200098b565b60200260200101516001600160a01b03167fff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c60405160405180910390a25b6001016200028f565b505050565b60005b8251811015620003d357620003718382815181106200035857620003586200098b565b602002602001015160076200054660201b90919060201c565b15620003ca578281815181106200038c576200038c6200098b565b60200260200101516001600160a01b03167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b60010162000335565b5060005b81518110156200032d5762000413828281518110620003fa57620003fa6200098b565b602002602001015160076200056660201b90919060201c565b156200046c578181815181106200042e576200042e6200098b565b60200260200101516001600160a01b03167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b600101620003d7565b60005b8151811015620005425760008282815181106200049957620004996200098b565b6020908102919091018101518051818301516001600160a01b0380831660008181526004875260409081902084518154868a018051929096166001600160a81b03199091168117600160a01b60ff9384160217909255825191825293519093169683019690965293955091939092917f08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464910160405180910390a250505080600101905062000478565b5050565b60006200055d836001600160a01b0384166200057d565b90505b92915050565b60006200055d836001600160a01b038416620005cf565b6000818152600183016020526040812054620005c65750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000560565b50600062000560565b60008181526001830160205260408120548015620006c8576000620005f6600183620009a1565b85549091506000906200060c90600190620009a1565b9050818114620006785760008660000182815481106200063057620006306200098b565b90600052602060002001549050808760000184815481106200065657620006566200098b565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200068c576200068c620009c3565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000560565b600091505062000560565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200070e576200070e620006d3565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200073f576200073f620006d3565b604052919050565b60006001600160401b03821115620007635762000763620006d3565b5060051b60200190565b80516001600160a01b03811681146200078557600080fd5b919050565b600082601f8301126200079c57600080fd5b81516020620007b5620007af8362000747565b62000714565b8083825260208201915060208460051b870101935086841115620007d857600080fd5b602086015b84811015620007ff57620007f1816200076d565b8352918301918301620007dd565b509695505050505050565b600080600080608085870312156200082157600080fd5b84516001600160401b03808211156200083957600080fd5b62000847888389016200078a565b95506020915081870151818111156200085f57600080fd5b6200086d89828a016200078a565b95505060408088015163ffffffff811681146200088957600080fd5b8095505060608089015183811115620008a157600080fd5b89019250601f83018a13620008b557600080fd5b8251620008c6620007af8262000747565b81815260609091028401850190858101908c831115620008e557600080fd5b948601945b828610156200097a57858d0384811215620009055760008081fd5b6200090f620006e9565b6200091a886200076d565b815286601f19830112156200092f5760008081fd5b62000939620006e9565b9150620009488989016200076d565b82528688015160ff811681146200095f5760008081fd5b828a01528089019190915282529483019490860190620008ea565b999c989b5096995050505050505050565b634e487b7160e01b600052603260045260246000fd5b818103818111156200056057634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805161215f62000a116000396000818161033401528181610c6b01528181610cd401528181610dd10152610e46015261215f6000f3fe608060405234801561001057600080fd5b50600436106101355760003560e01c80637afac322116100b2578063bfcd456611610081578063d02641a011610066578063d02641a014610428578063f2fde38b1461043b578063ffdb4b371461044e57600080fd5b8063bfcd45661461040b578063cdc73d511461042057600080fd5b80637afac322146102ef5780638da5cb5b14610302578063a6c94a731461032a578063bf78e03f1461035e57600080fd5b806345ac924d11610109578063514e8cff116100ee578063514e8cff1461023157806352877af0146102d457806379ba5097146102e757600080fd5b806345ac924d146101d15780634ab35b0b146101f157600080fd5b806241e5be1461013a578063181f5a77146101605780633937306f146101a9578063407e1086146101be575b600080fd5b61014d6101483660046117d2565b610496565b6040519081526020015b60405180910390f35b61019c6040518060400160405280601781526020017f5072696365526567697374727920312e362e302d64657600000000000000000081525081565b604051610157919061180e565b6101bc6101b736600461187b565b610502565b005b6101bc6101cc366004611990565b610816565b6101e46101df366004611aa9565b61082a565b6040516101579190611b1e565b6102046101ff366004611b99565b6108f5565b6040517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091168152602001610157565b6102c761023f366004611bcc565b60408051808201909152600080825260208201525067ffffffffffffffff166000908152600260209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b6040516101579190611be7565b6101bc6102e2366004611c93565b610900565b6101bc610916565b6101bc6102fd366004611c93565b610a18565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610157565b60405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610157565b6103d761036c366004611b99565b6040805180820182526000808252602091820181905273ffffffffffffffffffffffffffffffffffffffff93841681526004825282902082518084019093525492831682527401000000000000000000000000000000000000000090920460ff169181019190915290565b60408051825173ffffffffffffffffffffffffffffffffffffffff16815260209283015160ff169281019290925201610157565b610413610a2a565b6040516101579190611cf7565b610413610a3b565b6102c7610436366004611b99565b610a47565b6101bc610449366004611b99565b610b86565b61046161045c366004611d51565b610b97565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff938416815292909116602083015201610157565b60006104a182610d22565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166104c885610d22565b6104f0907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1685611db3565b6104fa9190611dca565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906105325750610530600533610e82565b155b15610569576040517f46f0815400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105758280611e05565b9050905060005b818110156106bf5760006105908480611e05565b838181106105a0576105a0611e6d565b9050604002018036038101906105b69190611ec8565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885173ffffffffffffffffffffffffffffffffffffffff9081166000908152600390975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a926106ae9290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a25060010161057c565b5060006106cf6020840184611e05565b9050905060005b818110156108105760006106ed6020860186611e05565b838181106106fd576106fd611e6d565b9050604002018036038101906107139190611f05565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885167ffffffffffffffff9081166000908152600290975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e926107ff9290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a2506001016106d6565b50505050565b61081e610eb4565b61082781610f37565b50565b60608160008167ffffffffffffffff811115610848576108486118b6565b60405190808252806020026020018201604052801561088d57816020015b60408051808201909152600080825260208201528152602001906001900390816108665790505b50905060005b828110156108ea576108c58686838181106108b0576108b0611e6d565b90506020020160208101906104369190611b99565b8282815181106108d7576108d7611e6d565b6020908102919091010152600101610893565b509150505b92915050565b60006108ef82610d22565b610908610eb4565b6109128282611035565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610a20610eb4565b6109128282611181565b6060610a3660056112c8565b905090565b6060610a3660076112c8565b604080518082019091526000808252602082015273ffffffffffffffffffffffffffffffffffffffff8281166000908152600460209081526040918290208251808401909352549283168083527401000000000000000000000000000000000000000090930460ff169082015290610b3a57505073ffffffffffffffffffffffffffffffffffffffff166000908152600360209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b600080610b46836112d5565b604080518082019091527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909216825263ffffffff16602082015295945050505050565b610b8e610eb4565b610827816114d2565b67ffffffffffffffff811660009081526002602090815260408083208151808301909252547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811682527c0100000000000000000000000000000000000000000000000000000000900463ffffffff1691810182905282918203610c4f576040517f2e59db3a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff85166004820152602401610993565b6000816020015163ffffffff1642610c679190611f28565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610d08576040517ff08bcb3e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8616600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610993565b610d1186610d22565b9151919350909150505b9250929050565b600080610d2e83610a47565b9050806020015163ffffffff1660001480610d66575080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16155b15610db5576040517f06439c6b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610993565b6000816020015163ffffffff1642610dcd9190611f28565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610e7a576040517fc65fdfca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610993565b505192915050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610993565b565b60005b8151811015610912576000828281518110610f5757610f57611e6d565b60209081029190910181015180518183015173ffffffffffffffffffffffffffffffffffffffff80831660008181526004875260409081902084518154868a018051929096167fffffffffffffffffffffff00000000000000000000000000000000000000000090911681177401000000000000000000000000000000000000000060ff9384160217909255825191825293519093169683019690965293955091939092917f08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464910160405180910390a2505050806001019050610f3a565b60005b82518110156110d85761106e83828151811061105657611056611e6d565b602002602001015160056115c790919063ffffffff16565b156110d05782818151811061108557611085611e6d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b860405160405180910390a25b600101611038565b5060005b815181101561117c576111128282815181106110fa576110fa611e6d565b602002602001015160056115e990919063ffffffff16565b156111745781818151811061112957611129611e6d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c60405160405180910390a25b6001016110dc565b505050565b60005b8251811015611224576111ba8382815181106111a2576111a2611e6d565b602002602001015160076115c790919063ffffffff16565b1561121c578281815181106111d1576111d1611e6d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b600101611184565b5060005b815181101561117c5761125e82828151811061124657611246611e6d565b602002602001015160076115e990919063ffffffff16565b156112c05781818151811061127557611275611e6d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b600101611228565b60606000610ead8361160b565b60008060008360000151905060008173ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561132e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113529190611f55565b5050509150506000811215611393576040517f10cb51d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000819050600086602001518473ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140e9190611fa5565b6114189190611fc2565b905060248160ff16111561144d57611431602482611fdb565b61143c90600a612114565b6114469083611dca565b9150611470565b611458816024611fdb565b61146390600a612114565b61146d9083611db3565b91505b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8211156114c6576040517f10cb51d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50954295509350505050565b3373ffffffffffffffffffffffffffffffffffffffff821603611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610993565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000610ead8373ffffffffffffffffffffffffffffffffffffffff8416611667565b6000610ead8373ffffffffffffffffffffffffffffffffffffffff84166116b6565b60608160000180548060200260200160405190810160405280929190818152602001828054801561165b57602002820191906000526020600020905b815481526020019060010190808311611647575b50505050509050919050565b60008181526001830160205260408120546116ae575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108ef565b5060006108ef565b6000818152600183016020526040812054801561179f5760006116da600183611f28565b85549091506000906116ee90600190611f28565b905081811461175357600086600001828154811061170e5761170e611e6d565b906000526020600020015490508087600001848154811061173157611731611e6d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061176457611764612123565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108ef565b60009150506108ef565b803573ffffffffffffffffffffffffffffffffffffffff811681146117cd57600080fd5b919050565b6000806000606084860312156117e757600080fd5b6117f0846117a9565b925060208401359150611805604085016117a9565b90509250925092565b60006020808352835180602085015260005b8181101561183c57858101830151858201604001528201611820565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561188d57600080fd5b813567ffffffffffffffff8111156118a457600080fd5b820160408185031215610ead57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611908576119086118b6565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611955576119556118b6565b604052919050565b600067ffffffffffffffff821115611977576119776118b6565b5060051b60200190565b60ff8116811461082757600080fd5b600060208083850312156119a357600080fd5b823567ffffffffffffffff8111156119ba57600080fd5b8301601f810185136119cb57600080fd5b80356119de6119d98261195d565b61190e565b818152606091820283018401918482019190888411156119fd57600080fd5b938501935b83851015611a9d5784890381811215611a1b5760008081fd5b611a236118e5565b611a2c876117a9565b81526040807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084011215611a605760008081fd5b611a686118e5565b9250611a758989016117a9565b8352870135611a8381611981565b828901528088019190915283529384019391850191611a02565b50979650505050505050565b60008060208385031215611abc57600080fd5b823567ffffffffffffffff80821115611ad457600080fd5b818501915085601f830112611ae857600080fd5b813581811115611af757600080fd5b8660208260051b8501011115611b0c57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b82811015611b8c57611b7c84835180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16825260209081015163ffffffff16910152565b9284019290850190600101611b3b565b5091979650505050505050565b600060208284031215611bab57600080fd5b610ead826117a9565b803567ffffffffffffffff811681146117cd57600080fd5b600060208284031215611bde57600080fd5b610ead82611bb4565b81517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815260208083015163ffffffff1690820152604081016108ef565b600082601f830112611c3357600080fd5b81356020611c436119d98361195d565b8083825260208201915060208460051b870101935086841115611c6557600080fd5b602086015b84811015611c8857611c7b816117a9565b8352918301918301611c6a565b509695505050505050565b60008060408385031215611ca657600080fd5b823567ffffffffffffffff80821115611cbe57600080fd5b611cca86838701611c22565b93506020850135915080821115611ce057600080fd5b50611ced85828601611c22565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015611d4557835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611d13565b50909695505050505050565b60008060408385031215611d6457600080fd5b611d6d836117a9565b9150611d7b60208401611bb4565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176108ef576108ef611d84565b600082611e00577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611e3a57600080fd5b83018035915067ffffffffffffffff821115611e5557600080fd5b6020019150600681901b3603821315610d1b57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146117cd57600080fd5b600060408284031215611eda57600080fd5b611ee26118e5565b611eeb836117a9565b8152611ef960208401611e9c565b60208201529392505050565b600060408284031215611f1757600080fd5b611f1f6118e5565b611eeb83611bb4565b818103818111156108ef576108ef611d84565b805169ffffffffffffffffffff811681146117cd57600080fd5b600080600080600060a08688031215611f6d57600080fd5b611f7686611f3b565b9450602086015193506040860151925060608601519150611f9960808701611f3b565b90509295509295909350565b600060208284031215611fb757600080fd5b8151610ead81611981565b60ff81811683821601908111156108ef576108ef611d84565b60ff82811682821603908111156108ef576108ef611d84565b600181815b8085111561204d57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561203357612033611d84565b8085161561204057918102915b93841c9390800290611ff9565b509250929050565b600082612064575060016108ef565b81612071575060006108ef565b81600181146120875760028114612091576120ad565b60019150506108ef565b60ff8411156120a2576120a2611d84565b50506001821b6108ef565b5060208310610133831016604e8410600b84101617156120d0575081810a6108ef565b6120da8383611ff4565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561210c5761210c611d84565b029392505050565b6000610ead60ff841683612055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdaters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"stalenessThreshold\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"feedConfig\",\"type\":\"tuple\"}],\"internalType\":\"structPriceRegistry.TokenPriceFeedUpdate[]\",\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chain\",\"type\":\"uint64\"}],\"name\":\"ChainNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataFeedValueOutOfUint224Range\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidStalenessThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleGasPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"UnauthorizedCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenRemoved\",\"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\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"indexed\":false,\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"priceFeedConfig\",\"type\":\"tuple\"}],\"name\":\"PriceFeedPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChain\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerUnitGasUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address[]\",\"name\":\"addedCallers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"removedCallers\",\"type\":\"address[]\"}],\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\"}],\"name\":\"applyAuthorizedCallerUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"feeTokensToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokensToRemove\",\"type\":\"address[]\"}],\"name\":\"applyFeeTokensUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"fromToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fromTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"toToken\",\"type\":\"address\"}],\"name\":\"convertTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAuthorizedCallers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestinationChainGasPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStalenessThreshold\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getTokenAndGasPrices\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"tokenPrice\",\"type\":\"uint224\"},{\"internalType\":\"uint224\",\"name\":\"gasPriceValue\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPriceFeedConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getTokenPrices\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getValidatedTokenPrice\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"}],\"name\":\"updatePrices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIPriceRegistry.TokenPriceFeedConfig\",\"name\":\"feedConfig\",\"type\":\"tuple\"}],\"internalType\":\"structPriceRegistry.TokenPriceFeedUpdate[]\",\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\"}],\"name\":\"updateTokenPriceFeeds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162002b9938038062002b99833981016040819052620000349162000828565b8333806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000151565b5050604080518082018252838152815160008152602080820190935291810191909152620000ee9150620001fc565b506040805160008152602081019091526200010b9084906200034b565b620001168162000493565b8163ffffffff166000036200013e57604051631151410960e11b815260040160405180910390fd5b5063ffffffff1660805250620009f79050565b336001600160a01b03821603620001ab5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b602081015160005b81518110156200028c576000828281518110620002255762000225620009a9565b602090810291909101015190506200023f60028262000564565b1562000282576040516001600160a01b03821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b5060010162000204565b50815160005b815181101562000345576000828281518110620002b357620002b3620009a9565b6020026020010151905060006001600160a01b0316816001600160a01b031603620002f1576040516342bcdf7f60e11b815260040160405180910390fd5b620002fe60028262000584565b506040516001600160a01b03821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a15060010162000292565b50505050565b60005b8251811015620003ec576200038a838281518110620003715762000371620009a9565b602002602001015160096200058460201b90919060201c565b15620003e357828181518110620003a557620003a5620009a9565b60200260200101516001600160a01b03167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b6001016200034e565b5060005b81518110156200048e576200042c828281518110620004135762000413620009a9565b602002602001015160096200056460201b90919060201c565b156200048557818181518110620004475762000447620009a9565b60200260200101516001600160a01b03167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b600101620003f0565b505050565b60005b815181101562000560576000828281518110620004b757620004b7620009a9565b6020908102919091018101518051818301516001600160a01b0380831660008181526006875260409081902084518154868a018051929096166001600160a81b03199091168117600160a01b60ff9384160217909255825191825293519093169683019690965293955091939092917f08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464910160405180910390a250505080600101905062000496565b5050565b60006200057b836001600160a01b0384166200059b565b90505b92915050565b60006200057b836001600160a01b0384166200069f565b6000818152600183016020526040812054801562000694576000620005c2600183620009bf565b8554909150600090620005d890600190620009bf565b905081811462000644576000866000018281548110620005fc57620005fc620009a9565b9060005260206000200154905080876000018481548110620006225762000622620009a9565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620006585762000658620009e1565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200057e565b60009150506200057e565b6000818152600183016020526040812054620006e8575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200057e565b5060006200057e565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200072c576200072c620006f1565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200075d576200075d620006f1565b604052919050565b60006001600160401b03821115620007815762000781620006f1565b5060051b60200190565b80516001600160a01b0381168114620007a357600080fd5b919050565b600082601f830112620007ba57600080fd5b81516020620007d3620007cd8362000765565b62000732565b8083825260208201915060208460051b870101935086841115620007f657600080fd5b602086015b848110156200081d576200080f816200078b565b8352918301918301620007fb565b509695505050505050565b600080600080608085870312156200083f57600080fd5b84516001600160401b03808211156200085757600080fd5b6200086588838901620007a8565b95506020915081870151818111156200087d57600080fd5b6200088b89828a01620007a8565b95505060408088015163ffffffff81168114620008a757600080fd5b8095505060608089015183811115620008bf57600080fd5b89019250601f83018a13620008d357600080fd5b8251620008e4620007cd8262000765565b81815260609091028401850190858101908c8311156200090357600080fd5b948601945b828610156200099857858d0384811215620009235760008081fd5b6200092d62000707565b62000938886200078b565b815286601f19830112156200094d5760008081fd5b6200095762000707565b9150620009668989016200078b565b82528688015160ff811681146200097d5760008081fd5b828a0152808901919091528252948301949086019062000908565b999c989b5096995050505050505050565b634e487b7160e01b600052603260045260246000fd5b818103818111156200057e57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805161217862000a216000396000818161034901528181610bee0152610c5701526121786000f3fe608060405234801561001057600080fd5b50600436106101355760003560e01c80637afac322116100b2578063bf78e03f11610081578063d02641a011610066578063d02641a014610428578063f2fde38b1461043b578063ffdb4b371461044e57600080fd5b8063bf78e03f14610373578063cdc73d511461042057600080fd5b80637afac322146102f15780638da5cb5b1461030457806391a2749a1461032c578063a6c94a731461033f57600080fd5b8063407e1086116101095780634ab35b0b116100ee5780634ab35b0b14610206578063514e8cff1461024657806379ba5097146102e957600080fd5b8063407e1086146101d357806345ac924d146101e657600080fd5b806241e5be1461013a578063181f5a77146101605780632451a627146101a95780633937306f146101be575b600080fd5b61014d61014836600461175a565b610496565b6040519081526020015b60405180910390f35b61019c6040518060400160405280601781526020017f5072696365526567697374727920312e362e302d64657600000000000000000081525081565b6040516101579190611796565b6101b1610502565b6040516101579190611803565b6101d16101cc36600461185d565b610513565b005b6101d16101e1366004611972565b6107e7565b6101f96101f4366004611a8b565b6107fb565b6040516101579190611b00565b610219610214366004611b7b565b6108c6565b6040517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091168152602001610157565b6102dc610254366004611bae565b60408051808201909152600080825260208201525067ffffffffffffffff166000908152600460209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b6040516101579190611bc9565b6101d16108d1565b6101d16102ff366004611c75565b6109d3565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610157565b6101d161033a366004611cd9565b6109e9565b60405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610157565b6103ec610381366004611b7b565b6040805180820182526000808252602091820181905273ffffffffffffffffffffffffffffffffffffffff93841681526006825282902082518084019093525492831682527401000000000000000000000000000000000000000090920460ff169181019190915290565b60408051825173ffffffffffffffffffffffffffffffffffffffff16815260209283015160ff169281019290925201610157565b6101b16109fa565b6102dc610436366004611b7b565b610a06565b6101d1610449366004611b7b565b610b09565b61046161045c366004611d6a565b610b1a565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff938416815292909116602083015201610157565b60006104a182610ca5565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166104c885610ca5565b6104f0907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1685611dcc565b6104fa9190611de3565b949350505050565b606061050e6002610d3f565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff16331461053a5761053a610d4c565b60006105468280611e1e565b9050905060005b818110156106905760006105618480611e1e565b8381811061057157610571611e86565b9050604002018036038101906105879190611ee1565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885173ffffffffffffffffffffffffffffffffffffffff9081166000908152600590975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a9261067f9290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a25060010161054d565b5060006106a06020840184611e1e565b9050905060005b818110156107e15760006106be6020860186611e1e565b838181106106ce576106ce611e86565b9050604002018036038101906106e49190611f1e565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885167ffffffffffffffff9081166000908152600490975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e926107d09290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a2506001016106a7565b50505050565b6107ef610d91565b6107f881610e12565b50565b60608160008167ffffffffffffffff81111561081957610819611898565b60405190808252806020026020018201604052801561085e57816020015b60408051808201909152600080825260208201528152602001906001900390816108375790505b50905060005b828110156108bb5761089686868381811061088157610881611e86565b90506020020160208101906104369190611b7b565b8282815181106108a8576108a8611e86565b6020908102919091010152600101610864565b509150505b92915050565b60006108c082610ca5565b60015473ffffffffffffffffffffffffffffffffffffffff163314610957576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6109db610d91565b6109e58282610f10565b5050565b6109f1610d91565b6107f88161105c565b606061050e6009610d3f565b604080518082019091526000808252602082015273ffffffffffffffffffffffffffffffffffffffff8281166000908152600660209081526040918290208251808401909352549283168083527401000000000000000000000000000000000000000090930460ff169082015290610af957505073ffffffffffffffffffffffffffffffffffffffff166000908152600560209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b610b02816111e8565b9392505050565b610b11610d91565b6107f88161142b565b67ffffffffffffffff811660009081526004602090815260408083208151808301909252547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811682527c0100000000000000000000000000000000000000000000000000000000900463ffffffff1691810182905282918203610bd2576040517f2e59db3a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8516600482015260240161094e565b6000816020015163ffffffff1642610bea9190611f41565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610c8b576040517ff08bcb3e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8616600482015263ffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044810182905260640161094e565b610c9486610ca5565b9151919350909150505b9250929050565b600080610cb183610a06565b9050806020015163ffffffff1660001480610ce9575080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16155b15610d38576040517f06439c6b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161094e565b5192915050565b60606000610b0283611520565b610d5760023361157c565b610d8f576040517fd86ad9cf00000000000000000000000000000000000000000000000000000000815233600482015260240161094e565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161094e565b60005b81518110156109e5576000828281518110610e3257610e32611e86565b60209081029190910181015180518183015173ffffffffffffffffffffffffffffffffffffffff80831660008181526006875260409081902084518154868a018051929096167fffffffffffffffffffffff00000000000000000000000000000000000000000090911681177401000000000000000000000000000000000000000060ff9384160217909255825191825293519093169683019690965293955091939092917f08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464910160405180910390a2505050806001019050610e15565b60005b8251811015610fb357610f49838281518110610f3157610f31611e86565b602002602001015160096115ab90919063ffffffff16565b15610fab57828181518110610f6057610f60611e86565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b600101610f13565b5060005b815181101561105757610fed828281518110610fd557610fd5611e86565b602002602001015160096115cd90919063ffffffff16565b1561104f5781818151811061100457611004611e86565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b600101610fb7565b505050565b602081015160005b81518110156110f757600082828151811061108157611081611e86565b6020026020010151905061109f8160026115cd90919063ffffffff16565b156110ee5760405173ffffffffffffffffffffffffffffffffffffffff821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b50600101611064565b50815160005b81518110156107e157600082828151811061111a5761111a611e86565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361118a576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111956002826115ab565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a1506001016110fd565b604080518082019091526000808252602082015260008260000151905060008173ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015611252573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112769190611f6e565b50505091505060008112156112b7576040517f10cb51d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000819050600085602001518473ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561130e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113329190611fbe565b61133c9190611fdb565b905060248160ff16111561137157611355602482611ff4565b61136090600a61212d565b61136a9083611de3565b9150611394565b61137c816024611ff4565b61138790600a61212d565b6113919083611dcc565b91505b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8211156113ea576040517f10cb51d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50604080518082019091527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909116815263ffffffff42166020820152949350505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036114aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161094e565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60608160000180548060200260200160405190810160405280929190818152602001828054801561157057602002820191906000526020600020905b81548152602001906001019080831161155c575b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610b02565b6000610b028373ffffffffffffffffffffffffffffffffffffffff84166115ef565b6000610b028373ffffffffffffffffffffffffffffffffffffffff841661163e565b6000818152600183016020526040812054611636575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108c0565b5060006108c0565b60008181526001830160205260408120548015611727576000611662600183611f41565b855490915060009061167690600190611f41565b90508181146116db57600086600001828154811061169657611696611e86565b90600052602060002001549050808760000184815481106116b9576116b9611e86565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116ec576116ec61213c565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108c0565b60009150506108c0565b803573ffffffffffffffffffffffffffffffffffffffff8116811461175557600080fd5b919050565b60008060006060848603121561176f57600080fd5b61177884611731565b92506020840135915061178d60408501611731565b90509250925092565b60006020808352835180602085015260005b818110156117c4578581018301518582016040015282016117a8565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b6020808252825182820181905260009190848201906040850190845b8181101561185157835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161181f565b50909695505050505050565b60006020828403121561186f57600080fd5b813567ffffffffffffffff81111561188657600080fd5b820160408185031215610b0257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156118ea576118ea611898565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561193757611937611898565b604052919050565b600067ffffffffffffffff82111561195957611959611898565b5060051b60200190565b60ff811681146107f857600080fd5b6000602080838503121561198557600080fd5b823567ffffffffffffffff81111561199c57600080fd5b8301601f810185136119ad57600080fd5b80356119c06119bb8261193f565b6118f0565b818152606091820283018401918482019190888411156119df57600080fd5b938501935b83851015611a7f57848903818112156119fd5760008081fd5b611a056118c7565b611a0e87611731565b81526040807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084011215611a425760008081fd5b611a4a6118c7565b9250611a57898901611731565b8352870135611a6581611963565b8289015280880191909152835293840193918501916119e4565b50979650505050505050565b60008060208385031215611a9e57600080fd5b823567ffffffffffffffff80821115611ab657600080fd5b818501915085601f830112611aca57600080fd5b813581811115611ad957600080fd5b8660208260051b8501011115611aee57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b82811015611b6e57611b5e84835180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16825260209081015163ffffffff16910152565b9284019290850190600101611b1d565b5091979650505050505050565b600060208284031215611b8d57600080fd5b610b0282611731565b803567ffffffffffffffff8116811461175557600080fd5b600060208284031215611bc057600080fd5b610b0282611b96565b81517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815260208083015163ffffffff1690820152604081016108c0565b600082601f830112611c1557600080fd5b81356020611c256119bb8361193f565b8083825260208201915060208460051b870101935086841115611c4757600080fd5b602086015b84811015611c6a57611c5d81611731565b8352918301918301611c4c565b509695505050505050565b60008060408385031215611c8857600080fd5b823567ffffffffffffffff80821115611ca057600080fd5b611cac86838701611c04565b93506020850135915080821115611cc257600080fd5b50611ccf85828601611c04565b9150509250929050565b600060208284031215611ceb57600080fd5b813567ffffffffffffffff80821115611d0357600080fd5b9083019060408286031215611d1757600080fd5b611d1f6118c7565b823582811115611d2e57600080fd5b611d3a87828601611c04565b825250602083013582811115611d4f57600080fd5b611d5b87828601611c04565b60208301525095945050505050565b60008060408385031215611d7d57600080fd5b611d8683611731565b9150611d9460208401611b96565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176108c0576108c0611d9d565b600082611e19577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611e5357600080fd5b83018035915067ffffffffffffffff821115611e6e57600080fd5b6020019150600681901b3603821315610c9e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116811461175557600080fd5b600060408284031215611ef357600080fd5b611efb6118c7565b611f0483611731565b8152611f1260208401611eb5565b60208201529392505050565b600060408284031215611f3057600080fd5b611f386118c7565b611f0483611b96565b818103818111156108c0576108c0611d9d565b805169ffffffffffffffffffff8116811461175557600080fd5b600080600080600060a08688031215611f8657600080fd5b611f8f86611f54565b9450602086015193506040860151925060608601519150611fb260808701611f54565b90509295509295909350565b600060208284031215611fd057600080fd5b8151610b0281611963565b60ff81811683821601908111156108c0576108c0611d9d565b60ff82811682821603908111156108c0576108c0611d9d565b600181815b8085111561206657817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561204c5761204c611d9d565b8085161561205957918102915b93841c9390800290612012565b509250929050565b60008261207d575060016108c0565b8161208a575060006108c0565b81600181146120a057600281146120aa576120c6565b60019150506108c0565b60ff8411156120bb576120bb611d9d565b50506001821b6108c0565b5060208310610133831016604e8410600b84101617156120e9575081810a6108c0565b6120f3838361200d565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561212557612125611d9d565b029392505050565b6000610b0260ff84168361206e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", } var PriceRegistryABI = PriceRegistryMetaData.ABI @@ -223,53 +228,53 @@ func (_PriceRegistry *PriceRegistryCallerSession) ConvertTokenAmount(fromToken c return _PriceRegistry.Contract.ConvertTokenAmount(&_PriceRegistry.CallOpts, fromToken, fromTokenAmount, toToken) } -func (_PriceRegistry *PriceRegistryCaller) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) { +func (_PriceRegistry *PriceRegistryCaller) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} - err := _PriceRegistry.contract.Call(opts, &out, "getDestinationChainGasPrice", destChainSelector) + err := _PriceRegistry.contract.Call(opts, &out, "getAllAuthorizedCallers") if err != nil { - return *new(InternalTimestampedPackedUint224), err + return *new([]common.Address), err } - out0 := *abi.ConvertType(out[0], new(InternalTimestampedPackedUint224)).(*InternalTimestampedPackedUint224) + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } -func (_PriceRegistry *PriceRegistrySession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { - return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) +func (_PriceRegistry *PriceRegistrySession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _PriceRegistry.Contract.GetAllAuthorizedCallers(&_PriceRegistry.CallOpts) } -func (_PriceRegistry *PriceRegistryCallerSession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { - return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) +func (_PriceRegistry *PriceRegistryCallerSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _PriceRegistry.Contract.GetAllAuthorizedCallers(&_PriceRegistry.CallOpts) } -func (_PriceRegistry *PriceRegistryCaller) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { +func (_PriceRegistry *PriceRegistryCaller) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) { var out []interface{} - err := _PriceRegistry.contract.Call(opts, &out, "getFeeTokens") + err := _PriceRegistry.contract.Call(opts, &out, "getDestinationChainGasPrice", destChainSelector) if err != nil { - return *new([]common.Address), err + return *new(InternalTimestampedPackedUint224), err } - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + out0 := *abi.ConvertType(out[0], new(InternalTimestampedPackedUint224)).(*InternalTimestampedPackedUint224) return out0, err } -func (_PriceRegistry *PriceRegistrySession) GetFeeTokens() ([]common.Address, error) { - return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) +func (_PriceRegistry *PriceRegistrySession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) } -func (_PriceRegistry *PriceRegistryCallerSession) GetFeeTokens() ([]common.Address, error) { - return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) +func (_PriceRegistry *PriceRegistryCallerSession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) } -func (_PriceRegistry *PriceRegistryCaller) GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) { +func (_PriceRegistry *PriceRegistryCaller) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { var out []interface{} - err := _PriceRegistry.contract.Call(opts, &out, "getPriceUpdaters") + err := _PriceRegistry.contract.Call(opts, &out, "getFeeTokens") if err != nil { return *new([]common.Address), err @@ -281,12 +286,12 @@ func (_PriceRegistry *PriceRegistryCaller) GetPriceUpdaters(opts *bind.CallOpts) } -func (_PriceRegistry *PriceRegistrySession) GetPriceUpdaters() ([]common.Address, error) { - return _PriceRegistry.Contract.GetPriceUpdaters(&_PriceRegistry.CallOpts) +func (_PriceRegistry *PriceRegistrySession) GetFeeTokens() ([]common.Address, error) { + return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) } -func (_PriceRegistry *PriceRegistryCallerSession) GetPriceUpdaters() ([]common.Address, error) { - return _PriceRegistry.Contract.GetPriceUpdaters(&_PriceRegistry.CallOpts) +func (_PriceRegistry *PriceRegistryCallerSession) GetFeeTokens() ([]common.Address, error) { + return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) } func (_PriceRegistry *PriceRegistryCaller) GetStalenessThreshold(opts *bind.CallOpts) (*big.Int, error) { @@ -485,28 +490,28 @@ func (_PriceRegistry *PriceRegistryTransactorSession) AcceptOwnership() (*types. return _PriceRegistry.Contract.AcceptOwnership(&_PriceRegistry.TransactOpts) } -func (_PriceRegistry *PriceRegistryTransactor) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { - return _PriceRegistry.contract.Transact(opts, "applyFeeTokensUpdates", feeTokensToAdd, feeTokensToRemove) +func (_PriceRegistry *PriceRegistryTransactor) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "applyAuthorizedCallerUpdates", authorizedCallerArgs) } -func (_PriceRegistry *PriceRegistrySession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { - return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) +func (_PriceRegistry *PriceRegistrySession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyAuthorizedCallerUpdates(&_PriceRegistry.TransactOpts, authorizedCallerArgs) } -func (_PriceRegistry *PriceRegistryTransactorSession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { - return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) +func (_PriceRegistry *PriceRegistryTransactorSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyAuthorizedCallerUpdates(&_PriceRegistry.TransactOpts, authorizedCallerArgs) } -func (_PriceRegistry *PriceRegistryTransactor) ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { - return _PriceRegistry.contract.Transact(opts, "applyPriceUpdatersUpdates", priceUpdatersToAdd, priceUpdatersToRemove) +func (_PriceRegistry *PriceRegistryTransactor) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "applyFeeTokensUpdates", feeTokensToAdd, feeTokensToRemove) } -func (_PriceRegistry *PriceRegistrySession) ApplyPriceUpdatersUpdates(priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { - return _PriceRegistry.Contract.ApplyPriceUpdatersUpdates(&_PriceRegistry.TransactOpts, priceUpdatersToAdd, priceUpdatersToRemove) +func (_PriceRegistry *PriceRegistrySession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) } -func (_PriceRegistry *PriceRegistryTransactorSession) ApplyPriceUpdatersUpdates(priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { - return _PriceRegistry.Contract.ApplyPriceUpdatersUpdates(&_PriceRegistry.TransactOpts, priceUpdatersToAdd, priceUpdatersToRemove) +func (_PriceRegistry *PriceRegistryTransactorSession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) } func (_PriceRegistry *PriceRegistryTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { @@ -545,6 +550,240 @@ func (_PriceRegistry *PriceRegistryTransactorSession) UpdateTokenPriceFeeds(toke return _PriceRegistry.Contract.UpdateTokenPriceFeeds(&_PriceRegistry.TransactOpts, tokenPriceFeedUpdates) } +type PriceRegistryAuthorizedCallerAddedIterator struct { + Event *PriceRegistryAuthorizedCallerAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryAuthorizedCallerAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryAuthorizedCallerAdded) + 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(PriceRegistryAuthorizedCallerAdded) + 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 *PriceRegistryAuthorizedCallerAddedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryAuthorizedCallerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryAuthorizedCallerAdded struct { + Caller common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*PriceRegistryAuthorizedCallerAddedIterator, error) { + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return &PriceRegistryAuthorizedCallerAddedIterator{contract: _PriceRegistry.contract, event: "AuthorizedCallerAdded", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryAuthorizedCallerAdded) (event.Subscription, error) { + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryAuthorizedCallerAdded) + if err := _PriceRegistry.contract.UnpackLog(event, "AuthorizedCallerAdded", 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 (_PriceRegistry *PriceRegistryFilterer) ParseAuthorizedCallerAdded(log types.Log) (*PriceRegistryAuthorizedCallerAdded, error) { + event := new(PriceRegistryAuthorizedCallerAdded) + if err := _PriceRegistry.contract.UnpackLog(event, "AuthorizedCallerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryAuthorizedCallerRemovedIterator struct { + Event *PriceRegistryAuthorizedCallerRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryAuthorizedCallerRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryAuthorizedCallerRemoved) + 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(PriceRegistryAuthorizedCallerRemoved) + 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 *PriceRegistryAuthorizedCallerRemovedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryAuthorizedCallerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryAuthorizedCallerRemoved struct { + Caller common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*PriceRegistryAuthorizedCallerRemovedIterator, error) { + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return &PriceRegistryAuthorizedCallerRemovedIterator{contract: _PriceRegistry.contract, event: "AuthorizedCallerRemoved", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryAuthorizedCallerRemoved) (event.Subscription, error) { + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryAuthorizedCallerRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "AuthorizedCallerRemoved", 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 (_PriceRegistry *PriceRegistryFilterer) ParseAuthorizedCallerRemoved(log types.Log) (*PriceRegistryAuthorizedCallerRemoved, error) { + event := new(PriceRegistryAuthorizedCallerRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "AuthorizedCallerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + type PriceRegistryFeeTokenAddedIterator struct { Event *PriceRegistryFeeTokenAdded @@ -1718,6 +1957,10 @@ type GetTokenAndGasPrices struct { func (_PriceRegistry *PriceRegistry) ParseLog(log types.Log) (generated.AbigenLog, error) { switch log.Topics[0] { + case _PriceRegistry.abi.Events["AuthorizedCallerAdded"].ID: + return _PriceRegistry.ParseAuthorizedCallerAdded(log) + case _PriceRegistry.abi.Events["AuthorizedCallerRemoved"].ID: + return _PriceRegistry.ParseAuthorizedCallerRemoved(log) case _PriceRegistry.abi.Events["FeeTokenAdded"].ID: return _PriceRegistry.ParseFeeTokenAdded(log) case _PriceRegistry.abi.Events["FeeTokenRemoved"].ID: @@ -1742,6 +1985,14 @@ func (_PriceRegistry *PriceRegistry) ParseLog(log types.Log) (generated.AbigenLo } } +func (PriceRegistryAuthorizedCallerAdded) Topic() common.Hash { + return common.HexToHash("0xeb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef") +} + +func (PriceRegistryAuthorizedCallerRemoved) Topic() common.Hash { + return common.HexToHash("0xc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda77580") +} + func (PriceRegistryFeeTokenAdded) Topic() common.Hash { return common.HexToHash("0xdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23") } @@ -1785,12 +2036,12 @@ func (_PriceRegistry *PriceRegistry) Address() common.Address { type PriceRegistryInterface interface { ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) + GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) + GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) - GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) - GetStalenessThreshold(opts *bind.CallOpts) (*big.Int, error) GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, @@ -1811,9 +2062,9 @@ type PriceRegistryInterface interface { AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) + ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) - ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) + ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) @@ -1821,6 +2072,18 @@ type PriceRegistryInterface interface { UpdateTokenPriceFeeds(opts *bind.TransactOpts, tokenPriceFeedUpdates []PriceRegistryTokenPriceFeedUpdate) (*types.Transaction, error) + FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*PriceRegistryAuthorizedCallerAddedIterator, error) + + WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryAuthorizedCallerAdded) (event.Subscription, error) + + ParseAuthorizedCallerAdded(log types.Log) (*PriceRegistryAuthorizedCallerAdded, error) + + FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*PriceRegistryAuthorizedCallerRemovedIterator, error) + + WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryAuthorizedCallerRemoved) (event.Subscription, error) + + ParseAuthorizedCallerRemoved(log types.Log) (*PriceRegistryAuthorizedCallerRemoved, error) + FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenAddedIterator, error) WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 9dd0923d3f..6127b6bbe1 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 @@ -23,7 +23,7 @@ mock_v3_aggregator_contract: ../../../contracts/solc/v0.8.24/MockV3Aggregator/Mo multi_aggregate_rate_limiter: ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin abb0ecb1ed8621f26e43b39f5fa25f3d0b6d6c184fa37c404c4389605ecb74e7 nonce_manager: ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin cdc11c1ab4c1c3fd77f30215e9c579404a6e60eb9adc213d73ca0773c3bb5784 ping_pong_demo: ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin 1588313bb5e781d181a825247d30828f59007700f36b4b9b00391592b06ff4b4 -price_registry: ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.abi ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.bin 68d1a92a6b7d6a864ef23723984723848d90bbdf58e49391c6767fe2bfb6c5a7 +price_registry: ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.abi ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.bin 0b3e253684d7085aa11f9179b71453b9db9d11cabea41605d5b4ac4128f85bfb registry_module_owner_custom: ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.abi ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.bin cbe7698bfd811b485ac3856daf073a7bdebeefdf2583403ca4a19d5b7e2d4ae8 router: ../../../contracts/solc/v0.8.24/Router/Router.abi ../../../contracts/solc/v0.8.24/Router/Router.bin 42576577e81beea9a069bd9229caaa9a71227fbaef3871a1a2e69fd218216290 self_funded_ping_pong: ../../../contracts/solc/v0.8.24/SelfFundedPingPong/SelfFundedPingPong.abi ../../../contracts/solc/v0.8.24/SelfFundedPingPong/SelfFundedPingPong.bin 86e169636e5633854ed0b709c804066b615040bceba25aa5137450fbe6f76fa3 diff --git a/core/gethwrappers/ccip/mocks/price_registry_interface.go b/core/gethwrappers/ccip/mocks/price_registry_interface.go index aba69d451e..3b5818cd26 100644 --- a/core/gethwrappers/ccip/mocks/price_registry_interface.go +++ b/core/gethwrappers/ccip/mocks/price_registry_interface.go @@ -74,29 +74,29 @@ func (_m *PriceRegistryInterface) Address() common.Address { return r0 } -// ApplyFeeTokensUpdates provides a mock function with given fields: opts, feeTokensToAdd, feeTokensToRemove -func (_m *PriceRegistryInterface) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { - ret := _m.Called(opts, feeTokensToAdd, feeTokensToRemove) +// ApplyAuthorizedCallerUpdates provides a mock function with given fields: opts, authorizedCallerArgs +func (_m *PriceRegistryInterface) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs price_registry.AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + ret := _m.Called(opts, authorizedCallerArgs) if len(ret) == 0 { - panic("no return value specified for ApplyFeeTokensUpdates") + panic("no return value specified for ApplyAuthorizedCallerUpdates") } var r0 *types.Transaction var r1 error - if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address) (*types.Transaction, error)); ok { - return rf(opts, feeTokensToAdd, feeTokensToRemove) + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, price_registry.AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error)); ok { + return rf(opts, authorizedCallerArgs) } - if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address) *types.Transaction); ok { - r0 = rf(opts, feeTokensToAdd, feeTokensToRemove) + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, price_registry.AuthorizedCallersAuthorizedCallerArgs) *types.Transaction); ok { + r0 = rf(opts, authorizedCallerArgs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Transaction) } } - if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address) error); ok { - r1 = rf(opts, feeTokensToAdd, feeTokensToRemove) + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, price_registry.AuthorizedCallersAuthorizedCallerArgs) error); ok { + r1 = rf(opts, authorizedCallerArgs) } else { r1 = ret.Error(1) } @@ -104,21 +104,21 @@ func (_m *PriceRegistryInterface) ApplyFeeTokensUpdates(opts *bind.TransactOpts, return r0, r1 } -// ApplyPriceUpdatersUpdates provides a mock function with given fields: opts, priceUpdatersToAdd, priceUpdatersToRemove -func (_m *PriceRegistryInterface) ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { - ret := _m.Called(opts, priceUpdatersToAdd, priceUpdatersToRemove) +// ApplyFeeTokensUpdates provides a mock function with given fields: opts, feeTokensToAdd, feeTokensToRemove +func (_m *PriceRegistryInterface) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, feeTokensToAdd, feeTokensToRemove) if len(ret) == 0 { - panic("no return value specified for ApplyPriceUpdatersUpdates") + panic("no return value specified for ApplyFeeTokensUpdates") } var r0 *types.Transaction var r1 error if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address) (*types.Transaction, error)); ok { - return rf(opts, priceUpdatersToAdd, priceUpdatersToRemove) + return rf(opts, feeTokensToAdd, feeTokensToRemove) } if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address) *types.Transaction); ok { - r0 = rf(opts, priceUpdatersToAdd, priceUpdatersToRemove) + r0 = rf(opts, feeTokensToAdd, feeTokensToRemove) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Transaction) @@ -126,7 +126,7 @@ func (_m *PriceRegistryInterface) ApplyPriceUpdatersUpdates(opts *bind.TransactO } if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address) error); ok { - r1 = rf(opts, priceUpdatersToAdd, priceUpdatersToRemove) + r1 = rf(opts, feeTokensToAdd, feeTokensToRemove) } else { r1 = ret.Error(1) } @@ -164,6 +164,66 @@ func (_m *PriceRegistryInterface) ConvertTokenAmount(opts *bind.CallOpts, fromTo return r0, r1 } +// FilterAuthorizedCallerAdded provides a mock function with given fields: opts +func (_m *PriceRegistryInterface) FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*price_registry.PriceRegistryAuthorizedCallerAddedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAuthorizedCallerAdded") + } + + var r0 *price_registry.PriceRegistryAuthorizedCallerAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*price_registry.PriceRegistryAuthorizedCallerAddedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *price_registry.PriceRegistryAuthorizedCallerAddedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*price_registry.PriceRegistryAuthorizedCallerAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FilterAuthorizedCallerRemoved provides a mock function with given fields: opts +func (_m *PriceRegistryInterface) FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*price_registry.PriceRegistryAuthorizedCallerRemovedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAuthorizedCallerRemoved") + } + + var r0 *price_registry.PriceRegistryAuthorizedCallerRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*price_registry.PriceRegistryAuthorizedCallerRemovedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *price_registry.PriceRegistryAuthorizedCallerRemovedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*price_registry.PriceRegistryAuthorizedCallerRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // FilterFeeTokenAdded provides a mock function with given fields: opts, feeToken func (_m *PriceRegistryInterface) FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*price_registry.PriceRegistryFeeTokenAddedIterator, error) { ret := _m.Called(opts, feeToken) @@ -434,27 +494,29 @@ func (_m *PriceRegistryInterface) FilterUsdPerUnitGasUpdated(opts *bind.FilterOp return r0, r1 } -// GetDestinationChainGasPrice provides a mock function with given fields: opts, destChainSelector -func (_m *PriceRegistryInterface) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (price_registry.InternalTimestampedPackedUint224, error) { - ret := _m.Called(opts, destChainSelector) +// GetAllAuthorizedCallers provides a mock function with given fields: opts +func (_m *PriceRegistryInterface) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) if len(ret) == 0 { - panic("no return value specified for GetDestinationChainGasPrice") + panic("no return value specified for GetAllAuthorizedCallers") } - var r0 price_registry.InternalTimestampedPackedUint224 + var r0 []common.Address var r1 error - if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (price_registry.InternalTimestampedPackedUint224, error)); ok { - return rf(opts, destChainSelector) + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) } - if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) price_registry.InternalTimestampedPackedUint224); ok { - r0 = rf(opts, destChainSelector) + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) } else { - r0 = ret.Get(0).(price_registry.InternalTimestampedPackedUint224) + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } } - if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { - r1 = rf(opts, destChainSelector) + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) } else { r1 = ret.Error(1) } @@ -462,29 +524,27 @@ func (_m *PriceRegistryInterface) GetDestinationChainGasPrice(opts *bind.CallOpt return r0, r1 } -// GetFeeTokens provides a mock function with given fields: opts -func (_m *PriceRegistryInterface) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { - ret := _m.Called(opts) +// GetDestinationChainGasPrice provides a mock function with given fields: opts, destChainSelector +func (_m *PriceRegistryInterface) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (price_registry.InternalTimestampedPackedUint224, error) { + ret := _m.Called(opts, destChainSelector) if len(ret) == 0 { - panic("no return value specified for GetFeeTokens") + panic("no return value specified for GetDestinationChainGasPrice") } - var r0 []common.Address + var r0 price_registry.InternalTimestampedPackedUint224 var r1 error - if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { - return rf(opts) + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (price_registry.InternalTimestampedPackedUint224, error)); ok { + return rf(opts, destChainSelector) } - if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { - r0 = rf(opts) + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) price_registry.InternalTimestampedPackedUint224); ok { + r0 = rf(opts, destChainSelector) } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]common.Address) - } + r0 = ret.Get(0).(price_registry.InternalTimestampedPackedUint224) } - if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { - r1 = rf(opts) + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, destChainSelector) } else { r1 = ret.Error(1) } @@ -492,12 +552,12 @@ func (_m *PriceRegistryInterface) GetFeeTokens(opts *bind.CallOpts) ([]common.Ad return r0, r1 } -// GetPriceUpdaters provides a mock function with given fields: opts -func (_m *PriceRegistryInterface) GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) { +// GetFeeTokens provides a mock function with given fields: opts +func (_m *PriceRegistryInterface) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { ret := _m.Called(opts) if len(ret) == 0 { - panic("no return value specified for GetPriceUpdaters") + panic("no return value specified for GetFeeTokens") } var r0 []common.Address @@ -726,6 +786,66 @@ func (_m *PriceRegistryInterface) Owner(opts *bind.CallOpts) (common.Address, er return r0, r1 } +// ParseAuthorizedCallerAdded provides a mock function with given fields: log +func (_m *PriceRegistryInterface) ParseAuthorizedCallerAdded(log types.Log) (*price_registry.PriceRegistryAuthorizedCallerAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAuthorizedCallerAdded") + } + + var r0 *price_registry.PriceRegistryAuthorizedCallerAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*price_registry.PriceRegistryAuthorizedCallerAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *price_registry.PriceRegistryAuthorizedCallerAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*price_registry.PriceRegistryAuthorizedCallerAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ParseAuthorizedCallerRemoved provides a mock function with given fields: log +func (_m *PriceRegistryInterface) ParseAuthorizedCallerRemoved(log types.Log) (*price_registry.PriceRegistryAuthorizedCallerRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAuthorizedCallerRemoved") + } + + var r0 *price_registry.PriceRegistryAuthorizedCallerRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*price_registry.PriceRegistryAuthorizedCallerRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *price_registry.PriceRegistryAuthorizedCallerRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*price_registry.PriceRegistryAuthorizedCallerRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // ParseFeeTokenAdded provides a mock function with given fields: log func (_m *PriceRegistryInterface) ParseFeeTokenAdded(log types.Log) (*price_registry.PriceRegistryFeeTokenAdded, error) { ret := _m.Called(log) @@ -1144,6 +1264,66 @@ func (_m *PriceRegistryInterface) UpdateTokenPriceFeeds(opts *bind.TransactOpts, return r0, r1 } +// WatchAuthorizedCallerAdded provides a mock function with given fields: opts, sink +func (_m *PriceRegistryInterface) WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *price_registry.PriceRegistryAuthorizedCallerAdded) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAuthorizedCallerAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *price_registry.PriceRegistryAuthorizedCallerAdded) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *price_registry.PriceRegistryAuthorizedCallerAdded) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *price_registry.PriceRegistryAuthorizedCallerAdded) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// WatchAuthorizedCallerRemoved provides a mock function with given fields: opts, sink +func (_m *PriceRegistryInterface) WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *price_registry.PriceRegistryAuthorizedCallerRemoved) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAuthorizedCallerRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *price_registry.PriceRegistryAuthorizedCallerRemoved) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *price_registry.PriceRegistryAuthorizedCallerRemoved) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *price_registry.PriceRegistryAuthorizedCallerRemoved) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // WatchFeeTokenAdded provides a mock function with given fields: opts, sink, feeToken func (_m *PriceRegistryInterface) WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *price_registry.PriceRegistryFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, feeToken) diff --git a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go index 02025757b5..805c49d91a 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go @@ -39,7 +39,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_arm_contract" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" @@ -185,7 +185,7 @@ type Common struct { WrappedNativePool *lock_release_token_pool.LockReleaseTokenPool ARM *mock_arm_contract.MockARMContract ARMProxy *arm_proxy_contract.ARMProxyContract - PriceRegistry *price_registry.PriceRegistry + PriceRegistry *price_registry_1_2_0.PriceRegistry TokenAdminRegistry *token_admin_registry.TokenAdminRegistry } @@ -400,22 +400,21 @@ func (c *CCIPContracts) DeployNewCommitStore(t *testing.T) { func (c *CCIPContracts) DeployNewPriceRegistry(t *testing.T) { t.Log("Deploying new Price Registry") - destPricesAddress, _, _, err := price_registry.DeployPriceRegistry( + destPricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( c.Dest.User, c.Dest.Chain, []common.Address{c.Dest.CommitStore.Address()}, []common.Address{c.Dest.LinkToken.Address()}, 60*60*24*14, // two weeks - nil, ) require.NoError(t, err) c.Source.Chain.Commit() c.Dest.Chain.Commit() - c.Dest.PriceRegistry, err = price_registry.NewPriceRegistry(destPricesAddress, c.Dest.Chain) + c.Dest.PriceRegistry, err = price_registry_1_2_0.NewPriceRegistry(destPricesAddress, c.Dest.Chain) require.NoError(t, err) - priceUpdates := price_registry.InternalPriceUpdates{ - TokenPriceUpdates: []price_registry.InternalTokenPriceUpdate{ + priceUpdates := price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ { SourceToken: c.Dest.LinkToken.Address(), UsdPerToken: big.NewInt(8e18), // 8usd @@ -425,7 +424,7 @@ func (c *CCIPContracts) DeployNewPriceRegistry(t *testing.T) { UsdPerToken: big.NewInt(1e18), // 1usd }, }, - GasPriceUpdates: []price_registry.InternalGasPriceUpdate{ + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ { DestChainSelector: c.Source.ChainSelector, UsdPerUnitGas: big.NewInt(2000e9), // $2000 per eth * 1gwei = 2000e9 @@ -988,21 +987,20 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh // │ Deploy Price Registry │ // ================================================================ - sourcePricesAddress, _, _, err := price_registry.DeployPriceRegistry( + sourcePricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( sourceUser, sourceChain, nil, []common.Address{sourceLinkTokenAddress, sourceWeth9addr}, 60*60*24*14, // two weeks - nil, ) require.NoError(t, err) - srcPriceRegistry, err := price_registry.NewPriceRegistry(sourcePricesAddress, sourceChain) + srcPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(sourcePricesAddress, sourceChain) require.NoError(t, err) - _, err = srcPriceRegistry.UpdatePrices(sourceUser, price_registry.InternalPriceUpdates{ - TokenPriceUpdates: []price_registry.InternalTokenPriceUpdate{ + _, err = srcPriceRegistry.UpdatePrices(sourceUser, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ { SourceToken: sourceLinkTokenAddress, UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(20)), @@ -1012,7 +1010,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2000)), }, }, - GasPriceUpdates: []price_registry.InternalGasPriceUpdate{ + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ { DestChainSelector: destChainSelector, UsdPerUnitGas: big.NewInt(20000e9), @@ -1095,16 +1093,15 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh require.NoError(t, err) sourceChain.Commit() - destPriceRegistryAddress, _, _, err := price_registry.DeployPriceRegistry( + destPriceRegistryAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( destUser, destChain, nil, []common.Address{destLinkTokenAddress, destWeth9addr}, 60*60*24*14, // two weeks - nil, ) require.NoError(t, err) - destPriceRegistry, err := price_registry.NewPriceRegistry(destPriceRegistryAddress, destChain) + destPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(destPriceRegistryAddress, destChain) require.NoError(t, err) // Deploy commit store. diff --git a/integration-tests/ccip-tests/contracts/contract_models.go b/integration-tests/ccip-tests/contracts/contract_models.go index 588d53a6d5..2add9ede13 100644 --- a/integration-tests/ccip-tests/contracts/contract_models.go +++ b/integration-tests/ccip-tests/contracts/contract_models.go @@ -1076,7 +1076,13 @@ func (p *PriceRegistryWrapper) GetTokenPrice(opts *bind.CallOpts, token common.A func (p *PriceRegistryWrapper) AddPriceUpdater(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { if p.Latest != nil { - return p.Latest.ApplyPriceUpdatersUpdates(opts, []common.Address{addr}, []common.Address{}) + return p.Latest.ApplyAuthorizedCallerUpdates( + opts, + price_registry.AuthorizedCallersAuthorizedCallerArgs{ + AddedCallers: []common.Address{addr}, + RemovedCallers: []common.Address{}, + }, + ) } if p.V1_2_0 != nil { return p.V1_2_0.ApplyPriceUpdatersUpdates(opts, []common.Address{addr}, []common.Address{})