diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index f1900effc2..cc2c1825c0 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -20,21 +20,21 @@ AggregateTokenLimiter_setRateLimiterConfig:test_OnlyOnlyCallableByAdminOrOwner_R AggregateTokenLimiter_setRateLimiterConfig:test_Owner_Success() (gas: 30393) AggregateTokenLimiter_setRateLimiterConfig:test_TokenLimitAdmin_Success() (gas: 32407) BurnFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 28842) -BurnFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55271) -BurnFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244024) +BurnFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55227) +BurnFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 243952) BurnFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24166) BurnMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 27609) -BurnMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55271) -BurnMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 241912) +BurnMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55227) +BurnMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 241788) BurnMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 17851) BurnMintTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 28805) -BurnMintTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56253) -BurnMintTokenPool_releaseOrMint:test_PoolMint_Success() (gas: 112391) +BurnMintTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56209) +BurnMintTokenPool_releaseOrMint:test_PoolMint_Success() (gas: 112369) BurnWithFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 28842) -BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55271) -BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244050) +BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55227) +BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 243927) BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24170) -CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2052431) +CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2052233) CCIPConfigSetup:test_getCapabilityConfiguration_Success() (gas: 9508) CCIPConfig_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 83274) CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 354656) @@ -120,30 +120,30 @@ CommitStore_verify:test_Blessed_Success() (gas: 96581) CommitStore_verify:test_NotBlessed_Success() (gas: 61473) CommitStore_verify:test_Paused_Revert() (gas: 18568) CommitStore_verify:test_TooManyLeaves_Revert() (gas: 36848) -DefensiveExampleTest:test_HappyPath_Success() (gas: 200200) -DefensiveExampleTest:test_Recovery() (gas: 424479) -E2E:test_E2E_3MessagesSuccess_gas() (gas: 1106985) +DefensiveExampleTest:test_HappyPath_Success() (gas: 200130) +DefensiveExampleTest:test_Recovery() (gas: 424338) +E2E:test_E2E_3MessagesSuccess_gas() (gas: 1106787) EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_NotACompatiblePool_Revert() (gas: 38322) -EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_Success() (gas: 104438) -EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_TokenHandlingError_transfer_Revert() (gas: 86026) +EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_Success() (gas: 104372) +EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_TokenHandlingError_transfer_Revert() (gas: 86004) EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_InvalidDataLength_Revert() (gas: 37365) -EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 95013) +EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 95035) EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() (gas: 40341) EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() (gas: 87189) -EVM2EVMOffRamp__releaseOrMintTokens:test_OverValueWithARLOff_Success() (gas: 381594) -EVM2EVMOffRamp__releaseOrMintTokens:test_PriceNotFoundForToken_Reverts() (gas: 140568) -EVM2EVMOffRamp__releaseOrMintTokens:test_RateLimitErrors_Reverts() (gas: 798833) -EVM2EVMOffRamp__releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 178400) +EVM2EVMOffRamp__releaseOrMintTokens:test_OverValueWithARLOff_Success() (gas: 381462) +EVM2EVMOffRamp__releaseOrMintTokens:test_PriceNotFoundForToken_Reverts() (gas: 140546) +EVM2EVMOffRamp__releaseOrMintTokens:test_RateLimitErrors_Reverts() (gas: 798613) +EVM2EVMOffRamp__releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 178356) EVM2EVMOffRamp__releaseOrMintTokens:test__releaseOrMintTokens_NotACompatiblePool_Reverts() (gas: 29681) -EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 67146) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 67124) EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_InvalidEVMAddress_Revert() (gas: 43605) -EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 208068) -EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 219365) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 207958) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 219299) EVM2EVMOffRamp__report:test_Report_Success() (gas: 127774) -EVM2EVMOffRamp__trialExecute:test_RateLimitError_Success() (gas: 237406) -EVM2EVMOffRamp__trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 246039) -EVM2EVMOffRamp__trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 329283) -EVM2EVMOffRamp__trialExecute:test_trialExecute_Success() (gas: 310166) +EVM2EVMOffRamp__trialExecute:test_RateLimitError_Success() (gas: 237362) +EVM2EVMOffRamp__trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 245951) +EVM2EVMOffRamp__trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 329217) +EVM2EVMOffRamp__trialExecute:test_trialExecute_Success() (gas: 310056) EVM2EVMOffRamp_ccipReceive:test_Reverts() (gas: 17048) EVM2EVMOffRamp_constructor:test_CommitStoreAlreadyInUse_Revert() (gas: 153120) EVM2EVMOffRamp_constructor:test_Constructor_Success() (gas: 5212732) @@ -151,7 +151,7 @@ EVM2EVMOffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 143845) EVM2EVMOffRamp_execute:test_EmptyReport_Revert() (gas: 21507) EVM2EVMOffRamp_execute:test_InvalidMessageId_Revert() (gas: 36936) EVM2EVMOffRamp_execute:test_InvalidSourceChain_Revert() (gas: 52324) -EVM2EVMOffRamp_execute:test_InvalidSourcePoolAddress_Success() (gas: 473387) +EVM2EVMOffRamp_execute:test_InvalidSourcePoolAddress_Success() (gas: 473299) EVM2EVMOffRamp_execute:test_ManualExecutionNotYetEnabled_Revert() (gas: 48346) EVM2EVMOffRamp_execute:test_MessageTooLarge_Revert() (gas: 153019) EVM2EVMOffRamp_execute:test_Paused_Revert() (gas: 103946) @@ -162,25 +162,25 @@ EVM2EVMOffRamp_execute:test_SingleMessageNoTokensUnordered_Success() (gas: 16011 EVM2EVMOffRamp_execute:test_SingleMessageNoTokens_Success() (gas: 175497) EVM2EVMOffRamp_execute:test_SingleMessageToNonCCIPReceiver_Success() (gas: 237901) EVM2EVMOffRamp_execute:test_SingleMessagesNoTokensSuccess_gas() (gas: 115048) -EVM2EVMOffRamp_execute:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 406606) +EVM2EVMOffRamp_execute:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 406540) EVM2EVMOffRamp_execute:test_SkippedIncorrectNonce_Success() (gas: 54774) EVM2EVMOffRamp_execute:test_StrictUntouchedToSuccess_Success() (gas: 132556) EVM2EVMOffRamp_execute:test_TokenDataMismatch_Revert() (gas: 52786) -EVM2EVMOffRamp_execute:test_TwoMessagesWithTokensAndGE_Success() (gas: 564471) -EVM2EVMOffRamp_execute:test_TwoMessagesWithTokensSuccess_gas() (gas: 494719) +EVM2EVMOffRamp_execute:test_TwoMessagesWithTokensAndGE_Success() (gas: 564339) +EVM2EVMOffRamp_execute:test_TwoMessagesWithTokensSuccess_gas() (gas: 494587) EVM2EVMOffRamp_execute:test_UnexpectedTokenData_Revert() (gas: 35887) -EVM2EVMOffRamp_execute:test_Unhealthy_Revert() (gas: 546333) +EVM2EVMOffRamp_execute:test_Unhealthy_Revert() (gas: 546201) EVM2EVMOffRamp_execute:test_UnsupportedNumberOfTokens_Revert() (gas: 65298) EVM2EVMOffRamp_execute:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 124107) EVM2EVMOffRamp_execute:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 144365) EVM2EVMOffRamp_execute:test_execute_RouterYULCall_Success() (gas: 394187) EVM2EVMOffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18685) -EVM2EVMOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 275257) +EVM2EVMOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 275191) EVM2EVMOffRamp_executeSingleMessage:test_NonContract_Success() (gas: 18815) -EVM2EVMOffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 223182) +EVM2EVMOffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 223138) EVM2EVMOffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 48391) EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 47823) -EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 311554) +EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 311488) EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_ZeroGasZeroData_Success() (gas: 70839) EVM2EVMOffRamp_execute_upgrade:test_V2NonceNewSenderStartsAtZero_Success() (gas: 232136) EVM2EVMOffRamp_execute_upgrade:test_V2NonceStartsAtV1Nonce_Success() (gas: 281170) @@ -194,13 +194,13 @@ EVM2EVMOffRamp_manuallyExecute:test_ManualExecFailedTx_Revert() (gas: 188280) EVM2EVMOffRamp_manuallyExecute:test_ManualExecForkedChain_Revert() (gas: 27574) EVM2EVMOffRamp_manuallyExecute:test_ManualExecGasLimitMismatch_Revert() (gas: 46457) EVM2EVMOffRamp_manuallyExecute:test_ManualExecInvalidGasLimit_Revert() (gas: 27948) -EVM2EVMOffRamp_manuallyExecute:test_ManualExecWithMultipleMessagesAndSourceTokens_Success() (gas: 531330) -EVM2EVMOffRamp_manuallyExecute:test_ManualExecWithSourceTokens_Success() (gas: 344463) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecWithMultipleMessagesAndSourceTokens_Success() (gas: 531198) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecWithSourceTokens_Success() (gas: 344397) EVM2EVMOffRamp_manuallyExecute:test_ManualExec_Success() (gas: 189760) -EVM2EVMOffRamp_manuallyExecute:test_ReentrancyManualExecuteFails_Success() (gas: 2195128) -EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_DestinationGasAmountCountMismatch_Revert() (gas: 362054) +EVM2EVMOffRamp_manuallyExecute:test_ReentrancyManualExecuteFails_Success() (gas: 2195062) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_DestinationGasAmountCountMismatch_Revert() (gas: 361988) EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched_Success() (gas: 145457) -EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_InvalidTokenGasOverride_Revert() (gas: 365283) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_InvalidTokenGasOverride_Revert() (gas: 365217) EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_LowGasLimitManualExec_Success() (gas: 450711) EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 192223) EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_WithInvalidReceiverExecutionGasOverride_Revert() (gas: 155387) @@ -235,15 +235,15 @@ EVM2EVMOnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 25757) EVM2EVMOnRamp_forwardFromRouter:test_PriceNotFoundForToken_Revert() (gas: 57722) EVM2EVMOnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 182247) EVM2EVMOnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 180718) -EVM2EVMOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 133236) -EVM2EVMOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3573653) +EVM2EVMOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 133214) +EVM2EVMOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3573565) EVM2EVMOnRamp_forwardFromRouter:test_TooManyTokens_Revert() (gas: 30472) EVM2EVMOnRamp_forwardFromRouter:test_Unhealthy_Revert() (gas: 43480) EVM2EVMOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 110111) EVM2EVMOnRamp_forwardFromRouter:test_ZeroAddressReceiver_Revert() (gas: 316020) -EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_ShouldStoreLinkFees_Success() (gas: 113033) +EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_ShouldStoreLinkFees_Success() (gas: 113011) EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 72824) -EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_correctSourceTokenData_Success() (gas: 714726) +EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_correctSourceTokenData_Success() (gas: 714506) EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2NonceNewSenderStartsAtZero_Success() (gas: 148808) EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2NonceStartsAtV1Nonce_Success() (gas: 192679) EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2SenderNoncesReadsPreviousRamp_Success() (gas: 123243) @@ -272,14 +272,14 @@ EVM2EVMOnRamp_getTokenTransferCost:test_UnsupportedToken_Revert() (gas: 21353) EVM2EVMOnRamp_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28382) EVM2EVMOnRamp_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 38899) EVM2EVMOnRamp_getTokenTransferCost:test__getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 29674) -EVM2EVMOnRamp_linkAvailableForPayment:test_InsufficientLinkBalance_Success() (gas: 32756) -EVM2EVMOnRamp_linkAvailableForPayment:test_LinkAvailableForPayment_Success() (gas: 135247) -EVM2EVMOnRamp_payNops:test_AdminPayNops_Success() (gas: 143660) -EVM2EVMOnRamp_payNops:test_InsufficientBalance_Revert() (gas: 29196) -EVM2EVMOnRamp_payNops:test_NoFeesToPay_Revert() (gas: 127718) -EVM2EVMOnRamp_payNops:test_NoNopsToPay_Revert() (gas: 133580) -EVM2EVMOnRamp_payNops:test_NopPayNops_Success() (gas: 146947) -EVM2EVMOnRamp_payNops:test_OwnerPayNops_Success() (gas: 141522) +EVM2EVMOnRamp_linkAvailableForPayment:test_InsufficientLinkBalance_Success() (gas: 32734) +EVM2EVMOnRamp_linkAvailableForPayment:test_LinkAvailableForPayment_Success() (gas: 135225) +EVM2EVMOnRamp_payNops:test_AdminPayNops_Success() (gas: 143638) +EVM2EVMOnRamp_payNops:test_InsufficientBalance_Revert() (gas: 29174) +EVM2EVMOnRamp_payNops:test_NoFeesToPay_Revert() (gas: 127762) +EVM2EVMOnRamp_payNops:test_NoNopsToPay_Revert() (gas: 133615) +EVM2EVMOnRamp_payNops:test_NopPayNops_Success() (gas: 146925) +EVM2EVMOnRamp_payNops:test_OwnerPayNops_Success() (gas: 141500) EVM2EVMOnRamp_payNops:test_PayNopsSuccessAfterSetNops() (gas: 298719) EVM2EVMOnRamp_payNops:test_WrongPermissions_Revert() (gas: 15378) EVM2EVMOnRamp_setDynamicConfig:test_SetConfigInvalidConfig_Revert() (gas: 42524) @@ -289,10 +289,10 @@ EVM2EVMOnRamp_setFeeTokenConfig:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 1 EVM2EVMOnRamp_setFeeTokenConfig:test_SetFeeTokenConfigByAdmin_Success() (gas: 16497) EVM2EVMOnRamp_setFeeTokenConfig:test_SetFeeTokenConfig_Success() (gas: 14036) EVM2EVMOnRamp_setNops:test_AdminCanSetNops_Success() (gas: 61872) -EVM2EVMOnRamp_setNops:test_IncludesPayment_Success() (gas: 470835) +EVM2EVMOnRamp_setNops:test_IncludesPayment_Success() (gas: 470769) EVM2EVMOnRamp_setNops:test_LinkTokenCannotBeNop_Revert() (gas: 57370) EVM2EVMOnRamp_setNops:test_NonOwnerOrAdmin_Revert() (gas: 14779) -EVM2EVMOnRamp_setNops:test_NotEnoughFundsForPayout_Revert() (gas: 85200) +EVM2EVMOnRamp_setNops:test_NotEnoughFundsForPayout_Revert() (gas: 85178) EVM2EVMOnRamp_setNops:test_SetNopsRemovesOldNopsCompletely_Success() (gas: 60868) EVM2EVMOnRamp_setNops:test_SetNops_Success() (gas: 174097) EVM2EVMOnRamp_setNops:test_TooManyNops_Revert() (gas: 193503) @@ -301,10 +301,10 @@ EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_InvalidD EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_OnlyCallableByOwnerOrAdmin_Revert() (gas: 14427) EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_Success() (gas: 85487) EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_byAdmin_Success() (gas: 17468) -EVM2EVMOnRamp_withdrawNonLinkFees:test_LinkBalanceNotSettled_Revert() (gas: 83617) +EVM2EVMOnRamp_withdrawNonLinkFees:test_LinkBalanceNotSettled_Revert() (gas: 83595) EVM2EVMOnRamp_withdrawNonLinkFees:test_NonOwnerOrAdmin_Revert() (gas: 15353) -EVM2EVMOnRamp_withdrawNonLinkFees:test_SettlingBalance_Success() (gas: 272851) -EVM2EVMOnRamp_withdrawNonLinkFees:test_WithdrawNonLinkFees_Success() (gas: 53566) +EVM2EVMOnRamp_withdrawNonLinkFees:test_SettlingBalance_Success() (gas: 272728) +EVM2EVMOnRamp_withdrawNonLinkFees:test_WithdrawNonLinkFees_Success() (gas: 53500) EVM2EVMOnRamp_withdrawNonLinkFees:test_WithdrawToZeroAddress_Revert() (gas: 12875) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96907) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49775) @@ -379,20 +379,20 @@ FeeQuoter_getValidatedFee:test_NotAFeeToken_Revert() (gas: 21172) FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 113309) FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 22691) FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 62714) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1973907) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1973865) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1953984) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 1973639) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 1973843) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 1973655) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 2045042) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 2045000) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 2025119) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 2044774) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 2044978) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 2044790) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 64610) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 64490) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 58894) -FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 1973352) +FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 2044487) FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken_Success() (gas: 61764) FeeQuoter_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 116495) FeeQuoter_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 14037) -FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 1972029) +FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 2043164) FeeQuoter_onReport:test_OnReport_StaleUpdate_Revert() (gas: 43631) FeeQuoter_onReport:test_onReport_InvalidForwarder_Reverts() (gas: 23492) FeeQuoter_onReport:test_onReport_Success() (gas: 80094) @@ -431,13 +431,13 @@ FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddressPrecompiles_Revert() ( FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddress_Revert() (gas: 10839) FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress_Success() (gas: 6731) FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress_Success() (gas: 6511) -HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_LockReleaseMechanism_then_switchToPrimary_Success() (gas: 209248) -HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_PrimaryMechanism_Success() (gas: 135879) -HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_WhileMigrationPause_Revert() (gas: 107090) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_LockReleaseMechanism_then_switchToPrimary_Success() (gas: 209283) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_PrimaryMechanism_Success() (gas: 135896) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_WhileMigrationPause_Revert() (gas: 107112) HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_onLockReleaseMechanism_Success() (gas: 144586) -HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_OnLockReleaseMechanism_Success() (gas: 214817) -HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() (gas: 423641) -HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_incomingMessageWithPrimaryMechanism() (gas: 268928) +HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_OnLockReleaseMechanism_Success() (gas: 214795) +HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() (gas: 423509) +HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_incomingMessageWithPrimaryMechanism() (gas: 268840) HybridUSDCTokenPoolMigrationTests:test_ReleaseOrMint_WhileMigrationPause_Revert() (gas: 111484) HybridUSDCTokenPoolMigrationTests:test_burnLockedUSDC_invalidPermissions_Revert() (gas: 39362) HybridUSDCTokenPoolMigrationTests:test_cancelExistingCCTPMigrationProposal() (gas: 33189) @@ -445,19 +445,19 @@ HybridUSDCTokenPoolMigrationTests:test_cannotCancelANonExistentMigrationProposal HybridUSDCTokenPoolMigrationTests:test_cannotModifyLiquidityWithoutPermissions_Revert() (gas: 13329) HybridUSDCTokenPoolMigrationTests:test_cannotTransferLiquidityDuringPendingMigration_Revert() (gas: 160900) HybridUSDCTokenPoolMigrationTests:test_lockOrBurn_then_BurnInCCTPMigration_Success() (gas: 255982) -HybridUSDCTokenPoolMigrationTests:test_transferLiquidity_Success() (gas: 165921) -HybridUSDCTokenPoolMigrationTests:test_unstickManualTxAfterMigration_destChain_Success() (gas: 154242) -HybridUSDCTokenPoolMigrationTests:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 463740) -HybridUSDCTokenPoolTests:test_LockOrBurn_LockReleaseMechanism_then_switchToPrimary_Success() (gas: 209230) -HybridUSDCTokenPoolTests:test_LockOrBurn_PrimaryMechanism_Success() (gas: 135880) -HybridUSDCTokenPoolTests:test_LockOrBurn_WhileMigrationPause_Revert() (gas: 107135) +HybridUSDCTokenPoolMigrationTests:test_transferLiquidity_Success() (gas: 165904) +HybridUSDCTokenPoolMigrationTests:test_unstickManualTxAfterMigration_destChain_Success() (gas: 154220) +HybridUSDCTokenPoolMigrationTests:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 463617) +HybridUSDCTokenPoolTests:test_LockOrBurn_LockReleaseMechanism_then_switchToPrimary_Success() (gas: 209265) +HybridUSDCTokenPoolTests:test_LockOrBurn_PrimaryMechanism_Success() (gas: 135897) +HybridUSDCTokenPoolTests:test_LockOrBurn_WhileMigrationPause_Revert() (gas: 107157) HybridUSDCTokenPoolTests:test_LockOrBurn_onLockReleaseMechanism_Success() (gas: 144607) -HybridUSDCTokenPoolTests:test_MintOrRelease_OnLockReleaseMechanism_Success() (gas: 214795) -HybridUSDCTokenPoolTests:test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() (gas: 423619) -HybridUSDCTokenPoolTests:test_MintOrRelease_incomingMessageWithPrimaryMechanism() (gas: 268910) +HybridUSDCTokenPoolTests:test_MintOrRelease_OnLockReleaseMechanism_Success() (gas: 214773) +HybridUSDCTokenPoolTests:test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() (gas: 423487) +HybridUSDCTokenPoolTests:test_MintOrRelease_incomingMessageWithPrimaryMechanism() (gas: 268822) HybridUSDCTokenPoolTests:test_ReleaseOrMint_WhileMigrationPause_Revert() (gas: 111528) HybridUSDCTokenPoolTests:test_cannotTransferLiquidityDuringPendingMigration_Revert() (gas: 160845) -HybridUSDCTokenPoolTests:test_transferLiquidity_Success() (gas: 165904) +HybridUSDCTokenPoolTests:test_transferLiquidity_Success() (gas: 165886) LockReleaseTokenPoolAndProxy_setRebalancer:test_SetRebalancer_Revert() (gas: 10989) LockReleaseTokenPoolAndProxy_setRebalancer:test_SetRebalancer_Success() (gas: 18028) LockReleaseTokenPoolPoolAndProxy_canAcceptLiquidity:test_CanAcceptLiquidity_Success() (gas: 3051552) @@ -469,17 +469,17 @@ LockReleaseTokenPoolPoolAndProxy_withdrawalLiquidity:test_Unauthorized_Revert() LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquidity_Success() (gas: 2836138) LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30062) LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Success() (gas: 79943) -LockReleaseTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 59620) +LockReleaseTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 59576) LockReleaseTokenPool_provideLiquidity:test_LiquidityNotAccepted_Revert() (gas: 2832618) LockReleaseTokenPool_provideLiquidity:test_Unauthorized_Revert() (gas: 11489) LockReleaseTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 72743) -LockReleaseTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56352) -LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_Success() (gas: 225548) +LockReleaseTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56308) +LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_Success() (gas: 225477) LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Revert() (gas: 11011) LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Success() (gas: 18094) LockReleaseTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 10196) -LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_Success() (gas: 83231) -LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_transferTooMuch_Revert() (gas: 55953) +LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_Success() (gas: 83187) +LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_transferTooMuch_Revert() (gas: 55887) LockReleaseTokenPool_withdrawalLiquidity:test_InsufficientLiquidity_Revert() (gas: 60187) LockReleaseTokenPool_withdrawalLiquidity:test_Unauthorized_Revert() (gas: 11464) LockRelease_setRateLimitAdmin:test_SetRateLimitAdmin_Revert() (gas: 11054) @@ -573,7 +573,7 @@ MultiOCR3Base_transmit:test_UnauthorizedSigner_Revert() (gas: 61275) MultiOCR3Base_transmit:test_UnconfiguredPlugin_Revert() (gas: 39933) MultiOCR3Base_transmit:test_ZeroSignatures_Revert() (gas: 33049) MultiOnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 233701) -MultiRampsE2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1500580) +MultiRampsE2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1500382) NonceManager_NonceIncrementation:test_getIncrementedOutboundNonce_Success() (gas: 37934) NonceManager_NonceIncrementation:test_incrementInboundNonce_Skip() (gas: 23706) NonceManager_NonceIncrementation:test_incrementInboundNonce_Success() (gas: 38778) @@ -637,7 +637,7 @@ OffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 278912) OffRamp_batchExecute:test_MultipleReportsSkipDuplicate_Success() (gas: 169308) OffRamp_batchExecute:test_OutOfBoundsGasLimitsAccess_Revert() (gas: 189031) OffRamp_batchExecute:test_SingleReport_Success() (gas: 157132) -OffRamp_batchExecute:test_Unhealthy_Success() (gas: 554208) +OffRamp_batchExecute:test_Unhealthy_Success() (gas: 554076) OffRamp_batchExecute:test_ZeroReports_Revert() (gas: 10600) OffRamp_ccipReceive:test_Reverts() (gas: 15385) OffRamp_commit:test_CommitOnRampMismatch_Revert() (gas: 92905) @@ -679,18 +679,18 @@ OffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 148382) OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6672410) OffRamp_execute:test_ZeroReports_Revert() (gas: 17361) OffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18511) -OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 244057) +OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 243991) OffRamp_executeSingleMessage:test_NonContract_Success() (gas: 20759) -OffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 205094) +OffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 205050) OffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 49316) OffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 48760) OffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidationNoRouterCall_Revert() (gas: 218081) OffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidation_Revert() (gas: 85349) -OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 274194) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 274128) OffRamp_executeSingleMessage:test_executeSingleMessage_WithVInterception_Success() (gas: 91809) OffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 28260) OffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 22062) -OffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 481748) +OffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 481660) OffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 48372) OffRamp_executeSingleReport:test_MismatchingDestChainSelector_Revert() (gas: 33959) OffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 28436) @@ -703,15 +703,15 @@ OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: OffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 213624) OffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 249506) OffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 142151) -OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 409289) +OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 409223) OffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 58293) OffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 73868) -OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 583401) -OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 532115) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 583269) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 531983) OffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 33717) -OffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 549738) -OffRamp_executeSingleReport:test_Unhealthy_Success() (gas: 549752) -OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 460495) +OffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 549606) +OffRamp_executeSingleReport:test_Unhealthy_Success() (gas: 549620) +OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 460363) OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 135910) OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 165615) OffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3868658) @@ -727,34 +727,34 @@ OffRamp_manuallyExecute:test_manuallyExecute_InvalidReceiverExecutionGasLimit_Re OffRamp_manuallyExecute:test_manuallyExecute_InvalidTokenGasOverride_Revert() (gas: 55260) OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit_Success() (gas: 498614) OffRamp_manuallyExecute:test_manuallyExecute_MultipleReportsWithSingleCursedLane_Revert() (gas: 316158) -OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails_Success() (gas: 2245360) +OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails_Success() (gas: 2245294) OffRamp_manuallyExecute:test_manuallyExecute_SourceChainSelectorMismatch_Revert() (gas: 165602) OffRamp_manuallyExecute:test_manuallyExecute_Success() (gas: 227234) OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 227774) OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride_Success() (gas: 781510) OffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages_Success() (gas: 347431) OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_NotACompatiblePool_Revert() (gas: 37634) -OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 104404) -OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_TokenHandlingError_transfer_Revert() (gas: 85342) +OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 104338) +OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_TokenHandlingError_transfer_Revert() (gas: 85320) OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_InvalidDataLength_Revert() (gas: 36752) -OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 94382) +OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 94404) OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() (gas: 39741) OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() (gas: 86516) -OffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 162381) +OffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 162337) OffRamp_releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAPool_Reverts() (gas: 23903) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 62751) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 79790) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 174512) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride_Success() (gas: 176424) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 187723) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 62729) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 79768) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 174402) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride_Success() (gas: 176314) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 187657) OffRamp_setDynamicConfig:test_FeeQuoterZeroAddress_Revert() (gas: 11269) OffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 13884) OffRamp_setDynamicConfig:test_SetDynamicConfigWithInterceptor_Success() (gas: 46421) OffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 24463) -OffRamp_trialExecute:test_RateLimitError_Success() (gas: 219355) -OffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 227977) -OffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 295350) -OffRamp_trialExecute:test_trialExecute_Success() (gas: 277894) +OffRamp_trialExecute:test_RateLimitError_Success() (gas: 219311) +OffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 227889) +OffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 295284) +OffRamp_trialExecute:test_trialExecute_Success() (gas: 277784) OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 390842) OnRamp_applyAllowListUpdates:test_applyAllowListUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 18030) OnRamp_applyAllowListUpdates:test_applyAllowListUpdates_Revert() (gas: 67426) @@ -782,9 +782,9 @@ OnRamp_forwardFromRouter:test_Paused_Revert() (gas: 38431) OnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 23640) OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 183954) OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 210338) -OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 146154) -OnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 160259) -OnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3613942) +OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 146132) +OnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 160237) +OnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3613854) OnRamp_forwardFromRouter:test_UnAllowedOriginalSender_Revert() (gas: 24010) OnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 75866) OnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 38599) @@ -803,7 +803,7 @@ OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigInvalidConfig_Revert( OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigOnlyOwner_Revert() (gas: 16850) OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigReentrancyGuardEnteredEqTrue_Revert() (gas: 13265) OnRamp_setDynamicConfig:test_setDynamicConfig_Success() (gas: 56369) -OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens_Success() (gas: 97302) +OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens_Success() (gas: 97258) PingPong_ccipReceive:test_CcipReceive_Success() (gas: 151349) PingPong_plumbing:test_OutOfOrderExecution_Success() (gas: 20310) PingPong_plumbing:test_Pausing_Success() (gas: 17810) @@ -902,8 +902,8 @@ RateLimiter_currentTokenBucketState:test_CurrentTokenBucketState_Success() (gas: RateLimiter_currentTokenBucketState:test_Refill_Success() (gas: 46849) RateLimiter_setTokenBucketConfig:test_SetRateLimiterConfig_Success() (gas: 38506) RegistryModuleOwnerCustom_constructor:test_constructor_Revert() (gas: 36033) -RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Revert() (gas: 19739) -RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Success() (gas: 130086) +RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Revert() (gas: 19663) +RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Success() (gas: 130010) RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Revert() (gas: 19559) RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Success() (gas: 129905) Router_applyRampUpdates:test_OffRampMismatch_Revert() (gas: 89366) @@ -934,7 +934,7 @@ Router_recoverTokens:test_RecoverTokensInvalidRecipient_Revert() (gas: 11334) Router_recoverTokens:test_RecoverTokensNoFunds_Revert() (gas: 20267) Router_recoverTokens:test_RecoverTokensNonOwner_Revert() (gas: 11171) Router_recoverTokens:test_RecoverTokensValueReceiver_Revert() (gas: 358049) -Router_recoverTokens:test_RecoverTokens_Success() (gas: 52480) +Router_recoverTokens:test_RecoverTokens_Success() (gas: 52445) Router_routeMessage:test_AutoExec_Success() (gas: 42816) Router_routeMessage:test_ExecutionEvent_Success() (gas: 158520) Router_routeMessage:test_ManualExec_Success() (gas: 35546) @@ -966,18 +966,18 @@ TokenAdminRegistry_setPool:test_setPool_Success() (gas: 36135) TokenAdminRegistry_setPool:test_setPool_ZeroAddressRemovesPool_Success() (gas: 30842) TokenAdminRegistry_transferAdminRole:test_transferAdminRole_OnlyAdministrator_Revert() (gas: 18103) TokenAdminRegistry_transferAdminRole:test_transferAdminRole_Success() (gas: 49438) -TokenPoolAndProxy:test_lockOrBurn_burnMint_Success() (gas: 5586499) -TokenPoolAndProxy:test_lockOrBurn_burnWithFromMint_Success() (gas: 5617969) -TokenPoolAndProxy:test_lockOrBurn_lockRelease_Success() (gas: 5793246) +TokenPoolAndProxy:test_lockOrBurn_burnMint_Success() (gas: 5586367) +TokenPoolAndProxy:test_lockOrBurn_burnWithFromMint_Success() (gas: 5617902) +TokenPoolAndProxy:test_lockOrBurn_lockRelease_Success() (gas: 5793136) TokenPoolAndProxy:test_setPreviousPool_Success() (gas: 3070731) -TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_2() (gas: 6434801) -TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_4() (gas: 6634934) -TokenPoolFactoryTests:test_TokenPoolFactory_Constructor_Revert() (gas: 4118758) -TokenPoolFactoryTests:test_createTokenPool_ExistingRemoteToken_AndPredictPool_Success() (gas: 15396183) -TokenPoolFactoryTests:test_createTokenPool_WithNoExistingRemoteContracts_predict_Success() (gas: 15665428) -TokenPoolFactoryTests:test_createTokenPool_WithNoExistingTokenOnRemoteChain_Success() (gas: 5740557) -TokenPoolFactoryTests:test_createTokenPool_WithRemoteTokenAndRemotePool_Success() (gas: 5894400) -TokenPoolFactoryTests:test_updateRemoteChainConfig_Success() (gas: 86259) +TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_2() (gas: 6434669) +TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_4() (gas: 6634802) +TokenPoolFactoryTests:test_TokenPoolFactory_Constructor_Revert() (gas: 4108300) +TokenPoolFactoryTests:test_createTokenPool_ExistingRemoteToken_AndPredictPool_Success() (gas: 15388758) +TokenPoolFactoryTests:test_createTokenPool_WithNoExistingRemoteContracts_predict_Success() (gas: 15658396) +TokenPoolFactoryTests:test_createTokenPool_WithNoExistingTokenOnRemoteChain_Success() (gas: 5743209) +TokenPoolFactoryTests:test_createTokenPool_WithRemoteTokenAndRemotePool_Success() (gas: 5897047) +TokenPoolFactoryTests:test_updateRemoteChainConfig_Success() (gas: 86214) TokenPoolWithAllowList_applyAllowListUpdates:test_AllowListNotEnabled_Revert() (gas: 1979943) TokenPoolWithAllowList_applyAllowListUpdates:test_OnlyOwner_Revert() (gas: 12113) TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowListSkipsZero_Success() (gas: 23476) @@ -1019,9 +1019,9 @@ TokenProxy_getFee:test_GetFee_Success() (gas: 85240) USDCTokenPool__validateMessage:test_ValidateInvalidMessage_Revert() (gas: 25704) USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35481) USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30235) -USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133508) -USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 478182) -USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268672) +USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133525) +USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 478072) +USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268584) USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 50952) USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 98987) USDCTokenPool_setDomains:test_InvalidDomain_Revert() (gas: 66393) diff --git a/contracts/gas-snapshots/shared.gas-snapshot b/contracts/gas-snapshots/shared.gas-snapshot index 70b9ccc982..f563f05078 100644 --- a/contracts/gas-snapshots/shared.gas-snapshot +++ b/contracts/gas-snapshots/shared.gas-snapshot @@ -9,58 +9,58 @@ AuthorizedCallers_constructor:test_ZeroAddressNotAllowed_Revert() (gas: 64473) AuthorizedCallers_constructor:test_constructor_Success() (gas: 720513) BurnMintERC20_approve:testApproveSuccess() (gas: 55477) BurnMintERC20_approve:testInvalidAddressReverts() (gas: 10663) -BurnMintERC20_burn:testBasicBurnSuccess() (gas: 135064) +BurnMintERC20_burn:testBasicBurnSuccess() (gas: 173886) BurnMintERC20_burn:testBurnFromZeroAddressReverts() (gas: 47201) BurnMintERC20_burn:testExceedsBalanceReverts() (gas: 21819) -BurnMintERC20_burn:testSenderNotBurnerReverts() (gas: 32182) +BurnMintERC20_burn:testSenderNotBurnerReverts() (gas: 16739) BurnMintERC20_burnFrom:testBurnFromSuccess() (gas: 57957) BurnMintERC20_burnFrom:testExceedsBalanceReverts() (gas: 35916) BurnMintERC20_burnFrom:testInsufficientAllowanceReverts() (gas: 21914) -BurnMintERC20_burnFrom:testSenderNotBurnerReverts() (gas: 32182) +BurnMintERC20_burnFrom:testSenderNotBurnerReverts() (gas: 16739) BurnMintERC20_burnFromAlias:testBurnFromSuccess() (gas: 57932) BurnMintERC20_burnFromAlias:testExceedsBalanceReverts() (gas: 35880) BurnMintERC20_burnFromAlias:testInsufficientAllowanceReverts() (gas: 21869) -BurnMintERC20_burnFromAlias:testSenderNotBurnerReverts() (gas: 32137) -BurnMintERC20_constructor:testConstructorSuccess() (gas: 1737298) +BurnMintERC20_burnFromAlias:testSenderNotBurnerReverts() (gas: 16694) +BurnMintERC20_constructor:testConstructorSuccess() (gas: 1600593) BurnMintERC20_decreaseApproval:testDecreaseApprovalSuccess() (gas: 31123) BurnMintERC20_grantMintAndBurnRoles:testGrantMintAndBurnRolesSuccess() (gas: 121170) BurnMintERC20_grantRole:testGrantBurnAccessSuccess() (gas: 53407) -BurnMintERC20_grantRole:testGrantManySuccess() (gas: 957680) +BurnMintERC20_grantRole:testGrantManySuccess() (gas: 944594) BurnMintERC20_grantRole:testGrantMintAccessSuccess() (gas: 94200) BurnMintERC20_increaseApproval:testIncreaseApprovalSuccess() (gas: 44121) -BurnMintERC20_mint:testBasicMintSuccess() (gas: 52689) +BurnMintERC20_mint:testBasicMintSuccess() (gas: 149743) BurnMintERC20_mint:testMaxSupplyExceededReverts() (gas: 50429) -BurnMintERC20_mint:testSenderNotMinterReverts() (gas: 30039) +BurnMintERC20_mint:testSenderNotMinterReverts() (gas: 14596) BurnMintERC20_supportsInterface:testConstructorSuccess() (gas: 11123) BurnMintERC20_transfer:testInvalidAddressReverts() (gas: 10661) BurnMintERC20_transfer:testTransferSuccess() (gas: 42277) -BurnMintERC677_approve:testApproveSuccess() (gas: 55512) +BurnMintERC677_approve:testApproveSuccess() (gas: 55477) BurnMintERC677_approve:testInvalidAddressReverts() (gas: 10663) -BurnMintERC677_burn:testBasicBurnSuccess() (gas: 173939) -BurnMintERC677_burn:testBurnFromZeroAddressReverts() (gas: 47201) +BurnMintERC677_burn:testBasicBurnSuccess() (gas: 173904) +BurnMintERC677_burn:testBurnFromZeroAddressReverts() (gas: 47223) BurnMintERC677_burn:testExceedsBalanceReverts() (gas: 21841) -BurnMintERC677_burn:testSenderNotBurnerReverts() (gas: 13359) -BurnMintERC677_burnFrom:testBurnFromSuccess() (gas: 57923) -BurnMintERC677_burnFrom:testExceedsBalanceReverts() (gas: 35864) -BurnMintERC677_burnFrom:testInsufficientAllowanceReverts() (gas: 21849) -BurnMintERC677_burnFrom:testSenderNotBurnerReverts() (gas: 13359) -BurnMintERC677_burnFromAlias:testBurnFromSuccess() (gas: 57949) +BurnMintERC677_burn:testSenderNotBurnerReverts() (gas: 13424) +BurnMintERC677_burnFrom:testBurnFromSuccess() (gas: 57957) +BurnMintERC677_burnFrom:testExceedsBalanceReverts() (gas: 35916) +BurnMintERC677_burnFrom:testInsufficientAllowanceReverts() (gas: 21914) +BurnMintERC677_burnFrom:testSenderNotBurnerReverts() (gas: 13424) +BurnMintERC677_burnFromAlias:testBurnFromSuccess() (gas: 57932) BurnMintERC677_burnFromAlias:testExceedsBalanceReverts() (gas: 35880) BurnMintERC677_burnFromAlias:testInsufficientAllowanceReverts() (gas: 21869) BurnMintERC677_burnFromAlias:testSenderNotBurnerReverts() (gas: 13379) -BurnMintERC677_constructor:testConstructorSuccess() (gas: 1672809) -BurnMintERC677_decreaseApproval:testDecreaseApprovalSuccess() (gas: 31069) -BurnMintERC677_grantMintAndBurnRoles:testGrantMintAndBurnRolesSuccess() (gas: 121324) -BurnMintERC677_grantRole:testGrantBurnAccessSuccess() (gas: 53460) -BurnMintERC677_grantRole:testGrantManySuccess() (gas: 937759) -BurnMintERC677_grantRole:testGrantMintAccessSuccess() (gas: 94340) -BurnMintERC677_increaseApproval:testIncreaseApprovalSuccess() (gas: 44076) -BurnMintERC677_mint:testBasicMintSuccess() (gas: 149699) -BurnMintERC677_mint:testMaxSupplyExceededReverts() (gas: 50385) +BurnMintERC677_constructor:testConstructorSuccess() (gas: 1763863) +BurnMintERC677_decreaseApproval:testDecreaseApprovalSuccess() (gas: 31088) +BurnMintERC677_grantMintAndBurnRoles:testGrantMintAndBurnRolesSuccess() (gas: 121214) +BurnMintERC677_grantRole:testGrantBurnAccessSuccess() (gas: 53477) +BurnMintERC677_grantRole:testGrantManySuccess() (gas: 937980) +BurnMintERC677_grantRole:testGrantMintAccessSuccess() (gas: 94200) +BurnMintERC677_increaseApproval:testIncreaseApprovalSuccess() (gas: 44121) +BurnMintERC677_mint:testBasicMintSuccess() (gas: 149677) +BurnMintERC677_mint:testMaxSupplyExceededReverts() (gas: 50297) BurnMintERC677_mint:testSenderNotMinterReverts() (gas: 11195) -BurnMintERC677_supportsInterface:testConstructorSuccess() (gas: 12476) -BurnMintERC677_transfer:testInvalidAddressReverts() (gas: 10639) -BurnMintERC677_transfer:testTransferSuccess() (gas: 42299) +BurnMintERC677_supportsInterface:testConstructorSuccess() (gas: 12610) +BurnMintERC677_transfer:testInvalidAddressReverts() (gas: 10661) +BurnMintERC677_transfer:testTransferSuccess() (gas: 42277) CallWithExactGas__callWithExactGas:test_CallWithExactGasReceiverErrorSuccess() (gas: 67209) CallWithExactGas__callWithExactGas:test_CallWithExactGasSafeReturnDataExactGas() (gas: 18324) CallWithExactGas__callWithExactGas:test_NoContractReverts() (gas: 11559) @@ -101,11 +101,11 @@ EnumerableMapAddresses_set:testSetSuccess() (gas: 94685) EnumerableMapAddresses_tryGet:testBytes32TryGetSuccess() (gas: 94622) EnumerableMapAddresses_tryGet:testBytesTryGetSuccess() (gas: 96279) EnumerableMapAddresses_tryGet:testTryGetSuccess() (gas: 94893) -OpStackBurnMintERC677_constructor:testConstructorSuccess() (gas: 1743649) -OpStackBurnMintERC677_interfaceCompatibility:testBurnCompatibility() (gas: 298649) -OpStackBurnMintERC677_interfaceCompatibility:testMintCompatibility() (gas: 137957) +OpStackBurnMintERC677_constructor:testConstructorSuccess() (gas: 1829158) +OpStackBurnMintERC677_interfaceCompatibility:testBurnCompatibility() (gas: 298741) +OpStackBurnMintERC677_interfaceCompatibility:testMintCompatibility() (gas: 138155) OpStackBurnMintERC677_interfaceCompatibility:testStaticFunctionsCompatibility() (gas: 13781) -OpStackBurnMintERC677_supportsInterface:testConstructorSuccess() (gas: 12752) +OpStackBurnMintERC677_supportsInterface:testConstructorSuccess() (gas: 12814) SortedSetValidationUtil_CheckIsValidUniqueSubsetTest:test__checkIsValidUniqueSubset_EmptySubset_Reverts() (gas: 5460) SortedSetValidationUtil_CheckIsValidUniqueSubsetTest:test__checkIsValidUniqueSubset_EmptySuperset_Reverts() (gas: 4661) SortedSetValidationUtil_CheckIsValidUniqueSubsetTest:test__checkIsValidUniqueSubset_HasDuplicates_Reverts() (gas: 8265) diff --git a/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol b/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol index 9d2346996a..b6b3907124 100644 --- a/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol +++ b/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol @@ -4,15 +4,11 @@ pragma solidity 0.8.24; import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; import {IGetCCIPAdmin} from "../../interfaces/IGetCCIPAdmin.sol"; -contract BurnMintERC677Helper is BurnMintERC677, IGetCCIPAdmin { +contract BurnMintERC677Helper is BurnMintERC677 { constructor(string memory name, string memory symbol) BurnMintERC677(name, symbol, 18, 0) {} // Gives one full token to any given address. function drip(address to) external { _mint(to, 1e18); } - - function getCCIPAdmin() external view override returns (address) { - return owner(); - } } diff --git a/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol b/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol index 9645d70b7a..762e52a430 100644 --- a/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol +++ b/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.0; import {IPoolV1} from "../../interfaces/IPool.sol"; import {IPoolPriorTo1_5} from "../../interfaces/IPoolPriorTo1_5.sol"; +import {BurnMintERC20} from "../../../shared/token/ERC20/BurnMintERC20.sol"; import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; import {Router} from "../../Router.sol"; import {Client} from "../../libraries/Client.sol"; @@ -112,9 +113,9 @@ contract TokenPoolAndProxyMigration is EVM2EVMOnRampSetup { s_newPool.setPreviousPool(IPoolPriorTo1_5(address(0))); // The new pool is now active, but is has not been given permissions to burn/mint yet - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, address(s_newPool))); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotBurner.selector, address(s_newPool))); _ccipSend1_5(); - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotMinter.selector, address(s_newPool))); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotMinter.selector, address(s_newPool))); _fakeReleaseOrMintFromOffRamp1_5(); // When we do give burn/mint, the new pool is fully active @@ -176,9 +177,9 @@ contract TokenPoolAndProxyMigration is EVM2EVMOnRampSetup { s_newPool.setPreviousPool(IPoolPriorTo1_5(address(0))); // The new pool is now active, but is has not been given permissions to burn/mint yet - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, address(s_newPool))); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotBurner.selector, address(s_newPool))); _ccipSend1_5(); - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotMinter.selector, address(s_newPool))); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotMinter.selector, address(s_newPool))); _fakeReleaseOrMintFromOffRamp1_5(); // When we do give burn/mint, the new pool is fully active diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory.t.sol index a309713d2d..0494158dbc 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory.t.sol @@ -1,21 +1,19 @@ pragma solidity ^0.8.24; import {IOwner} from "../../interfaces/IOwner.sol"; +import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol"; +import {OwnerIsCreator} from "../../../shared/access/OwnerIsCreator.sol"; + +import {RateLimiter} from "../../libraries/RateLimiter.sol"; import {BurnMintTokenPool} from "../../pools/BurnMintTokenPool.sol"; import {TokenPool} from "../../pools/TokenPool.sol"; - +import {FactoryBurnMintERC20} from "../../tokenAdminRegistry/FactoryBurnMintERC20.sol"; +import {RegistryModuleOwnerCustom} from "../../tokenAdminRegistry/RegistryModuleOwnerCustom.sol"; import {TokenAdminRegistry} from "../../tokenAdminRegistry/TokenAdminRegistry.sol"; import {TokenPoolFactory} from "../../tokenAdminRegistry/TokenPoolFactory.sol"; - -import {RegistryModuleOwnerCustom} from "../../tokenAdminRegistry/RegistryModuleOwnerCustom.sol"; import {TokenAdminRegistrySetup} from "./TokenAdminRegistry.t.sol"; -import {RateLimiter} from "../../libraries/RateLimiter.sol"; - -import {OwnerIsCreator} from "../../../shared/access/OwnerIsCreator.sol"; -import {BurnMintERC20} from "../../../shared/token/ERC20/BurnMintERC20.sol"; - import {Create2} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Create2.sol"; contract TokenPoolFactorySetup is TokenAdminRegistrySetup { @@ -42,14 +40,13 @@ contract TokenPoolFactorySetup is TokenAdminRegistrySetup { s_registryModuleOwnerCustom = new RegistryModuleOwnerCustom(address(s_tokenAdminRegistry)); s_tokenAdminRegistry.addRegistryModule(address(s_registryModuleOwnerCustom)); - s_tokenPoolFactory = new TokenPoolFactory( - address(s_tokenAdminRegistry), address(s_registryModuleOwnerCustom), s_rmnProxy, address(s_sourceRouter) - ); + s_tokenPoolFactory = + new TokenPoolFactory(s_tokenAdminRegistry, s_registryModuleOwnerCustom, s_rmnProxy, address(s_sourceRouter)); // Create Init Code for BurnMintERC20 TestToken with 18 decimals and supply cap of max uint256 value s_tokenCreationParams = abi.encode("TestToken", "TT", 18, type(uint256).max, PREMINT_AMOUNT, OWNER); - s_tokenInitCode = abi.encodePacked(type(BurnMintERC20).creationCode, s_tokenCreationParams); + s_tokenInitCode = abi.encodePacked(type(FactoryBurnMintERC20).creationCode, s_tokenCreationParams); s_poolInitCode = type(BurnMintTokenPool).creationCode; @@ -66,9 +63,14 @@ contract TokenPoolFactoryTests is TokenPoolFactorySetup { function test_TokenPoolFactory_Constructor_Revert() public { // Revert cause the tokenAdminRegistry is address(0) vm.expectRevert(TokenPoolFactory.InvalidZeroAddress.selector); - new TokenPoolFactory(address(0), address(0), address(0), address(0)); + new TokenPoolFactory(ITokenAdminRegistry(address(0)), RegistryModuleOwnerCustom(address(0)), address(0), address(0)); - new TokenPoolFactory(address(0xdeadbeef), address(0xdeadbeef), address(0xdeadbeef), address(0xdeadbeef)); + new TokenPoolFactory( + ITokenAdminRegistry(address(0xdeadbeef)), + RegistryModuleOwnerCustom(address(0xdeadbeef)), + address(0xdeadbeef), + address(0xdeadbeef) + ); } function test_createTokenPool_WithNoExistingTokenOnRemoteChain_Success() public { @@ -116,9 +118,8 @@ contract TokenPoolFactoryTests is TokenPoolFactorySetup { RegistryModuleOwnerCustom newRegistryModule = new RegistryModuleOwnerCustom(address(newTokenAdminRegistry)); // We want to deploy a new factory and Owner Module. - TokenPoolFactory newTokenPoolFactory = new TokenPoolFactory( - address(newTokenAdminRegistry), address(newRegistryModule), s_rmnProxy, address(s_destRouter) - ); + TokenPoolFactory newTokenPoolFactory = + new TokenPoolFactory(newTokenAdminRegistry, newRegistryModule, s_rmnProxy, address(s_destRouter)); newTokenAdminRegistry.addRegistryModule(address(newRegistryModule)); @@ -207,7 +208,8 @@ contract TokenPoolFactoryTests is TokenPoolFactorySetup { vm.startPrank(OWNER); bytes32 dynamicSalt = keccak256(abi.encodePacked(FAKE_SALT, OWNER)); - BurnMintERC20 newRemoteToken = new BurnMintERC20("TestToken", "TT", 18, type(uint256).max, PREMINT_AMOUNT, OWNER); + FactoryBurnMintERC20 newRemoteToken = + new FactoryBurnMintERC20("TestToken", "TT", 18, type(uint256).max, PREMINT_AMOUNT, OWNER); // We have to create a new factory, registry module, and token admin registry to simulate the other chain @@ -215,9 +217,8 @@ contract TokenPoolFactoryTests is TokenPoolFactorySetup { RegistryModuleOwnerCustom newRegistryModule = new RegistryModuleOwnerCustom(address(newTokenAdminRegistry)); // We want to deploy a new factory and Owner Module. - TokenPoolFactory newTokenPoolFactory = new TokenPoolFactory( - address(newTokenAdminRegistry), address(newRegistryModule), s_rmnProxy, address(s_destRouter) - ); + TokenPoolFactory newTokenPoolFactory = + new TokenPoolFactory(newTokenAdminRegistry, newRegistryModule, s_rmnProxy, address(s_destRouter)); newTokenAdminRegistry.addRegistryModule(address(newRegistryModule)); diff --git a/contracts/src/v0.8/ccip/tokenAdminRegistry/FactoryBurnMintERC20.sol b/contracts/src/v0.8/ccip/tokenAdminRegistry/FactoryBurnMintERC20.sol new file mode 100644 index 0000000000..2d3bebe57b --- /dev/null +++ b/contracts/src/v0.8/ccip/tokenAdminRegistry/FactoryBurnMintERC20.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {BurnMintERC20} from "../../shared/token/ERC20/BurnMintERC20.sol"; + +/// @notice A basic ERC20 compatible token contract with burn and minting roles. +/// @dev The total supply can be limited during deployment. +contract FactoryBurnMintERC20 is BurnMintERC20 { + constructor( + string memory name, + string memory symbol, + uint8 decimals_, + uint256 maxSupply_, + uint256 preMint_, + address newOwner_ + ) BurnMintERC20(name, symbol, decimals_, maxSupply_) { + i_decimals = decimals_; + i_maxSupply = maxSupply_; + + s_ccipAdmin = newOwner_; + + // Mint the initial supply to the new Owner, saving gas by not calling if the mint amount is zero + if (preMint_ != 0) _mint(newOwner_, preMint_); + + // Grant the deployer the minter and burner roles. This contract is expected to be deployed by a factory + // contract that will transfer ownership to the correct address after deployment, so granting minting and burning + // privileges here saves gas by not requiring two transactions. + grantMintRole(newOwner_); + grantBurnRole(newOwner_); + } +} diff --git a/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenPoolFactory.sol b/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenPoolFactory.sol index 13bf738eb9..5055a1065f 100644 --- a/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenPoolFactory.sol +++ b/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenPoolFactory.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import {IOwnable} from "../../shared/interfaces/IOwnable.sol"; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; @@ -12,6 +12,9 @@ import {RegistryModuleOwnerCustom} from "./RegistryModuleOwnerCustom.sol"; import {Create2} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Create2.sol"; +/// @notice A contract for deploying new tokens and token pools, and configuring them with the token admin registry +/// @dev At the end of the transaction, the ownership transfer process will begin, but the user must accept the +/// ownership transfer in a separate transaction. contract TokenPoolFactory is OwnerIsCreator, ITypeAndVersion { using Create2 for bytes32; @@ -47,20 +50,25 @@ contract TokenPoolFactory is OwnerIsCreator, ITypeAndVersion { RemoteChainConfig remoteChainConfig; } - bytes4 public constant EMPTY_PARAMETER_FLAG = bytes4(keccak256("EMPTY_PARAMETER_FLAG")); string public constant typeAndVersion = "TokenPoolFactory 1.0.0-dev"; - ITokenAdminRegistry internal immutable i_tokenAdminRegistry; - RegistryModuleOwnerCustom internal immutable i_registryModuleOwnerCustom; + ITokenAdminRegistry private immutable i_tokenAdminRegistry; + RegistryModuleOwnerCustom private immutable i_registryModuleOwnerCustom; address private immutable i_rmnProxy; address private immutable i_ccipRouter; - mapping(uint64 remoteChainSelector => RemoteChainConfig remoteConfig) internal s_remoteChainConfigs; + mapping(uint64 remoteChainSelector => RemoteChainConfig remoteConfig) private s_remoteChainConfigs; - constructor(address tokenAdminRegistry, address tokenAdminModule, address rmnProxy, address ccipRouter) { + constructor( + ITokenAdminRegistry tokenAdminRegistry, + RegistryModuleOwnerCustom tokenAdminModule, + address rmnProxy, + address ccipRouter + ) { if ( - tokenAdminRegistry == address(0) || rmnProxy == address(0) || rmnProxy == address(0) || ccipRouter == address(0) + address(tokenAdminRegistry) == address(0) || address(tokenAdminModule) == address(0) || rmnProxy == address(0) + || ccipRouter == address(0) ) revert InvalidZeroAddress(); i_tokenAdminRegistry = ITokenAdminRegistry(tokenAdminRegistry); @@ -83,7 +91,7 @@ contract TokenPoolFactory is OwnerIsCreator, ITypeAndVersion { // Ensure a unique deployment between senders even if the same input parameter is used salt = keccak256(abi.encodePacked(salt, msg.sender)); - // Deploy the token + // Deploy the token. The constructor parameters are already provided in the tokenInitCode address token = Create2.deploy(0, salt, tokenInitCode); // Deploy the token pool @@ -141,12 +149,13 @@ contract TokenPoolFactory is OwnerIsCreator, ITypeAndVersion { bytes calldata tokenPoolInitCode, bytes memory tokenPoolInitArgs, bytes32 salt - ) internal returns (address) { + ) private returns (address) { // Create an array of chain updates to apply to the token pool TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](remoteTokenPools.length); + RemoteTokenPoolInfo memory remoteTokenPool; for (uint256 i = 0; i < remoteTokenPools.length; i++) { - RemoteTokenPoolInfo memory remoteTokenPool = remoteTokenPools[i]; + remoteTokenPool = remoteTokenPools[i]; RemoteChainConfig memory remoteChainConfig = s_remoteChainConfigs[remoteTokenPool.remoteChainSelector]; // If the user provides an empty byte string, indicated no token has already been deployed, @@ -218,7 +227,7 @@ contract TokenPoolFactory is OwnerIsCreator, ITypeAndVersion { /// the token pool will not be able to be set in the token admin registry, and this function will revert. /// @param token The address of the token to set the pool for /// @param pool The address of the pool to set in the token admin registry - function _setTokenPoolInTokenAdminRegistry(address token, address pool) internal { + function _setTokenPoolInTokenAdminRegistry(address token, address pool) private { i_registryModuleOwnerCustom.registerAdminViaOwner(token); i_tokenAdminRegistry.acceptAdminRole(token); i_tokenAdminRegistry.setPool(token, pool); diff --git a/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20.t.sol b/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20.t.sol index 964e918168..10143a7057 100644 --- a/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.4; import {IBurnMintERC20} from "../../../token/ERC20/IBurnMintERC20.sol"; @@ -24,7 +24,7 @@ contract BurnMintERC20Setup is BaseTest { function setUp() public virtual override { BaseTest.setUp(); - s_burnMintERC20 = new BurnMintERC20("Chainlink Token", "LINK", 18, s_maxSupply, 0, OWNER); + s_burnMintERC20 = new BurnMintERC20("Chainlink Token", "LINK", 18, s_maxSupply); // Set s_mockPool to be a burner and minter s_burnMintERC20.grantMintAndBurnRoles(s_mockPool); @@ -38,7 +38,7 @@ contract BurnMintERC20_constructor is BurnMintERC20Setup { string memory symbol = "LINK2"; uint8 decimals = 19; uint256 maxSupply = 1e33; - s_burnMintERC20 = new BurnMintERC20(name, symbol, decimals, maxSupply, 0, OWNER); + s_burnMintERC20 = new BurnMintERC20(name, symbol, decimals, maxSupply); assertEq(name, s_burnMintERC20.name()); assertEq(symbol, s_burnMintERC20.symbol()); diff --git a/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol b/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol index 2815f99256..9330a311cd 100644 --- a/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol @@ -6,6 +6,7 @@ import {IERC677} from "../../../token/ERC677/IERC677.sol"; import {BaseTest} from "../../BaseTest.t.sol"; import {BurnMintERC677} from "../../../token/ERC677/BurnMintERC677.sol"; +import {BurnMintERC20} from "../../../token/ERC20/BurnMintERC20.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/IERC165.sol"; @@ -106,7 +107,7 @@ contract BurnMintERC677_mint is BurnMintERC677Setup { // Revert function testSenderNotMinterReverts() public { - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotMinter.selector, OWNER)); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotMinter.selector, OWNER)); s_burnMintERC677.mint(STRANGER, 1e18); } @@ -117,7 +118,7 @@ contract BurnMintERC677_mint is BurnMintERC677Setup { s_burnMintERC677.mint(OWNER, s_burnMintERC677.maxSupply()); vm.expectRevert( - abi.encodeWithSelector(BurnMintERC677.MaxSupplyExceeded.selector, s_burnMintERC677.maxSupply() + 1) + abi.encodeWithSelector(BurnMintERC20.MaxSupplyExceeded.selector, s_burnMintERC677.maxSupply() + 1) ); // Attempt to mint 1 more than max supply @@ -141,7 +142,7 @@ contract BurnMintERC677_burn is BurnMintERC677Setup { // Revert function testSenderNotBurnerReverts() public { - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, OWNER)); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotBurner.selector, OWNER)); s_burnMintERC677.burnFrom(STRANGER, s_amount); } @@ -182,7 +183,7 @@ contract BurnMintERC677_burnFromAlias is BurnMintERC677Setup { // Reverts function testSenderNotBurnerReverts() public { - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, OWNER)); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotBurner.selector, OWNER)); s_burnMintERC677.burn(OWNER, s_amount); } @@ -224,7 +225,7 @@ contract BurnMintERC677_burnFrom is BurnMintERC677Setup { // Reverts function testSenderNotBurnerReverts() public { - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, OWNER)); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotBurner.selector, OWNER)); s_burnMintERC677.burnFrom(OWNER, s_amount); } diff --git a/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol b/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol index 614b3bea15..442382fb86 100644 --- a/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol @@ -6,6 +6,8 @@ import {IOptimismMintableERC20Minimal, IOptimismMintableERC20} from "../../../to import {IERC677} from "../../../token/ERC677/IERC677.sol"; import {BurnMintERC677} from "../../../token/ERC677/BurnMintERC677.sol"; +import {BurnMintERC20} from "../../../token/ERC20/BurnMintERC20.sol"; + import {BaseTest} from "../../BaseTest.t.sol"; import {OpStackBurnMintERC677} from "../../../token/ERC677/OpStackBurnMintERC677.sol"; @@ -66,7 +68,7 @@ contract OpStackBurnMintERC677_interfaceCompatibility is OpStackBurnMintERC677Se function testMintCompatibility() public { // Ensure roles work - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotMinter.selector, OWNER)); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotMinter.selector, OWNER)); s_opStackToken.mint(OWNER, 1); // Use the actual contract to grant mint @@ -87,7 +89,7 @@ contract OpStackBurnMintERC677_interfaceCompatibility is OpStackBurnMintERC677Se function testBurnCompatibility() public { // Ensure roles work - vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, OWNER)); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.SenderNotBurner.selector, OWNER)); s_opStackToken.burn(address(0x0), 1); // Use the actual contract to grant burn diff --git a/contracts/src/v0.8/shared/token/ERC20/BurnMintERC20.sol b/contracts/src/v0.8/shared/token/ERC20/BurnMintERC20.sol index 41d71c6f16..9b3fc56cc9 100644 --- a/contracts/src/v0.8/shared/token/ERC20/BurnMintERC20.sol +++ b/contracts/src/v0.8/shared/token/ERC20/BurnMintERC20.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; import {IBurnMintERC20} from "../ERC20/IBurnMintERC20.sol"; import {IOwnable} from "../../interfaces/IOwnable.sol"; +import {IGetCCIPAdmin} from "../../../ccip/interfaces/IGetCCIPAdmin.sol"; import {OwnerIsCreator} from "../../access/OwnerIsCreator.sol"; @@ -14,7 +15,7 @@ import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.8.3/contra /// @notice A basic ERC20 compatible token contract with burn and minting roles. /// @dev The total supply can be limited during deployment. -contract BurnMintERC20 is IBurnMintERC20, IERC165, ERC20Burnable, OwnerIsCreator { +contract BurnMintERC20 is IBurnMintERC20, IGetCCIPAdmin, IERC165, ERC20Burnable, OwnerIsCreator { using EnumerableSet for EnumerableSet.AddressSet; error SenderNotMinter(address sender); @@ -47,23 +48,12 @@ contract BurnMintERC20 is IBurnMintERC20, IERC165, ERC20Burnable, OwnerIsCreator string memory name, string memory symbol, uint8 decimals_, - uint256 maxSupply_, - uint256 preMint_, - address newOwner_ + uint256 maxSupply_ ) ERC20(name, symbol) { i_decimals = decimals_; i_maxSupply = maxSupply_; - s_ccipAdmin = newOwner_; - - // Mint the initial supply to the new Owner, saving gas by not calling if the mint amount is zero - if (preMint_ != 0) _mint(newOwner_, preMint_); - - // Grant the deployer the minter and burner roles. This contract is expected to be deployed by a factory - // contract that will transfer ownership to the correct address after deployment, so granting minting and burning - // privileges here saves gas by not requiring two transactions. - grantMintRole(newOwner_); - grantBurnRole(newOwner_); + s_ccipAdmin = msg.sender; } function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { diff --git a/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol b/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol index 24573f3057..f565aefeae 100644 --- a/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol +++ b/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol @@ -1,217 +1,35 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IBurnMintERC20} from "../ERC20/IBurnMintERC20.sol"; import {IERC677} from "./IERC677.sol"; +import {IERC677Receiver} from "../../interfaces/IERC677Receiver.sol"; -import {ERC677} from "./ERC677.sol"; -import {OwnerIsCreator} from "../../access/OwnerIsCreator.sol"; - -import {ERC20Burnable} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/ERC20Burnable.sol"; -import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableSet.sol"; -import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/IERC165.sol"; -import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {BurnMintERC20} from "../ERC20/BurnMintERC20.sol"; /// @notice A basic ERC677 compatible token contract with burn and minting roles. /// @dev The total supply can be limited during deployment. -contract BurnMintERC677 is IBurnMintERC20, ERC677, IERC165, ERC20Burnable, OwnerIsCreator { - using EnumerableSet for EnumerableSet.AddressSet; - - error SenderNotMinter(address sender); - error SenderNotBurner(address sender); - error MaxSupplyExceeded(uint256 supplyAfterMint); - - event MintAccessGranted(address indexed minter); - event BurnAccessGranted(address indexed burner); - event MintAccessRevoked(address indexed minter); - event BurnAccessRevoked(address indexed burner); - - // @dev the allowed minter addresses - EnumerableSet.AddressSet internal s_minters; - // @dev the allowed burner addresses - EnumerableSet.AddressSet internal s_burners; +contract BurnMintERC677 is BurnMintERC20, IERC677 { - /// @dev The number of decimals for the token - uint8 internal immutable i_decimals; - - /// @dev The maximum supply of the token, 0 if unlimited - uint256 internal immutable i_maxSupply; - - constructor(string memory name, string memory symbol, uint8 decimals_, uint256 maxSupply_) ERC677(name, symbol) { - i_decimals = decimals_; - i_maxSupply = maxSupply_; - } + constructor(string memory name, string memory symbol, uint8 decimals_, uint256 maxSupply_) BurnMintERC20(name, symbol, + decimals_, maxSupply_) {} function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { return - interfaceId == type(IERC20).interfaceId || interfaceId == type(IERC677).interfaceId || - interfaceId == type(IBurnMintERC20).interfaceId || - interfaceId == type(IERC165).interfaceId; - } - - // ================================================================ - // | ERC20 | - // ================================================================ - - /// @dev Returns the number of decimals used in its user representation. - function decimals() public view virtual override returns (uint8) { - return i_decimals; - } - - /// @dev Returns the max supply of the token, 0 if unlimited. - function maxSupply() public view virtual returns (uint256) { - return i_maxSupply; - } - - /// @dev Uses OZ ERC20 _transfer to disallow sending to address(0). - /// @dev Disallows sending to address(this) - function _transfer(address from, address to, uint256 amount) internal virtual override validAddress(to) { - super._transfer(from, to, amount); + super.supportsInterface(interfaceId); } - /// @dev Uses OZ ERC20 _approve to disallow approving for address(0). - /// @dev Disallows approving for address(this) - function _approve(address owner, address spender, uint256 amount) internal virtual override validAddress(spender) { - super._approve(owner, spender, amount); - } - - /// @dev Exists to be backwards compatible with the older naming convention. - function decreaseApproval(address spender, uint256 subtractedValue) external returns (bool success) { - return decreaseAllowance(spender, subtractedValue); - } - - /// @dev Exists to be backwards compatible with the older naming convention. - function increaseApproval(address spender, uint256 addedValue) external { - increaseAllowance(spender, addedValue); - } - - /// @notice Check if recipient is valid (not this contract address). - /// @param recipient the account we transfer/approve to. - /// @dev Reverts with an empty revert to be compatible with the existing link token when - /// the recipient is this contract address. - modifier validAddress(address recipient) virtual { - // solhint-disable-next-line reason-string, gas-custom-errors - if (recipient == address(this)) revert(); - _; - } - - // ================================================================ - // | Burning & minting | - // ================================================================ - - /// @inheritdoc ERC20Burnable - /// @dev Uses OZ ERC20 _burn to disallow burning from address(0). - /// @dev Decreases the total supply. - function burn(uint256 amount) public override(IBurnMintERC20, ERC20Burnable) onlyBurner { - super.burn(amount); - } - - /// @inheritdoc IBurnMintERC20 - /// @dev Alias for BurnFrom for compatibility with the older naming convention. - /// @dev Uses burnFrom for all validation & logic. - function burn(address account, uint256 amount) public virtual override { - burnFrom(account, amount); - } - - /// @inheritdoc ERC20Burnable - /// @dev Uses OZ ERC20 _burn to disallow burning from address(0). - /// @dev Decreases the total supply. - function burnFrom(address account, uint256 amount) public override(IBurnMintERC20, ERC20Burnable) onlyBurner { - super.burnFrom(account, amount); - } - - /// @inheritdoc IBurnMintERC20 - /// @dev Uses OZ ERC20 _mint to disallow minting to address(0). - /// @dev Disallows minting to address(this) - /// @dev Increases the total supply. - function mint(address account, uint256 amount) external override onlyMinter validAddress(account) { - if (i_maxSupply != 0 && totalSupply() + amount > i_maxSupply) revert MaxSupplyExceeded(totalSupply() + amount); - - _mint(account, amount); - } - - // ================================================================ - // | Roles | - // ================================================================ - - /// @notice grants both mint and burn roles to `burnAndMinter`. - /// @dev calls public functions so this function does not require - /// access controls. This is handled in the inner functions. - function grantMintAndBurnRoles(address burnAndMinter) external { - grantMintRole(burnAndMinter); - grantBurnRole(burnAndMinter); - } - - /// @notice Grants mint role to the given address. - /// @dev only the owner can call this function. - function grantMintRole(address minter) public onlyOwner { - if (s_minters.add(minter)) { - emit MintAccessGranted(minter); + /// @inheritdoc IERC677 + /// @dev This function has been duplicated from ERC677.sol since functionality cannot be inherited due to + /// dual imports of ERC20 with BurnMintERC20.sol + function transferAndCall(address to, uint256 amount, bytes memory data) public returns (bool success) { + super.transfer(to, amount); + emit Transfer(msg.sender, to, amount, data); + if (to.code.length > 0) { + IERC677Receiver(to).onTokenTransfer(msg.sender, amount, data); } + return true; } - /// @notice Grants burn role to the given address. - /// @dev only the owner can call this function. - function grantBurnRole(address burner) public onlyOwner { - if (s_burners.add(burner)) { - emit BurnAccessGranted(burner); - } - } - /// @notice Revokes mint role for the given address. - /// @dev only the owner can call this function. - function revokeMintRole(address minter) public onlyOwner { - if (s_minters.remove(minter)) { - emit MintAccessRevoked(minter); - } - } - - /// @notice Revokes burn role from the given address. - /// @dev only the owner can call this function - function revokeBurnRole(address burner) public onlyOwner { - if (s_burners.remove(burner)) { - emit BurnAccessRevoked(burner); - } - } - - /// @notice Returns all permissioned minters - function getMinters() public view returns (address[] memory) { - return s_minters.values(); - } - - /// @notice Returns all permissioned burners - function getBurners() public view returns (address[] memory) { - return s_burners.values(); - } - - // ================================================================ - // | Access | - // ================================================================ - - /// @notice Checks whether a given address is a minter for this token. - /// @return true if the address is allowed to mint. - function isMinter(address minter) public view returns (bool) { - return s_minters.contains(minter); - } - - /// @notice Checks whether a given address is a burner for this token. - /// @return true if the address is allowed to burn. - function isBurner(address burner) public view returns (bool) { - return s_burners.contains(burner); - } - - /// @notice Checks whether the msg.sender is a permissioned minter for this token - /// @dev Reverts with a SenderNotMinter if the check fails - modifier onlyMinter() { - if (!isMinter(msg.sender)) revert SenderNotMinter(msg.sender); - _; - } - - /// @notice Checks whether the msg.sender is a permissioned burner for this token - /// @dev Reverts with a SenderNotBurner if the check fails - modifier onlyBurner() { - if (!isBurner(msg.sender)) revert SenderNotBurner(msg.sender); - _; - } }