From c3276bd42444490fa695b828a114a868986ef3cf Mon Sep 17 00:00:00 2001 From: Chanh Le Date: Wed, 8 May 2024 15:57:13 -0400 Subject: [PATCH] fix: `testNotOwnerEnrollRouter` (#3670) ### Description This PR fixes solidity's `testNotOwnerEnrollRouter`. ### Drive-by changes Only the unit test `testNotOwnerEnrollRouter`. --- solidity/.gas-snapshot | 364 ++++++++++++++++++++++++++++--------- solidity/test/Router.t.sol | 1 + 2 files changed, 276 insertions(+), 89 deletions(-) diff --git a/solidity/.gas-snapshot b/solidity/.gas-snapshot index 0006920fb..2eb886c78 100644 --- a/solidity/.gas-snapshot +++ b/solidity/.gas-snapshot @@ -1,91 +1,277 @@ -AggregationIsmTest:testModulesAndThreshold(uint8,uint8,bytes32) (runs: 256, μ: 1556428, ~: 1334785) -AggregationIsmTest:testVerify(uint8,uint8,bytes32) (runs: 256, μ: 1581057, ~: 1358996) -AggregationIsmTest:testVerifyIncorrectMetadata(uint8,uint8,bytes32) (runs: 256, μ: 1580974, ~: 1359683) -AggregationIsmTest:testVerifyMissingMetadata(uint8,uint8,bytes32) (runs: 256, μ: 1573730, ~: 1351998) -AggregationIsmTest:testVerifyNoMetadataRequired(uint8,uint8,uint8,bytes32) (runs: 256, μ: 1722168, ~: 1325061) -DomainRoutingIsmTest:testRoute(uint32,bytes32) (runs: 256, μ: 435158, ~: 435236) -DomainRoutingIsmTest:testSet(uint32) (runs: 256, μ: 421157, ~: 421157) -DomainRoutingIsmTest:testSetManyViaFactory(uint8,uint32) (runs: 256, μ: 40359815, ~: 29407180) -DomainRoutingIsmTest:testSetNonOwner(uint32,address) (runs: 256, μ: 11298, ~: 11298) -DomainRoutingIsmTest:testVerify(uint32,bytes32) (runs: 256, μ: 441253, ~: 441331) -DomainRoutingIsmTest:testVerifyNoIsm(uint32,bytes32) (runs: 256, μ: 444212, ~: 444212) -GasRouterTest:testDispatchWithGas(uint256) (runs: 256, μ: 347585, ~: 347585) -GasRouterTest:testQuoteGasPayment(uint256) (runs: 256, μ: 85818, ~: 85818) -GasRouterTest:testSetDestinationGas(uint256) (runs: 256, μ: 73808, ~: 75985) -InterchainAccountRouterTest:testCallRemoteWithDefault(bytes32) (runs: 256, μ: 555673, ~: 556140) -InterchainAccountRouterTest:testCallRemoteWithFailingDefaultIsm(bytes32) (runs: 256, μ: 601813, ~: 602824) -InterchainAccountRouterTest:testCallRemoteWithFailingIsmOverride(bytes32) (runs: 256, μ: 619172, ~: 620105) -InterchainAccountRouterTest:testCallRemoteWithOverrides(bytes32) (runs: 256, μ: 460466, ~: 460933) -InterchainAccountRouterTest:testCallRemoteWithoutDefaults(bytes32) (runs: 256, μ: 20418, ~: 20418) -InterchainAccountRouterTest:testConstructor() (gas: 2577062) -InterchainAccountRouterTest:testEnrollRemoteRouterAndIsm(bytes32,bytes32) (runs: 256, μ: 109207, ~: 109207) -InterchainAccountRouterTest:testEnrollRemoteRouterAndIsmImmutable(bytes32,bytes32,bytes32,bytes32) (runs: 256, μ: 106926, ~: 106926) -InterchainAccountRouterTest:testEnrollRemoteRouterAndIsmNonOwner(address,bytes32,bytes32) (runs: 256, μ: 20313, ~: 20313) -InterchainAccountRouterTest:testEnrollRemoteRouters(uint8,uint32,bytes32) (runs: 256, μ: 4050183, ~: 3316983) -InterchainAccountRouterTest:testGetLocalInterchainAccount(bytes32) (runs: 256, μ: 468785, ~: 469252) -InterchainAccountRouterTest:testGetRemoteInterchainAccount() (gas: 120253) -InterchainAccountRouterTest:testOverrideAndCallRemote(bytes32) (runs: 256, μ: 555674, ~: 556141) -InterchainAccountRouterTest:testReceiveValue(uint256) (runs: 256, μ: 109672, ~: 109672) -InterchainAccountRouterTest:testSendValue(uint256) (runs: 256, μ: 484762, ~: 484840) -InterchainAccountRouterTest:testSingleCallRemoteWithDefault(bytes32) (runs: 256, μ: 556324, ~: 556791) -InterchainGasPaymasterTest:testClaim() (gas: 90675) -InterchainGasPaymasterTest:testConstructorSetsBeneficiary() (gas: 7648) -InterchainGasPaymasterTest:testGetExchangeRateAndGasPrice() (gas: 41743) -InterchainGasPaymasterTest:testGetExchangeRateAndGasPriceRevertsIfNoGasOracleSet() (gas: 10837) -InterchainGasPaymasterTest:testInitializeRevertsIfCalledTwice() (gas: 11087) -InterchainGasPaymasterTest:testPayForGas() (gas: 92812) -InterchainGasPaymasterTest:testPayForGasRevertsIfPaymentInsufficient() (gas: 44808) -InterchainGasPaymasterTest:testQuoteGasPaymentRemoteVeryCheap() (gas: 41751) -InterchainGasPaymasterTest:testQuoteGasPaymentRemoteVeryExpensive() (gas: 41731) -InterchainGasPaymasterTest:testQuoteGasPaymentRevertsIfNoGasOracleSet() (gas: 10803) -InterchainGasPaymasterTest:testQuoteGasPaymentSimilarExchangeRate() (gas: 41796) -InterchainGasPaymasterTest:testSetBeneficiary() (gas: 18694) -InterchainGasPaymasterTest:testSetBeneficiaryRevertsIfNotOwner() (gas: 11033) -InterchainGasPaymasterTest:testSetGasOracle() (gas: 40459) -InterchainGasPaymasterTest:testSetGasOracleRevertsIfNotOwner() (gas: 13783) -InterchainQueryRouterTest:testCannotCallbackReverting() (gas: 1372627) -InterchainQueryRouterTest:testCannotQueryReverting() (gas: 1094371) -InterchainQueryRouterTest:testQueryAddress(address) (runs: 256, μ: 1383752, ~: 1383830) -InterchainQueryRouterTest:testQueryUint256(uint256) (runs: 256, μ: 1566435, ~: 1567679) -InterchainQueryRouterTest:testSingleQueryAddress(address) (runs: 256, μ: 1383789, ~: 1383867) -LiquidityLayerRouterTest:testCannotSendToRecipientWithoutHandle() (gas: 646167) -LiquidityLayerRouterTest:testDispatchWithTokenTransfersMovesTokens() (gas: 513057) -LiquidityLayerRouterTest:testDispatchWithTokensCallsAdapter() (gas: 519167) -LiquidityLayerRouterTest:testDispatchWithTokensRevertsWithFailedTransferIn() (gas: 29596) -LiquidityLayerRouterTest:testDispatchWithTokensRevertsWithUnkownBridgeAdapter() (gas: 20663) -LiquidityLayerRouterTest:testDispatchWithTokensTransfersOnDestination() (gas: 745139) -LiquidityLayerRouterTest:testProcessingRevertsIfBridgeAdapterReverts() (gas: 578662) -LiquidityLayerRouterTest:testSendToRecipientWithoutHandleWhenSpecifyingNoMessage() (gas: 1161102) -LiquidityLayerRouterTest:testSetLiquidityLayerAdapter() (gas: 23363) -MerkleRootMultisigIsmTest:testFailVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 256, μ: 336856, ~: 330762) -MerkleRootMultisigIsmTest:testVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 256, μ: 339564, ~: 331597) -MessageIdMultisigIsmTest:testFailVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 256, μ: 312768, ~: 307238) -MessageIdMultisigIsmTest:testVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 256, μ: 314834, ~: 307097) -MessagingTest:testSendMessage(string) (runs: 256, μ: 263049, ~: 278203) -OverheadIgpTest:testDestinationGasAmount() (gas: 33814) -OverheadIgpTest:testDestinationGasAmountWhenOverheadNotSet() (gas: 7912) -OverheadIgpTest:testInnerIgpSet() (gas: 7632) -OverheadIgpTest:testPayForGas() (gas: 65328) -OverheadIgpTest:testQuoteGasPayment() (gas: 42768) -OverheadIgpTest:testSetDestinationGasAmounts() (gas: 63435) -OverheadIgpTest:testSetDestinationGasAmountsNotOwner() (gas: 12018) -PausableReentrancyGuardTest:testNonreentrant() (gas: 9628) -PausableReentrancyGuardTest:testNonreentrantNotPaused() (gas: 14163) -PausableReentrancyGuardTest:testPause() (gas: 13635) -PortalAdapterTest:testAdapter(uint256) (runs: 256, μ: 135466, ~: 135583) -PortalAdapterTest:testReceivingRevertsWithoutTransferCompletion(uint256) (runs: 256, μ: 140405, ~: 140522) -PortalAdapterTest:testReceivingWorks(uint256) (runs: 256, μ: 229401, ~: 229513) -StorageGasOracleTest:testConstructorSetsOwnership() (gas: 7611) -StorageGasOracleTest:testGetExchangeRateAndGasPrice() (gas: 12456) +AggregationHookTest:testHookType() (gas: 319874) +AggregationHookTest:testMetadata(uint8) (runs: 264, μ: 20752667, ~: 7535833) +AggregationHookTest:testPostDispatch(uint8) (runs: 264, μ: 23810393, ~: 8594061) +AggregationHookTest:testPostDispatch_reverts_outOfFund(uint8,uint8) (runs: 259, μ: 37093348, ~: 44184778) +AggregationHookTest:testQuoteDispatch(uint8) (runs: 264, μ: 20867910, ~: 7577493) +AggregationIsmTest:testModulesAndThreshold(uint8,uint8,bytes32) (runs: 258, μ: 1583362, ~: 1364904) +AggregationIsmTest:testVerify(uint8,uint8,bytes32) (runs: 258, μ: 1575553, ~: 1359715) +AggregationIsmTest:testVerifyIncorrectMetadata(uint8,uint8,bytes32) (runs: 258, μ: 1575478, ~: 1360125) +AggregationIsmTest:testVerifyMissingMetadata(uint8,uint8,bytes32) (runs: 258, μ: 1568486, ~: 1352936) +AggregationIsmTest:testVerifyNoMetadataRequired(uint8,uint8,uint8,bytes32) (runs: 256, μ: 1723133, ~: 1325776) +DefaultFallbackRoutingIsmTest:testConstructorReverts() (gas: 39561) +DefaultFallbackRoutingIsmTest:testRemove(uint32) (runs: 264, μ: 414644, ~: 414516) +DefaultFallbackRoutingIsmTest:testRoute(uint32,bytes32) (runs: 264, μ: 500405, ~: 501461) +DefaultFallbackRoutingIsmTest:testSet(uint32) (runs: 264, μ: 479026, ~: 480157) +DefaultFallbackRoutingIsmTest:testSetManyViaFactory(uint8,uint32) (runs: 263, μ: 43014488, ~: 27800901) +DefaultFallbackRoutingIsmTest:testSetNonOwner(uint32,address) (runs: 264, μ: 11319, ~: 11319) +DefaultFallbackRoutingIsmTest:testVerify(uint32,bytes32) (runs: 264, μ: 509956, ~: 511012) +DefaultFallbackRoutingIsmTest:testVerifyNoIsm(uint32,bytes32) (runs: 264, μ: 530932, ~: 530932) +DomainRoutingHookTest:testHookType() (gas: 5442) +DomainRoutingHookTest:test_postDispatch(uint32,bytes32,bytes,bytes) (runs: 264, μ: 78385, ~: 78332) +DomainRoutingHookTest:test_postDispatch_whenDestinationUnenrolled(uint32,bytes32,bytes,bytes) (runs: 264, μ: 24757, ~: 24606) +DomainRoutingHookTest:test_quoteDispatch(uint32,bytes32,bytes,bytes,uint256) (runs: 264, μ: 77686, ~: 78852) +DomainRoutingHookTest:test_quoteDispatch_whenDestinationUnenrolled(uint32,bytes32,bytes,bytes,uint256) (runs: 264, μ: 24780, ~: 24665) +DomainRoutingIsmTest:testRemove(uint32) (runs: 264, μ: 414603, ~: 414471) +DomainRoutingIsmTest:testRoute(uint32,bytes32) (runs: 264, μ: 501454, ~: 502439) +DomainRoutingIsmTest:testSet(uint32) (runs: 264, μ: 479936, ~: 481090) +DomainRoutingIsmTest:testSetManyViaFactory(uint8,uint32) (runs: 263, μ: 45052230, ~: 23704905) +DomainRoutingIsmTest:testSetNonOwner(uint32,address) (runs: 264, μ: 11252, ~: 11252) +DomainRoutingIsmTest:testVerify(uint32,bytes32) (runs: 264, μ: 512155, ~: 513057) +DomainRoutingIsmTest:testVerifyNoIsm(uint32,bytes32) (runs: 264, μ: 515319, ~: 515092) +ERC5164IsmTest:testTypes() (gas: 10833) +ERC5164IsmTest:test_constructor() (gas: 276193) +ERC5164IsmTest:test_postDispatch() (gas: 67140) +ERC5164IsmTest:test_postDispatch_RevertWhen_ChainIDNotSupported() (gas: 67978) +ERC5164IsmTest:test_postDispatch_RevertWhen_msgValueNotAllowed() (gas: 58207) +ERC5164IsmTest:test_verify() (gas: 49951) +ERC5164IsmTest:test_verifyMessageId() (gas: 37576) +ERC5164IsmTest:test_verifyMessageId_RevertWhen_NotAuthorized() (gas: 13332) +ERC5164IsmTest:test_verify_RevertWhen_InvalidMessage() (gas: 49142) +FallbackDomainRoutingHookTest:testHookType() (gas: 5465) +FallbackDomainRoutingHookTest:test_postDispatch(uint32,bytes32,bytes,bytes) (runs: 264, μ: 77047, ~: 76769) +FallbackDomainRoutingHookTest:test_postDispatch_whenDestinationUnenrolled(uint32,bytes32,bytes,bytes) (runs: 264, μ: 53652, ~: 53374) +FallbackDomainRoutingHookTest:test_quoteDispatch(uint32,bytes32,bytes,bytes,uint256) (runs: 264, μ: 76395, ~: 77404) +FallbackDomainRoutingHookTest:test_quoteDispatch_whenDestinationUnenrolled(uint32,bytes32,bytes,bytes,uint256) (runs: 264, μ: 53005, ~: 54014) +GasRouterTest:testDispatch(uint256) (runs: 263, μ: 451401, ~: 451401) +GasRouterTest:testQuoteGasPayment(uint256) (runs: 262, μ: 126480, ~: 126480) +GasRouterTest:testSetDestinationGas(uint256) (runs: 264, μ: 62359, ~: 64470) +HypERC20CollateralTest:testBenchmark_overheadGasUsage() (gas: 56236) +HypERC20CollateralTest:testInitialize_revert_ifAlreadyInitialized() (gas: 187) +HypERC20CollateralTest:testRemoteTransfer() (gas: 202605) +HypERC20CollateralTest:testRemoteTransfer_invalidAllowance() (gas: 79760) +HypERC20CollateralTest:testRemoteTransfer_withCustomGasConfig() (gas: 276155) +HypERC20CollateralTest:testTransfer_withHookSpecified() (gas: 187232) +HypERC20CollateralVaultDepositTest:testBenchmark_overheadGasUsage() (gas: 306868) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_deposits_intoVault(uint256) (runs: 264, μ: 338485, ~: 344840) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_sweep_excessShares12312(uint256) (runs: 264, μ: 403235, ~: 403320) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_sweep_excessSharesMultipleDeposit(uint256) (runs: 264, μ: 550347, ~: 550497) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_sweep_noExcessShares(uint256) (runs: 264, μ: 366470, ~: 372825) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_sweep_revertNonOwner(uint256) (runs: 264, μ: 396450, ~: 396596) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_withdraws_fromVault(uint256) (runs: 264, μ: 425998, ~: 429613) +HypERC20CollateralVaultDepositTest:testERC4626VaultDeposit_RemoteTransfer_withdraws_lessShares(uint256) (runs: 264, μ: 399801, ~: 399945) +HypERC20CollateralVaultDepositTest:testTransfer_withHookSpecified() (gas: 296040) +HypERC20Test:testBenchmark_overheadGasUsage() (gas: 58924) +HypERC20Test:testDecimals() (gas: 12616) +HypERC20Test:testInitialize_revert_ifAlreadyInitialized() (gas: 24085) +HypERC20Test:testLocalTransfers() (gas: 51917) +HypERC20Test:testRemoteTransfer() (gas: 201085) +HypERC20Test:testRemoteTransfer_invalidAmount() (gas: 88689) +HypERC20Test:testRemoteTransfer_withCustomGasConfig() (gas: 254519) +HypERC20Test:testTotalSupply() (gas: 14717) +HypERC20Test:testTransfer_withHookSpecified() (gas: 209709) +HypERC721CollateralTest:testBenchmark_overheadGasUsage() (gas: 92150) +HypERC721CollateralTest:testInitialize_revert_ifAlreadyInitialized() (gas: 165) +HypERC721CollateralTest:testRemoteTransfer(bool) (runs: 264, μ: 4076396, ~: 4849034) +HypERC721CollateralTest:testRemoteTransfer_revert_invalidTokenId() (gas: 4708073) +HypERC721CollateralTest:testRemoteTransfer_revert_unowned() (gas: 4779020) +HypERC721CollateralURIStorageTest:testBenchmark_overheadGasUsage() (gas: 85000) +HypERC721CollateralURIStorageTest:testRemoteTransfers_revert_burned() (gas: 4848986) +HypERC721Test:testBenchmark_overheadGasUsage() (gas: 151235) +HypERC721Test:testInitialize_revert_ifAlreadyInitialized() (gas: 20042) +HypERC721Test:testLocalTransfer() (gas: 82548) +HypERC721Test:testLocalYTransfer_revert_invalidTokenId() (gas: 17998) +HypERC721Test:testOwnerOf() (gas: 14951) +HypERC721Test:testRemoteTransfer(bool) (runs: 264, μ: 4061653, ~: 4834291) +HypERC721Test:testRemoteTransfer_revert_invalidTokenId() (gas: 4701257) +HypERC721Test:testRemoteTransfer_revert_unowned() (gas: 4764152) +HypERC721Test:testTotalSupply() (gas: 15024) +HypERC721URIStorageTest:testBenchmark_overheadGasUsage() (gas: 148168) +HypERC721URIStorageTest:testRemoteTransfers_revert_burned() (gas: 4832405) +HypNativeScaledTest:test_constructor() (gas: 14718) +HypNativeScaledTest:test_handle(uint256) (runs: 259, μ: 398794, ~: 403823) +HypNativeScaledTest:test_handle_reverts_whenAmountExceedsSupply(uint256) (runs: 259, μ: 367852, ~: 369833) +HypNativeScaledTest:test_receive(uint256) (runs: 261, μ: 24653, ~: 25167) +HypNativeScaledTest:test_tranferRemote(uint256) (runs: 259, μ: 397622, ~: 402381) +HypNativeScaledTest:test_transferRemote_reverts_whenAmountExceedsValue(uint256) (runs: 261, μ: 24533, ~: 25047) +HypNativeTest:testBenchmark_overheadGasUsage() (gas: 54702) +HypNativeTest:testInitialize_revert_ifAlreadyInitialized() (gas: 165) +HypNativeTest:testRemoteTransfer() (gas: 178831) +HypNativeTest:testRemoteTransfer_invalidAmount() (gas: 74686) +HypNativeTest:testRemoteTransfer_withCustomGasConfig() (gas: 245800) +HypNativeTest:testTransfer_withHookSpecified() (gas: 190418) +InterchainAccountRouterTest:testFuzz_callRemoteWithDefault(bytes32) (runs: 264, μ: 808391, ~: 808618) +InterchainAccountRouterTest:testFuzz_callRemoteWithFailingDefaultIsm(bytes32) (runs: 264, μ: 792018, ~: 792018) +InterchainAccountRouterTest:testFuzz_callRemoteWithFailingIsmOverride(bytes32) (runs: 264, μ: 801017, ~: 801017) +InterchainAccountRouterTest:testFuzz_callRemoteWithOverrides_default(bytes32) (runs: 264, μ: 690802, ~: 690878) +InterchainAccountRouterTest:testFuzz_callRemoteWithOverrides_metadata(uint64,bytes32) (runs: 264, μ: 691093, ~: 692158) +InterchainAccountRouterTest:testFuzz_callRemoteWithoutDefaults_revert_noRouter(bytes32) (runs: 264, μ: 30012, ~: 30012) +InterchainAccountRouterTest:testFuzz_constructor(address) (runs: 264, μ: 121698, ~: 121698) +InterchainAccountRouterTest:testFuzz_customMetadata_forIgp(uint64,uint64,bytes32) (runs: 264, μ: 816718, ~: 817142) +InterchainAccountRouterTest:testFuzz_customMetadata_reverts_underpayment(uint64,uint64,bytes32) (runs: 261, μ: 276356, ~: 278128) +InterchainAccountRouterTest:testFuzz_enrollRemoteRouterAndIsm(bytes32,bytes32) (runs: 264, μ: 141323, ~: 141323) +InterchainAccountRouterTest:testFuzz_enrollRemoteRouterAndIsmImmutable(bytes32,bytes32,bytes32,bytes32) (runs: 264, μ: 136643, ~: 136643) +InterchainAccountRouterTest:testFuzz_enrollRemoteRouterAndIsmNonOwner(address,bytes32,bytes32) (runs: 264, μ: 28617, ~: 28617) +InterchainAccountRouterTest:testFuzz_enrollRemoteRouterAndIsms(uint32[],bytes32[],bytes32[]) (runs: 264, μ: 44699, ~: 45978) +InterchainAccountRouterTest:testFuzz_enrollRemoteRouters(uint8,uint32,bytes32) (runs: 262, μ: 9965893, ~: 9477545) +InterchainAccountRouterTest:testFuzz_getDeployedInterchainAccount_checkAccountOwners(address) (runs: 264, μ: 125334, ~: 125485) +InterchainAccountRouterTest:testFuzz_getLocalInterchainAccount(bytes32) (runs: 264, μ: 697506, ~: 697582) +InterchainAccountRouterTest:testFuzz_getRemoteInterchainAccount(address,address) (runs: 264, μ: 141026, ~: 141102) +InterchainAccountRouterTest:testFuzz_overrideAndCallRemote(bytes32) (runs: 264, μ: 808413, ~: 808640) +InterchainAccountRouterTest:testFuzz_receiveValue(uint256) (runs: 261, μ: 165407, ~: 165407) +InterchainAccountRouterTest:testFuzz_sendValue(uint256) (runs: 261, μ: 711950, ~: 711950) +InterchainAccountRouterTest:testFuzz_singleCallRemoteWithDefault(bytes32) (runs: 264, μ: 809119, ~: 809346) +InterchainAccountRouterTest:test_quoteGasPayment() (gas: 167210) +InterchainAccountRouterTest:test_quoteGasPayment_gasLimitOverride() (gas: 167759) +InterchainGasPaymasterTest:testClaim() (gas: 96594) +InterchainGasPaymasterTest:testConstructorSetsBeneficiary() (gas: 7682) +InterchainGasPaymasterTest:testConstructorSetsDeployedBlock() (gas: 7597) +InterchainGasPaymasterTest:testGetExchangeRateAndGasPrice() (gas: 42913) +InterchainGasPaymasterTest:testGetExchangeRateAndGasPriceRevertsIfNoGasOracleSet() (gas: 12259) +InterchainGasPaymasterTest:testHookType() (gas: 5487) +InterchainGasPaymasterTest:testInitializeRevertsIfCalledTwice() (gas: 11036) +InterchainGasPaymasterTest:testPayForGas() (gas: 95965) +InterchainGasPaymasterTest:testPayForGas_reverts_ifPaymentInsufficient() (gas: 46057) +InterchainGasPaymasterTest:testPayForGas_withOverhead(uint128,uint96) (runs: 264, μ: 71381, ~: 71381) +InterchainGasPaymasterTest:testPostDispatch__withOverheadSet(uint96) (runs: 264, μ: 80957, ~: 80957) +InterchainGasPaymasterTest:testPostDispatch_customWithMetadata() (gas: 113183) +InterchainGasPaymasterTest:testPostDispatch_customWithMetadataAndOverhead(uint96) (runs: 264, μ: 80138, ~: 80138) +InterchainGasPaymasterTest:testPostDispatch_defaultGasLimit() (gas: 77124) +InterchainGasPaymasterTest:testQuoteDispatch_customWithMetadata() (gas: 55203) +InterchainGasPaymasterTest:testQuoteDispatch_defaultGasLimit() (gas: 53566) +InterchainGasPaymasterTest:testQuoteGasPaymentRemoteVeryCheap() (gas: 42817) +InterchainGasPaymasterTest:testQuoteGasPaymentRemoteVeryExpensive() (gas: 42901) +InterchainGasPaymasterTest:testQuoteGasPaymentRevertsIfNoGasOracleSet() (gas: 12182) +InterchainGasPaymasterTest:testQuoteGasPaymentSimilarExchangeRate() (gas: 42945) +InterchainGasPaymasterTest:testSetBeneficiary() (gas: 18766) +InterchainGasPaymasterTest:testSetBeneficiaryRevertsIfNotOwner() (gas: 11015) +InterchainGasPaymasterTest:testSetDestinationGasConfigs(uint32,uint32,uint96,uint96) (runs: 264, μ: 862110, ~: 862110) +InterchainGasPaymasterTest:testSetDestinationGasConfigs_reverts_notOwner(uint32,uint32,uint96,uint96) (runs: 264, μ: 17237, ~: 17237) +InterchainGasPaymasterTest:testdestinationGasLimit(uint96) (runs: 264, μ: 19766, ~: 19766) +InterchainGasPaymasterTest:testdestinationGasLimit_whenOverheadNotSet(uint32) (runs: 264, μ: 10959, ~: 10959) +InterchainQueryRouterTest:testCannotCallbackReverting() (gas: 1547616) +InterchainQueryRouterTest:testCannotQueryReverting() (gas: 1120274) +InterchainQueryRouterTest:testQueryAddress(address) (runs: 264, μ: 1558785, ~: 1558785) +InterchainQueryRouterTest:testQueryUint256(uint256) (runs: 264, μ: 1832946, ~: 1833248) +InterchainQueryRouterTest:testSingleQueryAddress(address) (runs: 264, μ: 1558760, ~: 1558760) +LayerZeroV1HookTest:testLzV1Hook_HookType() (gas: 5441) +LayerZeroV1HookTest:testLzV1Hook_ParseLzMetadata_returnsCorrectData() (gas: 34463) +LayerZeroV1HookTest:testLzV1Hook_PostDispatch_executesCrossChain() (gas: 270186) +LayerZeroV1HookTest:testLzV1Hook_PostDispatch_notEnoughFee() (gas: 183777) +LayerZeroV1HookTest:testLzV1Hook_PostDispatch_refundExtraFee() (gas: 303417) +LayerZeroV1HookTest:testLzV1Hook_QuoteDispatch_returnsFeeAmount() (gas: 58280) +LayerZeroV2HookTest:testLzV2Hook_HookType() (gas: 5530) +LayerZeroV2HookTest:testLzV2Hook_ParseLzMetadata_returnsCorrectData() (gas: 16589) +LayerZeroV2HookTest:testLzV2Hook_PostDispatch_executesCrossChain() (gas: 210581) +LayerZeroV2HookTest:testLzV2Hook_PostDispatch_notEnoughFee(uint256) (runs: 259, μ: 202092, ~: 207603) +LayerZeroV2HookTest:testLzV2Hook_PostDispatch_refundExtraFee(uint256) (runs: 261, μ: 248680, ~: 248680) +LayerZeroV2HookTest:testLzV2Hook_QuoteDispatch_returnsFeeAmount() (gas: 47969) +LayerZeroV2IsmTest:testLzV2Ism_lzReceive_RevertWhen_NotCalledByEndpoint(address) (runs: 264, μ: 92135, ~: 92135) +LayerZeroV2IsmTest:testLzV2Ism_lzReceive_RevertWhen_NotSentByHook(address) (runs: 264, μ: 91885, ~: 91885) +LayerZeroV2IsmTest:testLzV2Ism_verifyMessageId_SetsCorrectMessageId(bytes32) (runs: 264, μ: 89258, ~: 89258) +LibBitTest:testClearBit(uint8) (runs: 264, μ: 25093, ~: 25109) +LibBitTest:testIsBitSet(uint8) (runs: 264, μ: 22781, ~: 22796) +LibBitTest:testSetBit(uint8) (runs: 264, μ: 22698, ~: 22713) +LiquidityLayerRouterTest:testCannotSendToRecipientWithoutHandle() (gas: 739136) +LiquidityLayerRouterTest:testDispatchWithTokenTransfersMovesTokens() (gas: 581615) +LiquidityLayerRouterTest:testDispatchWithTokensCallsAdapter() (gas: 587715) +LiquidityLayerRouterTest:testDispatchWithTokensRevertsWithFailedTransferIn() (gas: 29553) +LiquidityLayerRouterTest:testDispatchWithTokensRevertsWithUnkownBridgeAdapter() (gas: 20642) +LiquidityLayerRouterTest:testDispatchWithTokensTransfersOnDestination() (gas: 838861) +LiquidityLayerRouterTest:testProcessingRevertsIfBridgeAdapterReverts() (gas: 671688) +LiquidityLayerRouterTest:testSendToRecipientWithoutHandleWhenSpecifyingNoMessage() (gas: 1297563) +LiquidityLayerRouterTest:testSetLiquidityLayerAdapter() (gas: 23432) +MailboxTest:test_100dispatch_withMerkleTreeHook(bytes) (runs: 264, μ: 4364419, ~: 4347734) +MailboxTest:test_dispatch(uint8,bytes,bytes) (runs: 264, μ: 9255880, ~: 7157027) +MailboxTest:test_initialize() (gas: 25344) +MailboxTest:test_initialize_revertsWhenCalledTwice() (gas: 19719) +MailboxTest:test_localDomain() (gas: 5714) +MailboxTest:test_process(bytes,bytes,uint256) (runs: 262, μ: 168477, ~: 160475) +MailboxTest:test_process_revertsWhenAlreadyDelivered() (gas: 109577) +MailboxTest:test_process_revertsWhenBadDestination(bytes) (runs: 264, μ: 13155, ~: 13131) +MailboxTest:test_process_revertsWhenBadVersion(bytes) (runs: 264, μ: 12959, ~: 12935) +MailboxTest:test_process_revertsWhenISMFails(bytes) (runs: 264, μ: 64059, ~: 63986) +MailboxTest:test_quoteDispatch(uint256,uint256,uint256,bytes,bytes) (runs: 258, μ: 137539, ~: 138983) +MailboxTest:test_recipientIsm() (gas: 296559) +MailboxTest:test_setDefaultHook() (gas: 233128) +MailboxTest:test_setDefaultIsm() (gas: 180212) +MailboxTest:test_setRequiredHook() (gas: 233041) +MerkleRootMultisigIsmTest:testFailVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 258, μ: 325435, ~: 319198) +MerkleRootMultisigIsmTest:testVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 258, μ: 328022, ~: 320212) +MerkleTreeHookTest:testHookType() (gas: 5535) +MerkleTreeHookTest:testPostDispatch_emit() (gas: 278226) +MerkleTreeHookTest:testQuoteDispatch() (gas: 46972) +MessageIdMultisigIsmTest:testFailVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 258, μ: 305244, ~: 299975) +MessageIdMultisigIsmTest:testVerify(uint32,bytes32,bytes,uint8,uint8,bytes32) (runs: 258, μ: 306844, ~: 299697) +MessagingTest:testSendMessage(string) (runs: 264, μ: 356834, ~: 336547) +OPStackIsmTest:testFork_postDispatch() (gas: 3873300) +OPStackIsmTest:testFork_postDispatch_RevertWhen_ChainIDNotSupported() (gas: 3751565) +OPStackIsmTest:testFork_postDispatch_RevertWhen_NotLastDispatchedMessage() (gas: 3730913) +OPStackIsmTest:testFork_postDispatch_RevertWhen_TooMuchValue() (gas: 3746869) +OPStackIsmTest:testFork_quoteDispatch() (gas: 3727553) +OPStackIsmTest:testFork_verify() (gas: 3788803) +OPStackIsmTest:testFork_verifyMessageId() (gas: 3780276) +OPStackIsmTest:testFork_verifyMessageId_RevertWhen_NotAuthorized() (gas: 3719317) +OPStackIsmTest:testFork_verify_RevertWhen_HyperlaneInvalidMessage() (gas: 3787506) +OPStackIsmTest:testFork_verify_RevertWhen_InvalidOptimismMessageID() (gas: 3796582) +OPStackIsmTest:testFork_verify_WithValue(uint256) (runs: 18, μ: 3840947, ~: 3843413) +OPStackIsmTest:testFork_verify_tooMuchValue() (gas: 3787164) +OPStackIsmTest:testFork_verify_valueAlreadyClaimed(uint256) (runs: 18, μ: 3845394, ~: 3847860) +PausableIsmTest:test_pause() (gas: 21155) +PausableIsmTest:test_unpause() (gas: 19011) +PausableIsmTest:test_verify() (gas: 20458) +PortalAdapterTest:testAdapter(uint256) (runs: 264, μ: 147871, ~: 147992) +PortalAdapterTest:testReceivingRevertsWithoutTransferCompletion(uint256) (runs: 264, μ: 152782, ~: 152903) +PortalAdapterTest:testReceivingWorks(uint256) (runs: 264, μ: 240060, ~: 240178) +ProtocolFeeTest:testConstructor() (gas: 7608) +ProtocolFeeTest:testFuzz_collectProtocolFee(uint256,uint256) (runs: 264, μ: 4543919, ~: 4512170) +ProtocolFeeTest:testFuzz_postDispatch_inusfficientFees(uint256,uint256) (runs: 264, μ: 33081, ~: 33968) +ProtocolFeeTest:testFuzz_postDispatch_sufficientFees(uint256,uint256) (runs: 264, μ: 76503, ~: 78212) +ProtocolFeeTest:testHookType() (gas: 5487) +ProtocolFeeTest:testQuoteDispatch() (gas: 17254) +ProtocolFeeTest:testSetBeneficiary_revertWhen_notOwner() (gas: 18169) +ProtocolFeeTest:testSetProtocolFee(uint256) (runs: 264, μ: 18110, ~: 18211) +ProtocolFeeTest:testSetProtocolFee_revertWhen_exceedsMax(uint256) (runs: 264, μ: 19652, ~: 19749) +ProtocolFeeTest:testSetProtocolFee_revertsWhen_notOwner() (gas: 15900) +ProtocolFeeTest:test_postDispatch_specifyRefundAddress(uint256,uint256) (runs: 264, μ: 78195, ~: 79779) +RateLimitLibTest:testRateLimited_decreasesLimitWithinSameDay() (gas: 47046) +RateLimitLibTest:testRateLimited_neverReturnsGtMaxLimit(uint256,uint40) (runs: 260, μ: 41965, ~: 43595) +RateLimitLibTest:testRateLimited_onlyOwnerCanSetTargetLimit() (gas: 10842) +RateLimitLibTest:testRateLimited_replinishesWithinSameDay() (gas: 44005) +RateLimitLibTest:testRateLimited_returnsCurrentFilledLevel_anyDay(uint40) (runs: 264, μ: 19500, ~: 20149) +RateLimitLibTest:testRateLimited_revertsIfMaxNotSet() (gas: 13082) +RateLimitLibTest:testRateLimited_setsNewLimit() (gas: 16273) +RateLimitLibTest:testRateLimited_shouldResetLimit_ifDurationExceeds(uint256) (runs: 260, μ: 43249, ~: 43249) +RateLimitedHookTest:testRateLimitedHook_allowsTransfer_ifUnderLimit(uint128,uint128) (runs: 261, μ: 219047, ~: 220731) +RateLimitedHookTest:testRateLimitedHook_preventsDuplicateMessageFromValidating(uint128) (runs: 261, μ: 226900, ~: 228379) +RateLimitedHookTest:testRateLimitedHook_revertsIfCalledByNonMailbox(bytes) (runs: 264, μ: 17411, ~: 17393) +RateLimitedHookTest:testRateLimitedHook_revertsTransfer_ifExceedsFilledLevel(uint128,uint128) (runs: 259, μ: 192624, ~: 191383) +RateLimitedIsmTest:testRateLimitedIsm_preventsDuplicateMessageFromValidating(uint128) (runs: 261, μ: 192457, ~: 193601) +RateLimitedIsmTest:testRateLimitedIsm_revertsIDeliveredFalse(bytes) (runs: 264, μ: 37879, ~: 37861) +RateLimitedIsmTest:testRateLimitedIsm_verify(uint128) (runs: 261, μ: 189425, ~: 190569) +RouterTest:testDispatch(bytes32) (runs: 264, μ: 280253, ~: 280253) +RouterTest:testDispatchInsufficientPayment(bytes32) (runs: 264, μ: 228382, ~: 228382) +RouterTest:testEnrolledMailboxAndRouter(bytes32) (runs: 264, μ: 109663, ~: 109663) +RouterTest:testInitialize() (gas: 27716) +RouterTest:testNotOwnerEnrollRouter(address,bytes32) (runs: 263, μ: 14929, ~: 14929) +RouterTest:testOwnerBatchEnrollRouter(bytes32) (runs: 264, μ: 113515, ~: 113515) +RouterTest:testOwnerBatchUnenrollRouter(bytes32) (runs: 264, μ: 88218, ~: 88192) +RouterTest:testOwnerEnrollRouter(bytes32) (runs: 264, μ: 111875, ~: 111875) +RouterTest:testOwnerUnenrollRouter(bytes32) (runs: 264, μ: 87295, ~: 87269) +RouterTest:testReturnDomains(bytes32) (runs: 264, μ: 176310, ~: 176310) +RouterTest:testUnenrolledMailbox(bytes32) (runs: 264, μ: 13782, ~: 13782) +RouterTest:testUnenrolledRouter(bytes32) (runs: 264, μ: 25300, ~: 25300) +StorageGasOracleTest:testConstructorSetsOwnership() (gas: 7537) +StorageGasOracleTest:testGetExchangeRateAndGasPrice() (gas: 12412) StorageGasOracleTest:testGetExchangeRateAndGasPriceUnknownDomain() (gas: 8064) StorageGasOracleTest:testSetRemoteGasData() (gas: 38836) -StorageGasOracleTest:testSetRemoteGasDataConfigs() (gas: 69238) -StorageGasOracleTest:testSetRemoteGasDataConfigsRevertsIfNotOwner() (gas: 12227) -StorageGasOracleTest:testSetRemoteGasDataRevertsIfNotOwner() (gas: 11275) -TestQuerySenderTest:testSendAddressQuery(address) (runs: 256, μ: 957141, ~: 957608) -TestQuerySenderTest:testSendAddressQueryRequiresGasPayment() (gas: 329870) -TestQuerySenderTest:testSendBytesQuery(uint256) (runs: 256, μ: 1590463, ~: 1591085) -TestQuerySenderTest:testSendBytesQueryRequiresGasPayment() (gas: 329891) -TestQuerySenderTest:testSendUint256Query(uint256) (runs: 256, μ: 1590538, ~: 1591160) -TestQuerySenderTest:testSendUint256QueryRequiresGasPayment() (gas: 329858) -ValidatorAnnounceTest:testAnnounce() (gas: 245554) \ No newline at end of file +StorageGasOracleTest:testSetRemoteGasDataConfigs() (gas: 69080) +StorageGasOracleTest:testSetRemoteGasDataConfigsRevertsIfNotOwner() (gas: 12250) +StorageGasOracleTest:testSetRemoteGasDataRevertsIfNotOwner() (gas: 11253) +TestQuerySenderTest:testSendAddressQuery(address) (runs: 264, μ: 1200059, ~: 1200135) +TestQuerySenderTest:testSendBytesQuery(uint256) (runs: 264, μ: 1834102, ~: 1834253) +TestQuerySenderTest:testSendUint256Query(uint256) (runs: 264, μ: 1834177, ~: 1834328) +TestSendReceiverTest:testDispatchToSelf() (gas: 168436) +TestSendReceiverTest:testDispatchToSelf_withHook() (gas: 168925) +TestSendReceiverTest:testHandle(uint256) (runs: 264, μ: 11941, ~: 12137) +TrustedRelayerIsmTest:test_verify(uint32,bytes32,bytes) (runs: 264, μ: 185352, ~: 177289) +ValidatorAnnounceTest:testAnnounce() (gas: 356026) \ No newline at end of file diff --git a/solidity/test/Router.t.sol b/solidity/test/Router.t.sol index b4b095a50..bd6150824 100644 --- a/solidity/test/Router.t.sol +++ b/solidity/test/Router.t.sol @@ -97,6 +97,7 @@ contract RouterTest is Test { address notOwner, bytes32 remoteRouter ) public { + vm.assume(notOwner != router.owner()); vm.prank(notOwner); vm.expectRevert(bytes("Ownable: caller is not the owner")); router.enrollRemoteRouter(origin, remoteRouter);