From bf9d0ae792afad5fabee6e2c651d03484b3baebf Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 24 Jan 2023 14:40:02 +0000 Subject: [PATCH] OverheadIGP.sol, deploy new IGPs, deploy ValidatorAnnounce (#1572) * IGP charges 1 wei * Don't pay for gas in LiquidityLayerRouter * yarn gas * Add GasOverheadIgp * Remove compiler silencing * yarn gas * Shift around some fns * nit var name * nit * Configure gas overhead IGP (#1588) * Instrument multisigIsm.verify gas costs * Add deployment tooling for IGP gas overhead * Include mailbox.process and max body in overhead * Restore multisig tests * GasOverheadIgp -> OverheadIgp, fix infra build * Prettier, change some infra / deploy tooling * run yarn hyperlane * yarn gas * yarn gas, update test contracts * rm OwnableUpgradeable for Overhead ISM * Move gas instrumentation into its own describe * back to TestRecipient__factory for normal verify tests * New submodule commits * deploy test * BaseInterchainGasPaymaster -> InterchainGasPaymaster * trying to deploy * Deploying with deployerOwnedProxyAdmin * Deployed to testnet3 * Cleaning up * cleaning up * clean * Fix tests * revert infra/package.json * clean up verification.json * Update yarn.lock * Fix lint * Changing logic around deployerOwnedProxyAdmin * Deploy mainnet * Redeploy testnet with new salt versions * nit Co-authored-by: Yorke Rhodes --- rust/config/mainnet2/mainnet2_config.json | 66 ++--- rust/config/test/test_config.json | 22 +- rust/config/testnet3/testnet3_config.json | 64 ++--- solidity/.gas-snapshot | 11 +- solidity/contracts/Mailbox.sol | 1 - .../{ => igps}/InterchainGasPaymaster.sol | 6 +- solidity/contracts/igps/OverheadIgp.sol | 133 ++++++++++ .../mock/MockHyperlaneEnvironment.sol | 2 +- .../contracts/test/LightTestRecipient.sol | 12 + solidity/contracts/test/TestRecipient.sol | 2 +- solidity/test/igps/OverheadIgp.t.sol | 146 +++++++++++ .../{ => igps}/interchainGasPaymaster.test.ts | 2 +- solidity/test/isms/multisigIsm.test.ts | 75 ++++++ solidity/test/lib/mailboxes.ts | 8 +- typescript/helloworld | 2 +- .../core/verification/verification.json | 240 ++++++++++++++++++ .../core/verification/verification.json | 196 +++++++++++++- typescript/infra/src/core/deploy.ts | 20 +- .../sdk/src/consts/environments/mainnet.json | 112 ++++---- .../sdk/src/consts/environments/test.json | 51 ++-- .../sdk/src/consts/environments/testnet.json | 96 ++++--- .../src/consts/multisigIsmVerifyCosts.json | 209 +++++++++++++++ typescript/sdk/src/core/HyperlaneCore.ts | 4 +- typescript/sdk/src/core/contracts.ts | 6 +- .../sdk/src/deploy/HyperlaneDeployer.ts | 72 +++++- .../src/deploy/core/HyperlaneCoreChecker.ts | 6 + .../src/deploy/core/HyperlaneCoreDeployer.ts | 108 +++++++- typescript/sdk/src/index.ts | 6 +- typescript/token | 2 +- 29 files changed, 1455 insertions(+), 225 deletions(-) rename solidity/contracts/{ => igps}/InterchainGasPaymaster.sol (93%) create mode 100644 solidity/contracts/igps/OverheadIgp.sol create mode 100644 solidity/contracts/test/LightTestRecipient.sol create mode 100644 solidity/test/igps/OverheadIgp.t.sol rename solidity/test/{ => igps}/interchainGasPaymaster.test.ts (99%) create mode 100644 typescript/sdk/src/consts/multisigIsmVerifyCosts.json diff --git a/rust/config/mainnet2/mainnet2_config.json b/rust/config/mainnet2/mainnet2_config.json index 340839b85..67692e9f6 100644 --- a/rust/config/mainnet2/mainnet2_config.json +++ b/rust/config/mainnet2/mainnet2_config.json @@ -6,9 +6,10 @@ "domain": "42220", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0x5bc68C82d33160cF4EA34d0bab3F7c27cD9eD8D6", - "multisigIsm": "0x9bDE63104EE030d9De419EEd6bA7D14b86D6fE3f" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "0", "connection": { @@ -17,17 +18,17 @@ }, "index": { "from": "16884144" - }, - "signer": null + } }, "ethereum": { "name": "ethereum", "domain": "1", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0xec48E52D960E54a179f70907bF28b105813877ee" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "20", "connection": { @@ -36,17 +37,17 @@ }, "index": { "from": "16271503" - }, - "signer": null + } }, "avalanche": { "name": "avalanche", "domain": "43114", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0xeE80ab5B563cB3825133f29502bA34eD3707cb8C" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "3", "connection": { @@ -55,17 +56,17 @@ }, "index": { "from": "24145479" - }, - "signer": null + } }, "polygon": { "name": "polygon", "domain": "137", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0x61A80297e77FC5395bd6Ff60EEacf7CD4f18d4a4" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "256", "connection": { @@ -74,17 +75,17 @@ }, "index": { "from": "37313389" - }, - "signer": null + } }, "bsc": { "name": "bsc", "domain": "56", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0x3a579C0bd04FC4C98A8D70EEABD9094e7be4B26D" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "15", "connection": { @@ -92,18 +93,18 @@ "url": "" }, "index": { - "from": "24248084" - }, - "signer": null + "from": "25063295" + } }, "arbitrum": { "name": "arbitrum", "domain": "42161", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0x32B92bd3e5045B67FDD8dbb7A58D25980836d04C" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "0", "connection": { @@ -112,17 +113,17 @@ }, "index": { "from": "49073182" - }, - "signer": null + } }, "optimism": { "name": "optimism", "domain": "10", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0xAab1D11E2063Bae5EB01fa946cA8d2FDe3db05D5" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "0", "connection": { @@ -131,17 +132,17 @@ }, "index": { "from": "55698988" - }, - "signer": null + } }, "moonbeam": { "name": "moonbeam", "domain": "1284", "addresses": { "mailbox": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", - "interchainGasPaymaster": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "multisigIsm": "0xf3b1F415740A26568C45b1c771A737E31C198F09" + "interchainGasPaymaster": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "1", "connection": { @@ -150,8 +151,7 @@ }, "index": { "from": "2595747" - }, - "signer": null + } } }, "db": "db_path", diff --git a/rust/config/test/test_config.json b/rust/config/test/test_config.json index 93b191a47..6fca0e51c 100644 --- a/rust/config/test/test_config.json +++ b/rust/config/test/test_config.json @@ -5,9 +5,9 @@ "name": "test1", "domain": "13371", "addresses": { - "mailbox": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", + "mailbox": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", "interchainGasPaymaster": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", - "validatorAnnounce": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" + "validatorAnnounce": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" }, "signer": null, "protocol": "ethereum", @@ -17,16 +17,16 @@ "url": "" }, "index": { - "from": "4" + "from": "2" } }, "test2": { "name": "test2", "domain": "13372", "addresses": { - "mailbox": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", - "interchainGasPaymaster": "0x9A676e781A523b5d0C0e43731313A708CB607508", - "validatorAnnounce": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE" + "mailbox": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1", + "interchainGasPaymaster": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE", + "validatorAnnounce": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44" }, "signer": null, "protocol": "ethereum", @@ -36,16 +36,16 @@ "url": "" }, "index": { - "from": "13" + "from": "15" } }, "test3": { "name": "test3", "domain": "13373", "addresses": { - "mailbox": "0x4A679253410272dd5232B3Ff7cF5dbB88f295319", - "interchainGasPaymaster": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44", - "validatorAnnounce": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F" + "mailbox": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9", + "interchainGasPaymaster": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933", + "validatorAnnounce": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8" }, "signer": null, "protocol": "ethereum", @@ -55,7 +55,7 @@ "url": "" }, "index": { - "from": "23" + "from": "27" } } }, diff --git a/rust/config/testnet3/testnet3_config.json b/rust/config/testnet3/testnet3_config.json index a07215166..e53d0e8c4 100644 --- a/rust/config/testnet3/testnet3_config.json +++ b/rust/config/testnet3/testnet3_config.json @@ -6,9 +6,10 @@ "domain": "44787", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0x4D06A1671A2a345B14B15cbD50027979A5D1d8C9" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "0", "connection": { @@ -17,17 +18,17 @@ }, "index": { "from": "14863532" - }, - "signer": null + } }, "fuji": { "name": "fuji", "domain": "43113", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0xD713Db664509bd057aC2b378F4B65Db468F634A5" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "3", "connection": { @@ -36,17 +37,17 @@ }, "index": { "from": "16330615" - }, - "signer": null + } }, "mumbai": { "name": "mumbai", "domain": "80001", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0xd71f1A64659beC0781b2aa21bc7a72F7290F6Bf3" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "32", "connection": { @@ -55,17 +56,17 @@ }, "index": { "from": "29390033" - }, - "signer": null + } }, "bsctestnet": { "name": "bsctestnet", "domain": "97", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0x34add51924C500b4428067E251168807b3f5faED" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "9", "connection": { @@ -74,17 +75,17 @@ }, "index": { "from": "25001629" - }, - "signer": null + } }, "goerli": { "name": "goerli", "domain": "5", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0x32B34F0D86b275b92e9289d9054Db5Ec32d2CC6C" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "2", "connection": { @@ -93,17 +94,17 @@ }, "index": { "from": "8039005" - }, - "signer": null + } }, "moonbasealpha": { "name": "moonbasealpha", "domain": "1287", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0xec8875C7cE0a814A56654618D366641859F32C7A" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "1", "connection": { @@ -112,17 +113,17 @@ }, "index": { "from": "3310405" - }, - "signer": null + } }, "optimismgoerli": { "name": "optimismgoerli", "domain": "420", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0x47384E33E67007B7fE4326fb096Bdf9CbA7AB6E4" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "1", "connection": { @@ -131,17 +132,17 @@ }, "index": { "from": "3055263" - }, - "signer": null + } }, "arbitrumgoerli": { "name": "arbitrumgoerli", "domain": "421613", "addresses": { "mailbox": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", - "interchainGasPaymaster": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "multisigIsm": "0x47384E33E67007B7fE4326fb096Bdf9CbA7AB6E4" + "interchainGasPaymaster": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655" }, + "signer": null, "protocol": "ethereum", "finalityBlocks": "1", "connection": { @@ -150,8 +151,7 @@ }, "index": { "from": "1941997" - }, - "signer": null + } } }, "db": "db_path", diff --git a/solidity/.gas-snapshot b/solidity/.gas-snapshot index 66e6489d7..8bb230e96 100644 --- a/solidity/.gas-snapshot +++ b/solidity/.gas-snapshot @@ -1,5 +1,5 @@ InterchainAccountRouterTest:testCannotSetOwner(address) (runs: 256, μ: 476268, ~: 476268) -InterchainAccountRouterTest:testCannotSetOwnerTwice(address) (runs: 256, μ: 625087, ~: 625398) +InterchainAccountRouterTest:testCannotSetOwnerTwice(address) (runs: 256, μ: 624931, ~: 625398) InterchainAccountRouterTest:testOwner() (gas: 210427) InterchainAccountRouterTest:testSetOwner(address) (runs: 256, μ: 510691, ~: 510691) InterchainQueryRouterTest:testCannotCallbackReverting() (gas: 1478492) @@ -15,11 +15,18 @@ LiquidityLayerRouterTest:testDispatchWithTokensTransfersOnDestination() (gas: 78 LiquidityLayerRouterTest:testProcessingRevertsIfBridgeAdapterReverts() (gas: 596406) LiquidityLayerRouterTest:testSendToRecipientWithoutHandleWhenSpecifyingNoMessage() (gas: 1055878) LiquidityLayerRouterTest:testSetLiquidityLayerAdapter() (gas: 23363) -MessagingTest:testSendMessage(string) (runs: 256, μ: 278528, ~: 295976) +MessagingTest:testSendMessage(string) (runs: 256, μ: 279236, ~: 295976) PausableReentrancyGuardTest:testNonreentrant() (gas: 14428) PausableReentrancyGuardTest:testNonreentrantNotPaused() (gas: 14163) PausableReentrancyGuardTest:testPause() (gas: 13635) ValidatorAnnounceTest:testAnnounce() (gas: 245547) +OverheadIgpTest:testDestinationGasAmount() (gas: 33814) +OverheadIgpTest:testDestinationGasAmountWhenOverheadNotSet() (gas: 7912) +OverheadIgpTest:testInnerIgpSet() (gas: 7632) +OverheadIgpTest:testPayForGas() (gas: 65205) +OverheadIgpTest:testQuoteGasPayment() (gas: 42672) +OverheadIgpTest:testSetDestinationGasAmounts() (gas: 63435) +OverheadIgpTest:testSetDestinationGasAmountsNotOwner() (gas: 12018) PortalAdapterTest:testAdapter(uint256) (runs: 256, μ: 135467, ~: 135583) PortalAdapterTest:testReceivingRevertsWithoutTransferCompletion(uint256) (runs: 256, μ: 140406, ~: 140522) PortalAdapterTest:testReceivingWorks(uint256) (runs: 256, μ: 229403, ~: 229520) diff --git a/solidity/contracts/Mailbox.sol b/solidity/contracts/Mailbox.sol index 8ed69c3b6..06c99082d 100644 --- a/solidity/contracts/Mailbox.sol +++ b/solidity/contracts/Mailbox.sol @@ -107,7 +107,6 @@ contract Mailbox is // ============ Constructor ============ - // solhint-disable-next-line no-empty-blocks constructor(uint32 _localDomain) { localDomain = _localDomain; } diff --git a/solidity/contracts/InterchainGasPaymaster.sol b/solidity/contracts/igps/InterchainGasPaymaster.sol similarity index 93% rename from solidity/contracts/InterchainGasPaymaster.sol rename to solidity/contracts/igps/InterchainGasPaymaster.sol index d4e13719d..aad24109a 100644 --- a/solidity/contracts/InterchainGasPaymaster.sol +++ b/solidity/contracts/igps/InterchainGasPaymaster.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.0; // ============ Internal Imports ============ -import {IInterchainGasPaymaster} from "../interfaces/IInterchainGasPaymaster.sol"; +import {IInterchainGasPaymaster} from "../../interfaces/IInterchainGasPaymaster.sol"; // ============ External Imports ============ import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; @@ -28,7 +28,6 @@ contract InterchainGasPaymaster is IInterchainGasPaymaster, OwnableUpgradeable { // ============ Constructor ============ - // solhint-disable-next-line no-empty-blocks constructor() { initialize(); // allows contract to be used without proxying } @@ -42,6 +41,8 @@ contract InterchainGasPaymaster is IInterchainGasPaymaster, OwnableUpgradeable { /** * @notice Deposits msg.value as a payment for the relaying of a message * to its destination chain. + * @dev Overpayment will result in a refund of native tokens to the _refundAddress. + * Callers should be aware that this may present reentrancy issues. * @param _messageId The ID of the message to pay for. * @param _destinationDomain The domain of the message's destination chain. * @param _gasAmount The amount of destination gas to pay for. Currently unused. @@ -64,7 +65,6 @@ contract InterchainGasPaymaster is IInterchainGasPaymaster, OwnableUpgradeable { uint256 _overpayment = msg.value - _requiredPayment; if (_overpayment > 0) { (bool _success, ) = _refundAddress.call{value: _overpayment}(""); - // TODO reconsider this? require(_success, "Interchain gas payment refund failed"); } diff --git a/solidity/contracts/igps/OverheadIgp.sol b/solidity/contracts/igps/OverheadIgp.sol new file mode 100644 index 000000000..44f354145 --- /dev/null +++ b/solidity/contracts/igps/OverheadIgp.sol @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +pragma solidity >=0.8.0; + +// ============ Internal Imports ============ +import {IInterchainGasPaymaster} from "../../interfaces/IInterchainGasPaymaster.sol"; +// ============ External Imports ============ +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; + +/** + * @notice An IGP that adds configured gas overheads to gas amounts and forwards + * calls to an "inner" IGP. + * @dev The intended use of this contract is to store overhead gas amounts for destination + * domains, e.g. Mailbox and/or ISM gas usage, such that users of this IGP are only required + * to specify the gas amount used by their own applications. + */ +contract OverheadIgp is IInterchainGasPaymaster, Ownable { + // ============ Constants ============ + + /// @notice The IGP that is called when paying for or quoting gas + /// after applying overhead gas amounts. + IInterchainGasPaymaster public immutable innerIgp; + + // ============ Public Storage ============ + + /// @notice Destination domain => overhead gas amount on that domain. + mapping(uint32 => uint256) public destinationGasOverhead; + + // ============ Events ============ + + /** + * @notice Emitted when an entry in the destinationGasOverhead mapping is set. + * @param domain The destination domain. + * @param gasOverhead The gas overhead amount on that domain. + */ + event DestinationGasOverheadSet(uint32 indexed domain, uint256 gasOverhead); + + struct DomainConfig { + uint32 domain; + uint256 gasOverhead; + } + + // ============ Constructor ============ + + constructor(address _innerIgp) { + innerIgp = IInterchainGasPaymaster(_innerIgp); + } + + // ============ External Functions ============ + + /** + * @notice Adds the stored destinationGasOverhead to the _gasAmount and forwards the + * call to the innerIgp's `payForGas` function. + * @param _messageId The ID of the message to pay for. + * @param _destinationDomain The domain of the message's destination chain. + * @param _gasAmount The amount of destination gas to pay for. This should not + * consider any gas that is accounted for in the stored destinationGasOverhead. + * @param _refundAddress The address to refund any overpayment to. + */ + function payForGas( + bytes32 _messageId, + uint32 _destinationDomain, + uint256 _gasAmount, + address _refundAddress + ) external payable { + innerIgp.payForGas{value: msg.value}( + _messageId, + _destinationDomain, + destinationGasAmount(_destinationDomain, _gasAmount), + _refundAddress + ); + } + + /** + * @notice Sets destination gas overheads for multiple domains. + * @dev Only callable by the owner. + * @param configs A list of destination domains and gas overheads. + */ + function setDestinationGasOverheads(DomainConfig[] calldata configs) + external + onlyOwner + { + for (uint256 i; i < configs.length; i++) { + _setDestinationGasOverhead(configs[i]); + } + } + + // ============ Public Functions ============ + + /** + * @notice Adds the stored destinationGasOverhead to the _gasAmount and forwards the + * call to the innerIgp's `quoteGasPayment` function. + * @param _destinationDomain The domain of the message's destination chain. + * @param _gasAmount The amount of destination gas to pay for. This should not + * consider any gas that is accounted for in the stored destinationGasOverhead. + * @return The amount of native tokens required to pay for interchain gas. + */ + function quoteGasPayment(uint32 _destinationDomain, uint256 _gasAmount) + public + view + returns (uint256) + { + return + innerIgp.quoteGasPayment( + _destinationDomain, + destinationGasAmount(_destinationDomain, _gasAmount) + ); + } + + /** + * @notice Returns the stored destinationGasOverhead added to the _gasAmount. + * @dev If there is no stored destinationGasOverhead, 0 is used. + * @param _destinationDomain The domain of the message's destination chain. + * @param _gasAmount The amount of destination gas to pay for. This should not + * consider any gas that is accounted for in the stored destinationGasOverhead. + * @return The stored destinationGasOverhead added to the _gasAmount. + */ + function destinationGasAmount(uint32 _destinationDomain, uint256 _gasAmount) + public + view + returns (uint256) + { + return destinationGasOverhead[_destinationDomain] + _gasAmount; + } + + /** + * @notice Sets the destination gas overhead for a single domain. + * @param config The destination domain and gas overhead. + */ + function _setDestinationGasOverhead(DomainConfig calldata config) internal { + destinationGasOverhead[config.domain] = config.gasOverhead; + emit DestinationGasOverheadSet(config.domain, config.gasOverhead); + } +} diff --git a/solidity/contracts/mock/MockHyperlaneEnvironment.sol b/solidity/contracts/mock/MockHyperlaneEnvironment.sol index 6d218325c..07ffec22b 100644 --- a/solidity/contracts/mock/MockHyperlaneEnvironment.sol +++ b/solidity/contracts/mock/MockHyperlaneEnvironment.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.13; import "./MockMailbox.sol"; import "../middleware/InterchainQueryRouter.sol"; -import "../InterchainGasPaymaster.sol"; +import "../igps/InterchainGasPaymaster.sol"; import "../test/TestIsm.sol"; import {TypeCasts} from "../libs/TypeCasts.sol"; diff --git a/solidity/contracts/test/LightTestRecipient.sol b/solidity/contracts/test/LightTestRecipient.sol new file mode 100644 index 000000000..eb351da4a --- /dev/null +++ b/solidity/contracts/test/LightTestRecipient.sol @@ -0,0 +1,12 @@ +import "./TestRecipient.sol"; + +contract LightTestRecipient is TestRecipient { + // solhint-disable-next-line no-empty-blocks + function handle( + uint32 _origin, + bytes32 _sender, + bytes calldata _data + ) external override { + // do nothing + } +} diff --git a/solidity/contracts/test/TestRecipient.sol b/solidity/contracts/test/TestRecipient.sol index b7ad587b8..2db1f5b1b 100644 --- a/solidity/contracts/test/TestRecipient.sol +++ b/solidity/contracts/test/TestRecipient.sol @@ -31,7 +31,7 @@ contract TestRecipient is uint32 _origin, bytes32 _sender, bytes calldata _data - ) external override { + ) external virtual override { emit ReceivedMessage(_origin, _sender, string(_data)); lastSender = _sender; lastData = _data; diff --git a/solidity/test/igps/OverheadIgp.t.sol b/solidity/test/igps/OverheadIgp.t.sol new file mode 100644 index 000000000..da11df5b9 --- /dev/null +++ b/solidity/test/igps/OverheadIgp.t.sol @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.13; + +import {Test} from "forge-std/Test.sol"; +import {OverheadIgp} from "../../contracts/igps/OverheadIgp.sol"; +import {InterchainGasPaymaster} from "../../contracts/igps/InterchainGasPaymaster.sol"; + +contract OverheadIgpTest is Test { + OverheadIgp igp; + + InterchainGasPaymaster innerIgp; + + bytes32 constant testMessageId = + bytes32( + 0xf00000000000000000000000000000000000000000000000000000000000000f + ); + uint32 constant testDestinationDomain = 1234; + uint256 constant testGasOverhead = 123000; + uint256 constant testGasAmount = 50000; + + address constant nonOwner = 0xCAfEcAfeCAfECaFeCaFecaFecaFECafECafeCaFe; + + event InnerIgpSet(address innerIgp); + event DestinationGasOverheadSet(uint32 indexed domain, uint256 gasOverhead); + + function setUp() public { + innerIgp = new InterchainGasPaymaster(); + igp = new OverheadIgp(address(innerIgp)); + } + + function testInnerIgpSet() public { + assertEq(address(igp.innerIgp()), address(innerIgp)); + } + + function testPayForGas() public { + setTestDestinationGasOverhead(); + + uint256 testPayment = 123456789; + + vm.expectCall( + address(innerIgp), + testPayment, + abi.encodeCall( + innerIgp.payForGas, + ( + testMessageId, + testDestinationDomain, + testGasOverhead + testGasAmount, + msg.sender + ) + ) + ); + + igp.payForGas{value: testPayment}( + testMessageId, + testDestinationDomain, + testGasAmount, + msg.sender + ); + } + + function testQuoteGasPayment() public { + setTestDestinationGasOverhead(); + + vm.expectCall( + address(innerIgp), + abi.encodeCall( + innerIgp.quoteGasPayment, + (testDestinationDomain, testGasOverhead + testGasAmount) + ) + ); + + igp.quoteGasPayment(testDestinationDomain, testGasAmount); + } + + function testDestinationGasAmount() public { + setTestDestinationGasOverhead(); + + assertEq( + igp.destinationGasAmount(testDestinationDomain, testGasAmount), + testGasOverhead + testGasAmount + ); + } + + // Test that it doesn't revert, and just doesn't add any value to the + // provided gas amount + function testDestinationGasAmountWhenOverheadNotSet() public { + assertEq( + igp.destinationGasAmount(testDestinationDomain, testGasAmount), + testGasAmount + ); + } + + function testSetDestinationGasAmounts() public { + OverheadIgp.DomainConfig[] + memory configs = new OverheadIgp.DomainConfig[](2); + configs[0] = OverheadIgp.DomainConfig( + testDestinationDomain, + testGasOverhead + ); + configs[1] = OverheadIgp.DomainConfig(4321, 432100); + + // Topic 0 = event signature + // Topic 1 = indexed domain + // Topic 2 = not set + // Data = gas amount + vm.expectEmit(true, true, false, true); + emit DestinationGasOverheadSet( + configs[0].domain, + configs[0].gasOverhead + ); + vm.expectEmit(true, true, false, true); + emit DestinationGasOverheadSet( + configs[1].domain, + configs[1].gasOverhead + ); + + igp.setDestinationGasOverheads(configs); + } + + function testSetDestinationGasAmountsNotOwner() public { + OverheadIgp.DomainConfig[] + memory configs = new OverheadIgp.DomainConfig[](2); + configs[0] = OverheadIgp.DomainConfig( + testDestinationDomain, + testGasOverhead + ); + configs[1] = OverheadIgp.DomainConfig(4321, 432100); + + vm.expectRevert("Ownable: caller is not the owner"); + vm.prank(nonOwner); + igp.setDestinationGasOverheads(configs); + } + + // ============ Helper Functions ============ + + function setTestDestinationGasOverhead() internal { + OverheadIgp.DomainConfig[] + memory configs = new OverheadIgp.DomainConfig[](1); + configs[0] = OverheadIgp.DomainConfig( + testDestinationDomain, + testGasOverhead + ); + igp.setDestinationGasOverheads(configs); + } +} diff --git a/solidity/test/interchainGasPaymaster.test.ts b/solidity/test/igps/interchainGasPaymaster.test.ts similarity index 99% rename from solidity/test/interchainGasPaymaster.test.ts rename to solidity/test/igps/interchainGasPaymaster.test.ts index 31739d68e..abeb5ed38 100644 --- a/solidity/test/interchainGasPaymaster.test.ts +++ b/solidity/test/igps/interchainGasPaymaster.test.ts @@ -6,7 +6,7 @@ import { ethers } from 'hardhat'; import { InterchainGasPaymaster, InterchainGasPaymaster__factory, -} from '../types'; +} from '../../types'; const MESSAGE_ID = '0x6ae9a99190641b9ed0c07143340612dde0e9cb7deaa5fe07597858ae9ba5fd7f'; diff --git a/solidity/test/isms/multisigIsm.test.ts b/solidity/test/isms/multisigIsm.test.ts index da22c1482..48dfb8f4e 100644 --- a/solidity/test/isms/multisigIsm.test.ts +++ b/solidity/test/isms/multisigIsm.test.ts @@ -6,6 +6,7 @@ import { ethers } from 'hardhat'; import { Validator, types, utils } from '@hyperlane-xyz/utils'; import { + LightTestRecipient__factory, TestMailbox, TestMailbox__factory, TestMultisigIsm, @@ -487,4 +488,78 @@ describe('MultisigIsm', async () => { } }); }); + + // Manually unskip to run gas instrumentation. + // The JSON that's logged can then be copied to `typescript/sdk/src/consts/multisigIsmVerifyCosts.json`, + // which is ultimately used for configuring the default ISM overhead IGP. + describe.skip('#verify gas instrumentation for the OverheadISM', () => { + const MAX_VALIDATOR_COUNT = 18; + let metadata: string, message: string, recipient: string; + + const gasOverhead: Record> = {}; + + before(async () => { + const recipientF = new LightTestRecipient__factory(signer); + recipient = (await recipientF.deploy()).address; + }); + + after(() => { + // eslint-disable-next-line no-console + console.log('Instrumented gas overheads:'); + // eslint-disable-next-line no-console + console.log(JSON.stringify(gasOverhead)); + }); + + for ( + let numValidators = 1; + numValidators <= MAX_VALIDATOR_COUNT; + numValidators++ + ) { + for (let threshold = 1; threshold <= numValidators; threshold++) { + it(`instrument mailbox.process gas costs with ${threshold} of ${numValidators} multisig`, async () => { + const adjustedValidators = validators.slice(0, numValidators); + // Must be done sequentially so gas estimation is correct + // and so that signatures are produced in the same order. + for (const v of adjustedValidators) { + await multisigIsm.enrollValidator(ORIGIN_DOMAIN, v.address); + } + + await multisigIsm.setThreshold(ORIGIN_DOMAIN, threshold); + + const maxBodySize = await mailbox.MAX_MESSAGE_BODY_BYTES(); + // The max body is used to estimate an upper bound on gas usage. + const maxBody = '0x' + 'AA'.repeat(maxBodySize.toNumber()); + + ({ message, metadata } = await dispatchMessageAndReturnMetadata( + mailbox, + multisigIsm, + DESTINATION_DOMAIN, + recipient, + maxBody, + adjustedValidators, + threshold, + false, + )); + + const mailboxFactory = new TestMailbox__factory(signer); + const destinationMailbox = await mailboxFactory.deploy( + DESTINATION_DOMAIN, + ); + await destinationMailbox.initialize( + signer.address, + multisigIsm.address, + ); + const gas = await destinationMailbox.estimateGas.process( + metadata, + message, + ); + + if (gasOverhead[numValidators] === undefined) { + gasOverhead[numValidators] = {}; + } + gasOverhead[numValidators][threshold] = gas.toNumber(); + }); + } + } + }); }); diff --git a/solidity/test/lib/mailboxes.ts b/solidity/test/lib/mailboxes.ts index f72133fae..62a03a32d 100644 --- a/solidity/test/lib/mailboxes.ts +++ b/solidity/test/lib/mailboxes.ts @@ -21,11 +21,12 @@ export const dispatchMessage = async ( destination: number, recipient: string, messageStr: string, + utf8 = true, ) => { const tx = await mailbox.dispatch( destination, recipient, - ethers.utils.toUtf8Bytes(messageStr), + utf8 ? ethers.utils.toUtf8Bytes(messageStr) : messageStr, ); const receipt = await tx.wait(); const dispatch = receipt.events![0] as DispatchEvent; @@ -38,6 +39,7 @@ export const dispatchMessageAndReturnProof = async ( destination: number, recipient: string, messageStr: string, + utf8 = true, ): Promise => { const nonce = await mailbox.count(); const { message } = await dispatchMessage( @@ -45,6 +47,7 @@ export const dispatchMessageAndReturnProof = async ( destination, utils.addressToBytes32(recipient), messageStr, + utf8, ); const messageId = utils.messageId(message); const proof = await mailbox.proof(); @@ -81,6 +84,8 @@ export async function dispatchMessageAndReturnMetadata( recipient: string, messageStr: string, orderedValidators: Validator[], + threshold?: number, + utf8 = true, ): Promise { // Checkpoint indices are 0 indexed, so we pull the count before // we dispatch the message. @@ -90,6 +95,7 @@ export async function dispatchMessageAndReturnMetadata( destination, recipient, messageStr, + utf8, ); const root = await mailbox.root(); const signatures = await signCheckpoint( diff --git a/typescript/helloworld b/typescript/helloworld index 17a4533f4..e30598d13 160000 --- a/typescript/helloworld +++ b/typescript/helloworld @@ -1 +1 @@ -Subproject commit 17a4533f40b2144afd47fc3c734e228b7991e369 +Subproject commit e30598d13ba9a773f7e62c2029c61d052194f8b7 diff --git a/typescript/infra/config/environments/mainnet2/core/verification/verification.json b/typescript/infra/config/environments/mainnet2/core/verification/verification.json index 3890fd4a1..875fe7aca 100644 --- a/typescript/infra/config/environments/mainnet2/core/verification/verification.json +++ b/typescript/infra/config/environments/mainnet2/core/verification/verification.json @@ -47,6 +47,36 @@ "address": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xeee36EA559250cF4145D9d034B75fDC61E2D7Dcf", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" } ], "ethereum": [ @@ -85,6 +115,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xA4b2951bCd4B0ec43f2B4Deecd639551dC165E23", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ], "avalanche": [ @@ -123,6 +183,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0x35BCCf7296012e1778148DB6bFD7088a75a3949A", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ], "polygon": [ @@ -161,6 +251,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xBF30B4F328d1F6AC47ecCcF23836F3CbB2422c9f", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ], "bsc": [ @@ -199,6 +319,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xF1517508Ed21a1507703F1a21420170C3963dfa0", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ], "arbitrum": [ @@ -237,6 +387,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xDfDC87F1D1fCc4ca4078d2F42A61D0E0B72FF09A", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ], "optimism": [ @@ -275,6 +455,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xE10dE0D4F9889597786509600A92Ae597551A853", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ], "moonbeam": [ @@ -313,6 +523,36 @@ "address": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "InterchainGasPaymaster", + "address": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "DeployerOwnedProxyAdmin", + "address": "0xC4eD4C2090f43D7d42902A7301aA4f997dF79BEd", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000006ca0b6d22da47f091b7613223cd4bb03a2d77918" + }, + { + "name": "ValidatorAnnounce", + "address": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", + "isProxy": false, + "constructorArguments": "0x00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c70" } ] } diff --git a/typescript/infra/config/environments/testnet3/core/verification/verification.json b/typescript/infra/config/environments/testnet3/core/verification/verification.json index 1299a9f60..2e5224aa4 100644 --- a/typescript/infra/config/environments/testnet3/core/verification/verification.json +++ b/typescript/infra/config/environments/testnet3/core/verification/verification.json @@ -13,28 +13,40 @@ "isProxy": false }, { - "name": "InterchainGasPaymaster", - "address": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030", + "name": "Mailbox", + "address": "0x39b3cb005C4225B88A8b3a090563e2e763407222", "isProxy": false, - "constructorArguments": "0x" + "constructorArguments": "0x000000000000000000000000000000000000000000000000000000000000aef3" }, { "name": "TransparentUpgradeableProxy", - "address": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", + "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" }, { - "name": "Mailbox", - "address": "0x39b3cb005C4225B88A8b3a090563e2e763407222", + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", "isProxy": false, - "constructorArguments": "0x000000000000000000000000000000000000000000000000000000000000aef3" + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" }, { "name": "TransparentUpgradeableProxy", - "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "fuji": [ @@ -73,6 +85,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "mumbai": [ @@ -111,6 +147,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "bsctestnet": [ @@ -149,6 +209,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "goerli": [ @@ -187,6 +271,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "moonbasealpha": [ @@ -225,6 +333,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "optimismgoerli": [ @@ -263,6 +395,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ], "arbitrumgoerli": [ @@ -301,6 +457,30 @@ "address": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "isProxy": true, "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "ValidatorAnnounce", + "address": "0x81c196606092fF966446078BE3033F464Efc8655", + "isProxy": false, + "constructorArguments": "0x000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685" + }, + { + "name": "InterchainGasPaymaster", + "address": "0x94096588fc66f0D3a348306c2555d474b3B6302a", + "isProxy": false, + "constructorArguments": "0x" + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "isProxy": true, + "constructorArguments": "0x000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a000000000000000000000000c97d8e6f57b0d64971453ddc6eb8483fec9d163a00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000" + }, + { + "name": "DefaultIsmInterchainGasPaymaster", + "address": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", + "isProxy": false, + "constructorArguments": "0x0000000000000000000000008f9c3888bfc8a5b25aed115a82ecbb788b196d2a" } ] } diff --git a/typescript/infra/src/core/deploy.ts b/typescript/infra/src/core/deploy.ts index 7ff62a20e..390090500 100644 --- a/typescript/infra/src/core/deploy.ts +++ b/typescript/infra/src/core/deploy.ts @@ -3,6 +3,7 @@ import { ethers } from 'ethers'; import { InterchainGasPaymaster, Mailbox, + OverheadIgp, ProxyAdmin, ValidatorAnnounce, } from '@hyperlane-xyz/core'; @@ -46,12 +47,29 @@ export class HyperlaneCoreInfraDeployer< const deployOpts = { create2Salt: ethers.utils.solidityKeccak256( ['string', 'string', 'uint8'], - [this.environment, 'interchainGasPaymaster', 1], + [this.environment, 'interchainGasPaymaster', 6], ), }; return super.deployInterchainGasPaymaster(chain, proxyAdmin, deployOpts); } + async deployDefaultIsmInterchainGasPaymaster( + chain: LocalChain, + interchainGasPaymasterAddress: types.Address, + ): Promise { + const deployOpts = { + create2Salt: ethers.utils.solidityKeccak256( + ['string', 'string', 'uint8'], + [this.environment, 'defaultIsmInterchainGasPaymaster', 4], + ), + }; + return super.deployDefaultIsmInterchainGasPaymaster( + chain, + interchainGasPaymasterAddress, + deployOpts, + ); + } + async deployMailbox( chain: LocalChain, defaultIsmAddress: types.Address, diff --git a/typescript/sdk/src/consts/environments/mainnet.json b/typescript/sdk/src/consts/environments/mainnet.json index f15e72a8b..e34b50f73 100644 --- a/typescript/sdk/src/consts/environments/mainnet.json +++ b/typescript/sdk/src/consts/environments/mainnet.json @@ -1,138 +1,154 @@ { "celo": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0x90f9a2E9eCe93516d65FdaB726a3c62F5960a1b9", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xde86327fbfd04c4ea11dc0f270da6083534c2582", - "implementation": "0x388411dab2865c9e9f562618d4252aa2808b8bb0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0x3f23f4594e1cCA1734d0A7F15495bF3C4cdb55db" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0x9bDE63104EE030d9De419EEd6bA7D14b86D6fE3f", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "ethereum": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0x75EE15Ee1B4A75Fa3e2fDF5DF3253c25599cc659", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0xcC48E741996B0d77b38d9dC2bf9217e65E368E06" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0xec48E52D960E54a179f70907bF28b105813877ee", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", - "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", - "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5" + "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", + "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "avalanche": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0xd7CF8c05fd81b8cA7CfF8E6C49B08a9D63265c9B", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0xFB4712576680002C2690f66C0c5eedEa5260DBfB" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0xeE80ab5B563cB3825133f29502bA34eD3707cb8C", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "polygon": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0xC4F7590C5d30BE959225dC75640657954A86b980", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0xd63C65e84059b9d32bc979016bbC2976138da694" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0x61A80297e77FC5395bd6Ff60EEacf7CD4f18d4a4", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "bsc": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0x65993Af9D0D3a64ec77590db7ba362D6eB78eF70", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0x961877927Ec6B0a9133DbBb1d0232CB6A5C28b54" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0x3a579C0bd04FC4C98A8D70EEABD9094e7be4B26D", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "arbitrum": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0x80Cebd56A65e46c474a1A101e89E76C4c51D179c", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0x4B5bc88A0D383c3C6E72D9889afaBB12A5dCCCfa" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0x32B92bd3e5045B67FDD8dbb7A58D25980836d04C", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", - "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", - "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5" + "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", + "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "optimism": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0xE047cb95FB3b7117989e911c6afb34771183fC35", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0x6989120F7042Df0895dBE856b73A31E4cD0A2Cad" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0xAab1D11E2063Bae5EB01fa946cA8d2FDe3db05D5", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", - "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", - "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5" + "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", + "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" }, "moonbeam": { + "validatorAnnounce": "0xB5bc6369bc2Dc8969B18f6C25488EC0a38cA637f", "proxyAdmin": "0x6A9cdA3dd1F593983BFd142Eb35e6ce4137bd5ce", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xdE86327fBFD04C4eA11dC0F270DA6083534c2582", - "implementation": "0x388411DAb2865c9E9F562618D4252AA2808b8bB0" - }, "mailbox": { "kind": "Transparent", "proxy": "0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70", "implementation": "0x1747Fa1b94862C8648BF0637767315FD1Fa2106C" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x6cA0B6D22da47f091B7613223cD4BB03a2d77918", + "implementation": "0xAb311C7DAE251C1eB24c5A5409d47a415828d5E5" + }, + "defaultIsmInterchainGasPaymaster": "0x56f52c0A1ddcD557285f7CBc782D3d83096CE1Cc", "multisigIsm": "0xf3b1F415740A26568C45b1c771A737E31C198F09", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", - "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", - "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5" + "interchainAccountRouter": "0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5", + "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784" } } diff --git a/typescript/sdk/src/consts/environments/test.json b/typescript/sdk/src/consts/environments/test.json index f82547683..526c1a33f 100644 --- a/typescript/sdk/src/consts/environments/test.json +++ b/typescript/sdk/src/consts/environments/test.json @@ -1,47 +1,50 @@ { "test1": { - "validatorAnnounce": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", + "validatorAnnounce": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", "proxyAdmin": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", + "mailbox": { + "kind": "Transparent", + "proxy": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", + "implementation": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" + }, "interchainGasPaymaster": { "kind": "Transparent", "proxy": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", "implementation": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" }, - "mailbox": { - "kind": "Transparent", - "proxy": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", - "implementation": "0x0165878A594ca255338adfa4d48449f69242Eb8F" - }, + "defaultIsmInterchainGasPaymaster": "0x0165878A594ca255338adfa4d48449f69242Eb8F", "multisigIsm": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, "test2": { - "validatorAnnounce": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE", - "proxyAdmin": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", - "interchainGasPaymaster": { + "validatorAnnounce": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44", + "proxyAdmin": "0x0B306BF915C4d645ff596e518fAf3F9669b97016", + "mailbox": { "kind": "Transparent", - "proxy": "0x9A676e781A523b5d0C0e43731313A708CB607508", - "implementation": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" + "proxy": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1", + "implementation": "0x59b670e9fA9D0A427751Af201D676719a970857b" }, - "mailbox": { + "interchainGasPaymaster": { "kind": "Transparent", - "proxy": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", - "implementation": "0x0B306BF915C4d645ff596e518fAf3F9669b97016" + "proxy": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE", + "implementation": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1" }, - "multisigIsm": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" + "defaultIsmInterchainGasPaymaster": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed", + "multisigIsm": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0" }, "test3": { - "validatorAnnounce": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F", - "proxyAdmin": "0x59b670e9fA9D0A427751Af201D676719a970857b", - "interchainGasPaymaster": { + "validatorAnnounce": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8", + "proxyAdmin": "0x09635F643e140090A9A8Dcd712eD6285858ceBef", + "mailbox": { "kind": "Transparent", - "proxy": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44", - "implementation": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1" + "proxy": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9", + "implementation": "0x9E545E3C0baAB3E08CdfD552C960A1050f373042" }, - "mailbox": { + "interchainGasPaymaster": { "kind": "Transparent", - "proxy": "0x4A679253410272dd5232B3Ff7cF5dbB88f295319", - "implementation": "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f" + "proxy": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933", + "implementation": "0xc5a5C42992dECbae36851359345FE25997F5C42d" }, - "multisigIsm": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed" + "defaultIsmInterchainGasPaymaster": "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E", + "multisigIsm": "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f" } } diff --git a/typescript/sdk/src/consts/environments/testnet.json b/typescript/sdk/src/consts/environments/testnet.json index 2d685782f..9a7b6dcd4 100644 --- a/typescript/sdk/src/consts/environments/testnet.json +++ b/typescript/sdk/src/consts/environments/testnet.json @@ -1,135 +1,151 @@ { "alfajores": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0x4e4D563e2cBFC35c4BC16003685443Fae2FA702f", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x39b3cb005C4225B88A8b3a090563e2e763407222" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0x4D06A1671A2a345B14B15cbD50027979A5D1d8C9", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "fuji": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0x13474f85b808034C911B7697dee60B7d8d50ee36", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x3388A1D46337631F3597d50e98930B52eb9E710E" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0xD713Db664509bd057aC2b378F4B65Db468F634A5", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "mumbai": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0x96b49e136581f8dfF370aDB3015D48465572a318", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x179c2Da65187C2614FbeD3Af8eB3098FEEb0a958" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0xd71f1A64659beC0781b2aa21bc7a72F7290F6Bf3", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "bsctestnet": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0xfB149BC17dD3FE858fA64D678bA0c706DEac61eE", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x87891AA323d0c98D9A1F417E9F02219EBc4274CC" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0x34add51924C500b4428067E251168807b3f5faED", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "goerli": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0x8f919348F9C4619A196Acb5e377f49E5E2C0B569", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x1ADF2D247E08348D18d77e69D5807a413b92Fe8E" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0x32B34F0D86b275b92e9289d9054Db5Ec32d2CC6C", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "moonbasealpha": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0xEed449c54156163bf50CFf30408975AF43F43115", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0xC1081e289564fd20a4a93C00042692E168Fd0378" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0xec8875C7cE0a814A56654618D366641859F32C7A", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "optimismgoerli": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0xcD19Ff7306E04EA6b8f4B5Ab1c5A198c186aaB42", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x2D076fE2370950044572cB168924B8AffDA26689" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0x47384E33E67007B7fE4326fb096Bdf9CbA7AB6E4", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818" }, "arbitrumgoerli": { + "validatorAnnounce": "0x81c196606092fF966446078BE3033F464Efc8655", "proxyAdmin": "0xcD19Ff7306E04EA6b8f4B5Ab1c5A198c186aaB42", - "interchainGasPaymaster": { - "kind": "Transparent", - "proxy": "0xf857706CE59Cb7AE6df81Bbd0B0a656dB3e6beDA", - "implementation": "0x1a37635B78Dde4aCbedaFCdA365FB89dc3F3f030" - }, "mailbox": { "kind": "Transparent", "proxy": "0xCC737a94FecaeC165AbCf12dED095BB13F037685", "implementation": "0x0840f126eD0302B37d7476A303340a92B9eC0c5b" }, + "interchainGasPaymaster": { + "kind": "Transparent", + "proxy": "0x8f9C3888bFC8a5B25AED115A82eCbb788b196d2a", + "implementation": "0x94096588fc66f0D3a348306c2555d474b3B6302a" + }, + "defaultIsmInterchainGasPaymaster": "0xF90cB82a76492614D07B82a7658917f3aC811Ac1", "multisigIsm": "0x47384E33E67007B7fE4326fb096Bdf9CbA7AB6E4", "create2Factory": "0xc97D8e6f57b0d64971453dDc6EB8483fec9d163a", "interchainAccountRouter": "0xc61Bbf8eAb0b748Ecb532A7ffC49Ab7ca6D3a39D", diff --git a/typescript/sdk/src/consts/multisigIsmVerifyCosts.json b/typescript/sdk/src/consts/multisigIsmVerifyCosts.json new file mode 100644 index 000000000..6f54991be --- /dev/null +++ b/typescript/sdk/src/consts/multisigIsmVerifyCosts.json @@ -0,0 +1,209 @@ +{ + "1": { + "1": 151966 + }, + "2": { + "1": 152776, + "2": 159337 + }, + "3": { + "1": 153154, + "2": 159736, + "3": 166518 + }, + "4": { + "1": 153132, + "2": 160545, + "3": 166460, + "4": 173857 + }, + "5": { + "1": 153561, + "2": 160948, + "3": 166887, + "4": 174283, + "5": 180843 + }, + "6": { + "1": 154381, + "2": 160950, + "3": 167741, + "4": 174289, + "5": 181661, + "6": 187506 + }, + "7": { + "1": 154780, + "2": 161377, + "3": 168127, + "4": 174660, + "5": 182044, + "6": 187871, + "7": 195228 + }, + "8": { + "1": 154751, + "2": 162176, + "3": 168111, + "4": 175458, + "5": 182029, + "6": 188708, + "7": 195207, + "8": 202564 + }, + "9": { + "1": 155175, + "2": 162574, + "3": 168509, + "4": 175880, + "5": 182451, + "6": 189116, + "7": 195619, + "8": 202926, + "9": 209459 + }, + "10": { + "1": 155972, + "2": 162544, + "3": 169303, + "4": 175872, + "5": 183245, + "6": 189087, + "7": 196433, + "8": 202928, + "9": 210335, + "10": 216833 + }, + "11": { + "1": 156396, + "2": 162991, + "3": 169735, + "4": 176229, + "5": 183626, + "6": 189463, + "7": 196820, + "8": 203319, + "9": 210689, + "10": 217148, + "11": 223689 + }, + "12": { + "1": 156357, + "2": 163757, + "3": 169683, + "4": 177068, + "5": 183616, + "6": 190277, + "7": 196772, + "8": 204155, + "9": 210671, + "10": 218015, + "11": 223683, + "12": 231012 + }, + "13": { + "1": 156768, + "2": 164180, + "3": 170119, + "4": 177491, + "5": 184053, + "6": 190701, + "7": 197221, + "8": 204529, + "9": 211064, + "10": 217592, + "11": 224150, + "12": 231454, + "13": 237947 + }, + "14": { + "1": 157580, + "2": 164149, + "3": 170915, + "4": 177487, + "5": 184847, + "6": 190692, + "7": 198036, + "8": 204574, + "9": 211882, + "10": 217598, + "11": 224890, + "12": 231451, + "13": 238707, + "14": 245204 + }, + "15": { + "1": 158012, + "2": 164551, + "3": 171264, + "4": 177885, + "5": 185270, + "6": 191103, + "7": 198448, + "8": 204980, + "9": 212313, + "10": 217945, + "11": 225300, + "12": 231846, + "13": 239126, + "14": 245674, + "15": 252955 + }, + "16": { + "1": 158003, + "2": 164767, + "3": 171299, + "4": 178660, + "5": 185205, + "6": 191885, + "7": 198396, + "8": 205716, + "9": 212275, + "10": 218798, + "11": 225261, + "12": 232591, + "13": 239076, + "14": 246406, + "15": 252929, + "16": 260235 + }, + "17": { + "1": 158372, + "2": 165146, + "3": 171710, + "4": 179071, + "5": 185629, + "6": 192270, + "7": 198792, + "8": 206150, + "9": 212684, + "10": 219180, + "11": 225718, + "12": 233010, + "13": 239520, + "14": 246837, + "15": 253362, + "16": 260667, + "17": 266157 + }, + "18": { + "1": 159204, + "2": 165132, + "3": 172505, + "4": 179062, + "5": 186460, + "6": 192264, + "7": 199633, + "8": 206105, + "9": 213500, + "10": 219164, + "11": 226493, + "12": 232978, + "13": 240321, + "14": 246819, + "15": 254162, + "16": 260635, + "17": 266966, + "18": 273420 + } +} diff --git a/typescript/sdk/src/core/HyperlaneCore.ts b/typescript/sdk/src/core/HyperlaneCore.ts index ebeb5197b..9a5ef2f1c 100644 --- a/typescript/sdk/src/core/HyperlaneCore.ts +++ b/typescript/sdk/src/core/HyperlaneCore.ts @@ -79,7 +79,9 @@ export class HyperlaneCore< const contracts = this.getContracts(chain); return { mailbox: contracts.mailbox.address, - interchainGasPaymaster: contracts.interchainGasPaymaster.address, + // TODO allow this to be more easily changed + interchainGasPaymaster: + contracts.defaultIsmInterchainGasPaymaster.address, }; } diff --git a/typescript/sdk/src/core/contracts.ts b/typescript/sdk/src/core/contracts.ts index 6baeaed19..971c7f7a3 100644 --- a/typescript/sdk/src/core/contracts.ts +++ b/typescript/sdk/src/core/contracts.ts @@ -8,6 +8,8 @@ import { Mailbox__factory, MultisigIsm, MultisigIsm__factory, + OverheadIgp, + OverheadIgp__factory, ProxyAdmin, ProxyAdmin__factory, ValidatorAnnounce, @@ -16,11 +18,12 @@ import { import { ProxiedContract, TransparentProxyAddresses } from '../proxy'; -type ConnectionClientContracts = { +export type ConnectionClientContracts = { interchainGasPaymaster: ProxiedContract< InterchainGasPaymaster, TransparentProxyAddresses >; + defaultIsmInterchainGasPaymaster: OverheadIgp; }; export type CoreContracts = ConnectionClientContracts & { @@ -37,6 +40,7 @@ export const coreFactories = { create2Factory: new Create2Factory__factory(), proxyAdmin: new ProxyAdmin__factory(), interchainGasPaymaster: new InterchainGasPaymaster__factory(), + defaultIsmInterchainGasPaymaster: new OverheadIgp__factory(), multisigIsm: new MultisigIsm__factory(), mailbox: new Mailbox__factory(), }; diff --git a/typescript/sdk/src/deploy/HyperlaneDeployer.ts b/typescript/sdk/src/deploy/HyperlaneDeployer.ts index cb3c7127b..d08342260 100644 --- a/typescript/sdk/src/deploy/HyperlaneDeployer.ts +++ b/typescript/sdk/src/deploy/HyperlaneDeployer.ts @@ -5,9 +5,11 @@ import { Create2Factory__factory, Ownable, ProxyAdmin, + ProxyAdmin__factory, TransparentUpgradeableProxy, TransparentUpgradeableProxy__factory, } from '@hyperlane-xyz/core'; +import { types } from '@hyperlane-xyz/utils'; import { HyperlaneContract, @@ -108,11 +110,11 @@ export abstract class HyperlaneDeployer< return this.deployedContracts as ChainMap; } - protected async runIfOwner( + protected async runIfOwner( chain: Chain, ownable: Ownable, - fn: () => Promise, - ): Promise { + fn: () => Promise, + ): Promise { const dc = this.multiProvider.getChainConnection(chain); const address = await dc.signer!.getAddress(); const owner = await ownable.owner(); @@ -123,6 +125,7 @@ export abstract class HyperlaneDeployer< } else { this.logger('Owner and signer NOT equal, skipping', logObj); } + return undefined; } protected async deployContractFromFactory( @@ -280,12 +283,30 @@ export abstract class HyperlaneDeployer< const constructorArgs: Parameters< TransparentUpgradeableProxy__factory['deploy'] > = [CREATE2FACTORY_ADDRESS, CREATE2FACTORY_ADDRESS, '0x']; - // We set the initCallData to atomically change admin to the proxyAdmin + // The proxy admin during deployment must be owned by the deployer. + // If the canonical proxyAdmin isn't owned by the deployer, we use + // a temporary deployer-owned proxy admin. + // Note this requires the proxy contracts to ensure admin power has been + // transferred to the canonical proxy admin at some point in the future. + const proxyAdminOwner = await proxyAdmin.owner(); + const deployer = await this.multiProvider + .getChainSigner(chain) + .getAddress(); + let deployerOwnedProxyAdmin = proxyAdmin; + if (proxyAdminOwner.toLowerCase() !== deployer.toLowerCase()) { + deployerOwnedProxyAdmin = await this.deployContractFromFactory( + chain, + new ProxyAdmin__factory(), + 'DeployerOwnedProxyAdmin', + [], + ); + } + // We set the initCallData to atomically change admin to the deployer owned proxyAdmin // contract. const initCalldata = new TransparentUpgradeableProxy__factory().interface.encodeFunctionData( 'changeAdmin', - [proxyAdmin.address], + [deployerOwnedProxyAdmin.address], ); proxy = await this.deployContractFromFactory( chain, @@ -295,14 +316,22 @@ export abstract class HyperlaneDeployer< { ...deployOpts, initCalldata }, ); this.logger(`Upgrading and initializing transparent upgradable proxy`); - // We now have a deployed proxy admin'd by ProxyAdmin. + // We now have a deployed proxy admin'd by deployerOwnedProxyAdmin. // Upgrade its implementation and initialize it - await proxyAdmin.upgradeAndCall( + const upgradeAndCallTx = await deployerOwnedProxyAdmin.upgradeAndCall( proxy.address, implementation.address, initData, chainConnection.overrides, ); + await chainConnection.handleTx(upgradeAndCallTx); + // Change the proxy admin from deployerOwnedProxyAdmin to proxyAdmin if necessary. + await this.changeProxyAdmin( + chain, + proxy.address, + deployerOwnedProxyAdmin, + proxyAdmin, + ); } else { const constructorArgs: Parameters< TransparentUpgradeableProxy__factory['deploy'] @@ -376,6 +405,35 @@ export abstract class HyperlaneDeployer< return contract; } + /** + * Changes the proxyAdmin of `proxyAddress` from `currentProxyAdmin` to `desiredProxyAdmin` + * if the admin is not already the `desiredProxyAdmin`. + */ + async changeProxyAdmin( + chain: Chain, + proxyAddress: types.Address, + currentProxyAdmin: ProxyAdmin, + desiredProxyAdmin: ProxyAdmin, + ): Promise { + if ( + currentProxyAdmin.address.toLowerCase() === + desiredProxyAdmin.address.toLowerCase() + ) { + this.logger('Current proxy admin is the desired proxy admin'); + return; + } + this.logger( + `Transferring proxy admin from ${currentProxyAdmin} to ${desiredProxyAdmin}`, + ); + const chainConnection = this.multiProvider.getChainConnection(chain); + const changeAdminTx = await currentProxyAdmin.changeProxyAdmin( + proxyAddress, + desiredProxyAdmin.address, + chainConnection.overrides, + ); + await chainConnection.handleTx(changeAdminTx); + } + mergeWithExistingVerificationInputs( existingInputsMap: ChainMap, ): ChainMap { diff --git a/typescript/sdk/src/deploy/core/HyperlaneCoreChecker.ts b/typescript/sdk/src/deploy/core/HyperlaneCoreChecker.ts index 4624eaae5..4861c459e 100644 --- a/typescript/sdk/src/deploy/core/HyperlaneCoreChecker.ts +++ b/typescript/sdk/src/deploy/core/HyperlaneCoreChecker.ts @@ -79,6 +79,12 @@ export class HyperlaneCoreChecker< contracts.interchainGasPaymaster.addresses, contracts.proxyAdmin.address, ); + await this.checkProxiedContract( + chain, + 'DefaultIsmInterchainGasPaymaster', + contracts.interchainGasPaymaster.addresses, + contracts.proxyAdmin.address, + ); } async checkMultisigIsm(local: Chain): Promise { diff --git a/typescript/sdk/src/deploy/core/HyperlaneCoreDeployer.ts b/typescript/sdk/src/deploy/core/HyperlaneCoreDeployer.ts index 77930da36..c341e1107 100644 --- a/typescript/sdk/src/deploy/core/HyperlaneCoreDeployer.ts +++ b/typescript/sdk/src/deploy/core/HyperlaneCoreDeployer.ts @@ -5,13 +5,16 @@ import { InterchainGasPaymaster, Mailbox, MultisigIsm, + OverheadIgp, Ownable, + Ownable__factory, ProxyAdmin, ValidatorAnnounce, } from '@hyperlane-xyz/core'; import type { types } from '@hyperlane-xyz/utils'; import { chainMetadata } from '../../consts/chainMetadata'; +import multisigIsmVerifyCosts from '../../consts/multisigIsmVerifyCosts.json'; import { CoreContracts, coreFactories } from '../../core/contracts'; import { ChainNameToDomainId } from '../../domains'; import { MultiProvider } from '../../providers/MultiProvider'; @@ -31,6 +34,7 @@ export class HyperlaneCoreDeployer< typeof coreFactories > { startingBlockNumbers: ChainMap; + gasOverhead: ChainMap; constructor( multiProvider: MultiProvider, @@ -40,10 +44,24 @@ export class HyperlaneCoreDeployer< super(multiProvider, configMap, factoriesOverride, { logger: debug('hyperlane:CoreDeployer'), }); + this.gasOverhead = objMap(configMap, (chain, config) => { + const { validators, threshold } = config.multisigIsm; + const verifyCost = + // @ts-ignore + multisigIsmVerifyCosts[`${validators.length}`][`${threshold}`]; + if (!verifyCost) + throw new Error( + `Unknown verification cost for ${threshold} of ${validators.length}`, + ); + return { + domain: ChainNameToDomainId[chain], + gasOverhead: verifyCost, + }; + }); this.startingBlockNumbers = objMap(configMap, () => undefined); } - deployInterchainGasPaymaster( + async deployInterchainGasPaymaster( chain: LocalChain, proxyAdmin: ProxyAdmin, deployOpts?: DeployOptions, @@ -60,6 +78,72 @@ export class HyperlaneCoreDeployer< ); } + async deployDefaultIsmInterchainGasPaymaster( + chain: LocalChain, + interchainGasPaymasterAddress: types.Address, + deployOpts?: DeployOptions, + ): Promise { + const chainSigner = this.multiProvider.getChainSigner(chain); + const deployer = await chainSigner.getAddress(); + // Transfer ownership to the deployer so the destination gas overheads can be set + const initCalldata = Ownable__factory.createInterface().encodeFunctionData( + 'transferOwnership', + [deployer], + ); + const defaultIsmInterchainGasPaymaster = await this.deployContract( + chain, + 'defaultIsmInterchainGasPaymaster', + [interchainGasPaymasterAddress], + { + ...deployOpts, + initCalldata, + }, + ); + + const configChains = Object.keys(this.configMap) as Chain[]; + const chainConnection = this.multiProvider.getChainConnection(chain); + const remotes = this.multiProvider + .intersect(configChains, false) + .multiProvider.remoteChains(chain); + + // Only set gas overhead configs if they differ from what's on chain + const configs: OverheadIgp.DomainConfigStruct[] = []; + for (const remote of remotes) { + const gasOverhead = this.gasOverhead[remote]; + const existingOverhead = + await defaultIsmInterchainGasPaymaster.destinationGasOverhead( + gasOverhead.domain, + ); + if (!existingOverhead.eq(gasOverhead.gasOverhead)) { + configs.push(gasOverhead); + } + } + + const currentOwner = await defaultIsmInterchainGasPaymaster.owner(); + if (configs.length > 0) { + await this.runIfOwner( + chain, + defaultIsmInterchainGasPaymaster, + async () => { + if (currentOwner === deployer) { + await chainConnection.handleTx( + defaultIsmInterchainGasPaymaster.setDestinationGasOverheads( + configs, + chainConnection.overrides, + ), + ); + } else { + this.logger( + `Unable to set destination gas overheads; owner is not deployer. Current owner: ${currentOwner}, deployer: ${deployer}`, + ); + } + }, + ); + } + + return defaultIsmInterchainGasPaymaster; + } + async deployMailbox( chain: LocalChain, defaultIsmAddress: types.Address, @@ -183,6 +267,11 @@ export class HyperlaneCoreDeployer< chain, proxyAdmin, ); + const defaultIsmInterchainGasPaymaster = + await this.deployDefaultIsmInterchainGasPaymaster( + chain, + interchainGasPaymaster.address, + ); const mailbox = await this.deployMailbox( chain, multisigIsm.address, @@ -192,15 +281,20 @@ export class HyperlaneCoreDeployer< chain, mailbox.address, ); - // Mailbox ownership is transferred upon initialization. - const ownables: Ownable[] = [multisigIsm, proxyAdmin]; + // Ownership of the Mailbox and the interchainGasPaymaster is transferred upon initialization. + const ownables: Ownable[] = [ + multisigIsm, + proxyAdmin, + defaultIsmInterchainGasPaymaster, + ]; await this.transferOwnershipOfContracts(chain, ownables); return { validatorAnnounce, proxyAdmin, - interchainGasPaymaster, mailbox, + interchainGasPaymaster, + defaultIsmInterchainGasPaymaster, multisigIsm, }; } @@ -215,8 +309,10 @@ export class HyperlaneCoreDeployer< ownables.map(async (ownable) => { const currentOwner = await ownable.owner(); if (currentOwner.toLowerCase() !== owner.toLowerCase()) { - return chainConnection.handleTx( - ownable.transferOwnership(owner, chainConnection.overrides), + return super.runIfOwner(chain, ownable, () => + chainConnection.handleTx( + ownable.transferOwnership(owner, chainConnection.overrides), + ), ); } return undefined; diff --git a/typescript/sdk/src/index.ts b/typescript/sdk/src/index.ts index d051415c6..ac8b2f357 100644 --- a/typescript/sdk/src/index.ts +++ b/typescript/sdk/src/index.ts @@ -75,7 +75,11 @@ export { CoreContractsMap, DispatchedMessage, } from './core/HyperlaneCore'; -export { CoreContracts, coreFactories } from './core/contracts'; +export { + CoreContracts, + coreFactories, + ConnectionClientContracts, +} from './core/contracts'; export { HyperlaneLifecyleEvent, AnnotatedDispatch, diff --git a/typescript/token b/typescript/token index 84a649035..f83f53f61 160000 --- a/typescript/token +++ b/typescript/token @@ -1 +1 @@ -Subproject commit 84a64903545364ca50336e0b62910eca1e9d7567 +Subproject commit f83f53f614fa0e456557164b24d557e2d51ace33