diff --git a/solidity/.gas-snapshot b/solidity/.gas-snapshot index db7704202..63cae21f5 100644 --- a/solidity/.gas-snapshot +++ b/solidity/.gas-snapshot @@ -1,24 +1,24 @@ -GasRouterTest:testDispatchWithGas(uint256) (runs: 256, μ: 408670, ~: 408670) -GasRouterTest:testQuoteGasPayment(uint256) (runs: 256, μ: 85774, ~: 85774) +GasRouterTest:testDispatchWithGas(uint256) (runs: 256, μ: 413789, ~: 413789) +GasRouterTest:testQuoteGasPayment(uint256) (runs: 256, μ: 85818, ~: 85818) GasRouterTest:testSetDestinationGas(uint256) (runs: 256, μ: 73808, ~: 75985) InterchainAccountRouterTest:testBytes32Owner() (gas: 210236) -InterchainAccountRouterTest:testCannotSetOwner(address) (runs: 256, μ: 505585, ~: 505741) -InterchainAccountRouterTest:testCannotSetOwnerTwice(address) (runs: 256, μ: 854698, ~: 854698) +InterchainAccountRouterTest:testCannotSetOwner(address) (runs: 256, μ: 505663, ~: 505741) +InterchainAccountRouterTest:testCannotSetOwnerTwice(address) (runs: 256, μ: 854620, ~: 854698) InterchainAccountRouterTest:testOwner() (gas: 210393) InterchainAccountRouterTest:testReceiveValue(uint256) (runs: 256, μ: 148364, ~: 150014) InterchainAccountRouterTest:testSendValue(uint256) (runs: 256, μ: 556925, ~: 556925) InterchainAccountRouterTest:testSetOwner(address) (runs: 256, μ: 540147, ~: 540147) -InterchainGasPaymasterTest:testClaim() (gas: 90697) +InterchainGasPaymasterTest:testClaim() (gas: 90675) InterchainGasPaymasterTest:testConstructorSetsBeneficiary() (gas: 7648) -InterchainGasPaymasterTest:testGetExchangeRateAndGasPrice() (gas: 41721) -InterchainGasPaymasterTest:testGetExchangeRateAndGasPriceRevertsIfNoGasOracleSet() (gas: 10815) -InterchainGasPaymasterTest:testInitializeRevertsIfCalledTwice() (gas: 10960) -InterchainGasPaymasterTest:testPayForGas() (gas: 92790) +InterchainGasPaymasterTest:testGetExchangeRateAndGasPrice() (gas: 41743) +InterchainGasPaymasterTest:testGetExchangeRateAndGasPriceRevertsIfNoGasOracleSet() (gas: 10837) +InterchainGasPaymasterTest:testInitializeRevertsIfCalledTwice() (gas: 11087) +InterchainGasPaymasterTest:testPayForGas() (gas: 92812) InterchainGasPaymasterTest:testPayForGasRevertsIfPaymentInsufficient() (gas: 44808) -InterchainGasPaymasterTest:testQuoteGasPaymentRemoteVeryCheap() (gas: 41729) -InterchainGasPaymasterTest:testQuoteGasPaymentRemoteVeryExpensive() (gas: 41709) -InterchainGasPaymasterTest:testQuoteGasPaymentRevertsIfNoGasOracleSet() (gas: 10781) -InterchainGasPaymasterTest:testQuoteGasPaymentSimilarExchangeRate() (gas: 41774) +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) @@ -26,7 +26,7 @@ InterchainGasPaymasterTest:testSetGasOracleRevertsIfNotOwner() (gas: 13783) InterchainQueryRouterTest:testCannotCallbackReverting() (gas: 1506125) InterchainQueryRouterTest:testCannotQueryReverting() (gas: 1173880) InterchainQueryRouterTest:testQueryAddress(address) (runs: 256, μ: 1536915, ~: 1536915) -InterchainQueryRouterTest:testQueryUint256(uint256) (runs: 256, μ: 1685046, ~: 1685124) +InterchainQueryRouterTest:testQueryUint256(uint256) (runs: 256, μ: 1685124, ~: 1685124) LiquidityLayerRouterTest:testCannotSendToRecipientWithoutHandle() (gas: 662979) LiquidityLayerRouterTest:testDispatchWithTokenTransfersMovesTokens() (gas: 545350) LiquidityLayerRouterTest:testDispatchWithTokensCallsAdapter() (gas: 551460) @@ -34,14 +34,14 @@ LiquidityLayerRouterTest:testDispatchWithTokensRevertsWithFailedTransferIn() (ga LiquidityLayerRouterTest:testDispatchWithTokensRevertsWithUnkownBridgeAdapter() (gas: 20663) LiquidityLayerRouterTest:testDispatchWithTokensTransfersOnDestination() (gas: 781605) LiquidityLayerRouterTest:testProcessingRevertsIfBridgeAdapterReverts() (gas: 596435) -LiquidityLayerRouterTest:testSendToRecipientWithoutHandleWhenSpecifyingNoMessage() (gas: 1055907) +LiquidityLayerRouterTest:testSendToRecipientWithoutHandleWhenSpecifyingNoMessage() (gas: 1197693) LiquidityLayerRouterTest:testSetLiquidityLayerAdapter() (gas: 23363) -MessagingTest:testSendMessage(string) (runs: 256, μ: 277522, ~: 296005) +MessagingTest:testSendMessage(string) (runs: 256, μ: 277791, ~: 296095) OverheadIgpTest:testDestinationGasAmount() (gas: 33814) OverheadIgpTest:testDestinationGasAmountWhenOverheadNotSet() (gas: 7912) OverheadIgpTest:testInnerIgpSet() (gas: 7632) OverheadIgpTest:testPayForGas() (gas: 65328) -OverheadIgpTest:testQuoteGasPayment() (gas: 42746) +OverheadIgpTest:testQuoteGasPayment() (gas: 42768) OverheadIgpTest:testSetDestinationGasAmounts() (gas: 63435) OverheadIgpTest:testSetDestinationGasAmountsNotOwner() (gas: 12018) PausableReentrancyGuardTest:testNonreentrant() (gas: 9628) @@ -57,10 +57,10 @@ StorageGasOracleTest:testSetRemoteGasData() (gas: 38836) StorageGasOracleTest:testSetRemoteGasDataConfigs() (gas: 69238) StorageGasOracleTest:testSetRemoteGasDataConfigsRevertsIfNotOwner() (gas: 12227) StorageGasOracleTest:testSetRemoteGasDataRevertsIfNotOwner() (gas: 11275) -TestQuerySenderTest:testSendAddressQuery(address) (runs: 256, μ: 1075135, ~: 1075135) +TestQuerySenderTest:testSendAddressQuery(address) (runs: 256, μ: 1075001, ~: 1075157) TestQuerySenderTest:testSendAddressQueryRequiresGasPayment() (gas: 383215) -TestQuerySenderTest:testSendBytesQuery(uint256) (runs: 256, μ: 1708408, ~: 1708486) +TestQuerySenderTest:testSendBytesQuery(uint256) (runs: 256, μ: 1708430, ~: 1708508) TestQuerySenderTest:testSendBytesQueryRequiresGasPayment() (gas: 383236) -TestQuerySenderTest:testSendUint256Query(uint256) (runs: 256, μ: 1708483, ~: 1708561) +TestQuerySenderTest:testSendUint256Query(uint256) (runs: 256, μ: 1708505, ~: 1708583) TestQuerySenderTest:testSendUint256QueryRequiresGasPayment() (gas: 383203) ValidatorAnnounceTest:testAnnounce() (gas: 245554) \ No newline at end of file diff --git a/solidity/contracts/test/TestRecipient.sol b/solidity/contracts/test/TestRecipient.sol index 2db1f5b1b..a1a4c97f8 100644 --- a/solidity/contracts/test/TestRecipient.sol +++ b/solidity/contracts/test/TestRecipient.sol @@ -1,10 +1,13 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.8.0; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; + import {IMessageRecipient} from "../../interfaces/IMessageRecipient.sol"; import {IInterchainSecurityModule, ISpecifiesInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol"; contract TestRecipient is + Ownable, IMessageRecipient, ISpecifiesInterchainSecurityModule { @@ -23,10 +26,6 @@ contract TestRecipient is event ReceivedCall(address indexed caller, uint256 amount, string message); - function setInterchainSecurityModule(address _ism) external { - interchainSecurityModule = IInterchainSecurityModule(_ism); - } - function handle( uint32 _origin, bytes32 _sender, @@ -42,4 +41,8 @@ contract TestRecipient is lastCaller = msg.sender; lastCallMessage = message; } + + function setInterchainSecurityModule(address _ism) external onlyOwner { + interchainSecurityModule = IInterchainSecurityModule(_ism); + } } diff --git a/typescript/infra/config/environments/mainnet2/testrecipient/addresses.json b/typescript/infra/config/environments/mainnet2/testrecipient/addresses.json new file mode 100644 index 000000000..2e18c2418 --- /dev/null +++ b/typescript/infra/config/environments/mainnet2/testrecipient/addresses.json @@ -0,0 +1,38 @@ +{ + "bsc": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "avalanche": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "polygon": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "celo": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "arbitrum": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "optimism": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "ethereum": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "moonbeam": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "gnosis": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + } +} diff --git a/typescript/infra/config/environments/mainnet2/testrecipient/verification.json b/typescript/infra/config/environments/mainnet2/testrecipient/verification.json new file mode 100644 index 000000000..53b20bae3 --- /dev/null +++ b/typescript/infra/config/environments/mainnet2/testrecipient/verification.json @@ -0,0 +1,128 @@ +{ + "bsc": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "avalanche": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "polygon": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "celo": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "arbitrum": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "optimism": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "ethereum": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "moonbeam": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "gnosis": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ] +} diff --git a/typescript/infra/config/environments/testnet3/agent.ts b/typescript/infra/config/environments/testnet3/agent.ts index 959782702..48031f870 100644 --- a/typescript/infra/config/environments/testnet3/agent.ts +++ b/typescript/infra/config/environments/testnet3/agent.ts @@ -40,7 +40,15 @@ export const hyperlane: AgentConfig = { validators, relayer: { default: { - blacklist: releaseCandidateHelloworldMatchingList, + blacklist: [ + ...releaseCandidateHelloworldMatchingList, + { + // In an effort to reduce some giant retry queues that resulted + // from spam txs to the old TestRecipient before we were charging for + // gas, we blacklist the old TestRecipient address. + recipientAddress: '0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE', + }, + ], gasPaymentEnforcement: [ { type: GasPaymentEnforcementPolicyType.None, diff --git a/typescript/infra/config/environments/testnet3/testrecipient/addresses.json b/typescript/infra/config/environments/testnet3/testrecipient/addresses.json new file mode 100644 index 000000000..bec3b005b --- /dev/null +++ b/typescript/infra/config/environments/testnet3/testrecipient/addresses.json @@ -0,0 +1,38 @@ +{ + "alfajores": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "fuji": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "mumbai": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "bsctestnet": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "goerli": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "sepolia": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "moonbasealpha": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "optimismgoerli": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + }, + "arbitrumgoerli": { + "TestRecipient": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "TestTokenRecipient": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb" + } +} diff --git a/typescript/infra/config/environments/testnet3/testrecipient/verification.json b/typescript/infra/config/environments/testnet3/testrecipient/verification.json new file mode 100644 index 000000000..12a4c3e65 --- /dev/null +++ b/typescript/infra/config/environments/testnet3/testrecipient/verification.json @@ -0,0 +1,128 @@ +{ + "alfajores": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "fuji": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "mumbai": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "bsctestnet": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "goerli": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "sepolia": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "moonbasealpha": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "optimismgoerli": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ], + "arbitrumgoerli": [ + { + "name": "TestRecipient", + "address": "0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TestTokenRecipient", + "address": "0x85ac1164878e017b67660a74ff1f41f3D05C02Bb", + "isProxy": false, + "constructorArguments": "0x" + } + ] +} diff --git a/typescript/infra/src/testcontracts/testrecipient.ts b/typescript/infra/src/testcontracts/testrecipient.ts index 691328b3f..9d33aae9b 100644 --- a/typescript/infra/src/testcontracts/testrecipient.ts +++ b/typescript/infra/src/testcontracts/testrecipient.ts @@ -33,17 +33,24 @@ export class TestRecipientDeployer extends HyperlaneDeployer< ); } async deployContracts(chain: ChainName) { + const deployer = await this.multiProvider.getSignerAddress(chain); const TestRecipient = await this.deployContract( chain, 'TestRecipient', [], - { create2Salt: 'testtest32' }, + { + create2Salt: 'TestRecipient-March-17-2023', + initCalldata: new TestRecipient__factory().interface.encodeFunctionData( + 'transferOwnership', + [deployer], + ), + }, ); const TestTokenRecipient = await this.deployContract( chain, 'TestTokenRecipient', [], - { create2Salt: 'TestTokenRecipient' }, + { create2Salt: 'TestRecipient-March-17-2023' }, ); return { TestRecipient,