@hyperlane-xyz/core 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/contracts/Mailbox.sol +2 -1
- package/contracts/Router.sol +6 -5
- package/contracts/interfaces/IInterchainSecurityModule.sol +1 -1
- package/contracts/interfaces/{IAggregationIsm.sol → isms/IAggregationIsm.sol} +2 -2
- package/contracts/interfaces/isms/IMultisigIsm.sol +1 -1
- package/contracts/interfaces/isms/IRoutingIsm.sol +17 -0
- package/contracts/isms/aggregation/AbstractAggregationIsm.sol +3 -2
- package/contracts/isms/multisig/AbstractMultisigIsm.sol +6 -5
- package/contracts/isms/multisig/LegacyMultisigIsm.sol +15 -11
- package/contracts/isms/routing/AbstractRoutingIsm.sol +45 -0
- package/contracts/isms/routing/DomainRoutingIsm.sol +105 -0
- package/contracts/isms/routing/DomainRoutingIsmFactory.sol +46 -0
- package/contracts/isms/routing/InterchainAccountIsm.sol +42 -0
- package/contracts/libs/MetaProxy.sol +2 -2
- package/contracts/libs/MinimalProxy.sol +10 -2
- package/contracts/libs/middleware/InterchainAccountMessage.sol +9 -0
- package/contracts/middleware/InterchainQueryRouter.sol +0 -1
- package/contracts/middleware/liquidity-layer/LiquidityLayerRouter.sol +4 -6
- package/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter.sol +9 -10
- package/contracts/middleware/liquidity-layer/adapters/PortalAdapter.sol +1 -1
- package/contracts/mock/MockHyperlaneEnvironment.sol +3 -0
- package/contracts/mock/MockMailbox.sol +60 -9
- package/contracts/test/TestIsm.sol +4 -0
- package/dist/contracts/interfaces/index.d.ts +0 -1
- package/dist/contracts/interfaces/index.d.ts.map +1 -1
- package/dist/contracts/interfaces/{IAggregationIsm.d.ts → isms/IAggregationIsm.d.ts} +1 -1
- package/dist/contracts/interfaces/isms/IAggregationIsm.d.ts.map +1 -0
- package/dist/contracts/interfaces/isms/IAggregationIsm.js.map +1 -0
- package/dist/{interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule.d.ts → contracts/interfaces/isms/IRoutingIsm.d.ts} +14 -6
- package/dist/contracts/interfaces/isms/IRoutingIsm.d.ts.map +1 -0
- package/dist/contracts/{isms/MultisigIsm.js → interfaces/isms/IRoutingIsm.js} +1 -1
- package/dist/contracts/interfaces/isms/IRoutingIsm.js.map +1 -0
- package/dist/contracts/interfaces/isms/index.d.ts +2 -0
- package/dist/contracts/interfaces/isms/index.d.ts.map +1 -1
- package/dist/contracts/isms/index.d.ts +2 -0
- package/dist/contracts/isms/index.d.ts.map +1 -1
- package/dist/{interfaces/IAggregationIsm.d.ts → contracts/isms/routing/AbstractRoutingIsm.d.ts} +14 -23
- package/dist/contracts/isms/routing/AbstractRoutingIsm.d.ts.map +1 -0
- package/dist/contracts/{Create2Factory.js → isms/routing/AbstractRoutingIsm.js} +1 -1
- package/dist/contracts/isms/routing/AbstractRoutingIsm.js.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsm.d.ts +197 -0
- package/dist/contracts/isms/routing/DomainRoutingIsm.d.ts.map +1 -0
- package/dist/contracts/{libs/ImmutableOwnable.js → isms/routing/DomainRoutingIsm.js} +1 -1
- package/dist/contracts/isms/routing/DomainRoutingIsm.js.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.d.ts +64 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.d.ts.map +1 -0
- package/dist/contracts/{InterchainGasPaymaster.js → isms/routing/DomainRoutingIsmFactory.js} +1 -1
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.js.map +1 -0
- package/dist/{interfaces/IMultisigIsm.d.ts → contracts/isms/routing/InterchainAccountIsm.d.ts} +14 -29
- package/dist/contracts/isms/routing/InterchainAccountIsm.d.ts.map +1 -0
- package/dist/contracts/isms/routing/InterchainAccountIsm.js +4 -0
- package/dist/contracts/isms/routing/InterchainAccountIsm.js.map +1 -0
- package/dist/contracts/isms/routing/index.d.ts +5 -0
- package/dist/contracts/isms/routing/index.d.ts.map +1 -0
- package/dist/contracts/isms/routing/index.js.map +1 -0
- package/dist/contracts/middleware/liquidity-layer/adapters/PortalAdapter.d.ts +9 -1
- package/dist/contracts/middleware/liquidity-layer/adapters/PortalAdapter.d.ts.map +1 -1
- package/dist/contracts/mock/MockMailbox.d.ts +47 -17
- package/dist/contracts/mock/MockMailbox.d.ts.map +1 -1
- package/dist/factories/contracts/Mailbox__factory.d.ts +1 -1
- package/dist/factories/contracts/Mailbox__factory.js +1 -1
- package/dist/factories/contracts/ValidatorAnnounce__factory.d.ts +1 -1
- package/dist/factories/contracts/ValidatorAnnounce__factory.js +1 -1
- package/dist/factories/contracts/interfaces/index.d.ts +0 -1
- package/dist/factories/contracts/interfaces/index.d.ts.map +1 -1
- package/dist/factories/contracts/interfaces/index.js +1 -3
- package/dist/factories/contracts/interfaces/index.js.map +1 -1
- package/dist/factories/{interfaces → contracts/interfaces/isms}/IAggregationIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/interfaces/isms/IAggregationIsm__factory.d.ts.map +1 -0
- package/dist/factories/contracts/interfaces/isms/IAggregationIsm__factory.js.map +1 -0
- package/dist/factories/{interfaces/IGasOracle__factory.d.ts → contracts/interfaces/isms/IRoutingIsm__factory.d.ts} +5 -5
- package/dist/factories/contracts/interfaces/isms/IRoutingIsm__factory.d.ts.map +1 -0
- package/dist/factories/{interfaces/isms/IMultisigIsm__factory.js → contracts/interfaces/isms/IRoutingIsm__factory.js} +9 -14
- package/dist/factories/contracts/interfaces/isms/IRoutingIsm__factory.js.map +1 -0
- package/dist/factories/contracts/interfaces/isms/index.d.ts +2 -0
- package/dist/factories/contracts/interfaces/isms/index.d.ts.map +1 -1
- package/dist/factories/contracts/interfaces/isms/index.js +5 -1
- package/dist/factories/contracts/interfaces/isms/index.js.map +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsmFactory__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsmFactory__factory.js +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsm__factory.js +1 -1
- package/dist/factories/contracts/isms/index.d.ts +1 -0
- package/dist/factories/contracts/isms/index.d.ts.map +1 -1
- package/dist/factories/contracts/isms/index.js +2 -1
- package/dist/factories/contracts/isms/index.js.map +1 -1
- package/dist/factories/contracts/isms/multisig/LegacyMultisigIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/LegacyMultisigIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/multisig/LegacyMultisigIsm__factory.js +1 -1
- package/dist/factories/contracts/isms/multisig/LegacyMultisigIsm__factory.js.map +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsmFactory__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsmFactory__factory.js +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm__factory.js +1 -1
- package/dist/factories/contracts/{interfaces/IAggregationIsm__factory.d.ts → isms/routing/AbstractRoutingIsm__factory.d.ts} +5 -5
- package/dist/factories/contracts/isms/routing/AbstractRoutingIsm__factory.d.ts.map +1 -0
- package/dist/factories/{interfaces/IMultisigIsm__factory.js → contracts/isms/routing/AbstractRoutingIsm__factory.js} +9 -14
- package/dist/factories/contracts/isms/routing/AbstractRoutingIsm__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.d.ts +55 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.js +83 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.d.ts +48 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.js +254 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/InterchainAccountIsm__factory.d.ts +45 -0
- package/dist/factories/contracts/isms/routing/InterchainAccountIsm__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/InterchainAccountIsm__factory.js +108 -0
- package/dist/factories/contracts/isms/routing/InterchainAccountIsm__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/index.d.ts +5 -0
- package/dist/factories/contracts/isms/routing/index.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/index.js +15 -0
- package/dist/factories/contracts/isms/routing/index.js.map +1 -0
- package/dist/factories/contracts/middleware/InterchainAccountRouter__factory.d.ts +1 -1
- package/dist/factories/contracts/middleware/InterchainAccountRouter__factory.js +1 -1
- package/dist/factories/contracts/middleware/InterchainQueryRouter__factory.d.ts +1 -1
- package/dist/factories/contracts/middleware/InterchainQueryRouter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/middleware/InterchainQueryRouter__factory.js +1 -1
- package/dist/factories/contracts/middleware/InterchainQueryRouter__factory.js.map +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/LiquidityLayerRouter__factory.d.ts +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/LiquidityLayerRouter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/LiquidityLayerRouter__factory.js +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/LiquidityLayerRouter__factory.js.map +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter__factory.d.ts +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter__factory.js +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter__factory.js.map +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/PortalAdapter__factory.d.ts +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/PortalAdapter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/PortalAdapter__factory.js +14 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/PortalAdapter__factory.js.map +1 -1
- package/dist/factories/contracts/mock/MockHyperlaneEnvironment__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockHyperlaneEnvironment__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockHyperlaneEnvironment__factory.js +1 -1
- package/dist/factories/contracts/mock/MockHyperlaneEnvironment__factory.js.map +1 -1
- package/dist/factories/contracts/mock/MockMailbox__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockMailbox__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockMailbox__factory.js +45 -9
- package/dist/factories/contracts/mock/MockMailbox__factory.js.map +1 -1
- package/dist/factories/contracts/test/LightTestRecipient__factory.d.ts +1 -1
- package/dist/factories/contracts/test/LightTestRecipient__factory.js +1 -1
- package/dist/factories/contracts/test/TestGasRouter__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestGasRouter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestGasRouter__factory.js +1 -1
- package/dist/factories/contracts/test/TestGasRouter__factory.js.map +1 -1
- package/dist/factories/contracts/test/TestHyperlaneConnectionClient__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestHyperlaneConnectionClient__factory.js +1 -1
- package/dist/factories/contracts/test/TestIsm__factory.d.ts +9 -3
- package/dist/factories/contracts/test/TestIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestIsm__factory.js +6 -1
- package/dist/factories/contracts/test/TestIsm__factory.js.map +1 -1
- package/dist/factories/contracts/test/TestLegacyMultisigIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestLegacyMultisigIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestLegacyMultisigIsm__factory.js +1 -1
- package/dist/factories/contracts/test/TestLegacyMultisigIsm__factory.js.map +1 -1
- package/dist/factories/contracts/test/TestMailbox__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestMailbox__factory.js +1 -1
- package/dist/factories/contracts/test/TestQuery__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestQuery__factory.js +1 -1
- package/dist/factories/contracts/test/TestRecipient__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestRecipient__factory.js +1 -1
- package/dist/factories/contracts/test/TestRouter__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestRouter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestRouter__factory.js +1 -1
- package/dist/factories/contracts/test/TestRouter__factory.js.map +1 -1
- package/dist/factories/contracts/test/TestSendReceiver__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestSendReceiver__factory.js +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/dist/contracts/Create2Factory.d.ts +0 -94
- package/dist/contracts/Create2Factory.d.ts.map +0 -1
- package/dist/contracts/Create2Factory.js.map +0 -1
- package/dist/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient.d.ts +0 -202
- package/dist/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient.d.ts.map +0 -1
- package/dist/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient.js +0 -4
- package/dist/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient.js.map +0 -1
- package/dist/contracts/ImmutableConnectionClient.sol/index.d.ts +0 -2
- package/dist/contracts/ImmutableConnectionClient.sol/index.d.ts.map +0 -1
- package/dist/contracts/ImmutableConnectionClient.sol/index.js.map +0 -1
- package/dist/contracts/InterchainGasPaymaster.d.ts +0 -162
- package/dist/contracts/InterchainGasPaymaster.d.ts.map +0 -1
- package/dist/contracts/InterchainGasPaymaster.js.map +0 -1
- package/dist/contracts/interfaces/IAggregationIsm.d.ts.map +0 -1
- package/dist/contracts/interfaces/IAggregationIsm.js.map +0 -1
- package/dist/contracts/isms/MultisigIsm.d.ts +0 -290
- package/dist/contracts/isms/MultisigIsm.d.ts.map +0 -1
- package/dist/contracts/isms/MultisigIsm.js.map +0 -1
- package/dist/contracts/libs/ImmutableOwnable.d.ts +0 -43
- package/dist/contracts/libs/ImmutableOwnable.d.ts.map +0 -1
- package/dist/contracts/libs/ImmutableOwnable.js.map +0 -1
- package/dist/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge.d.ts +0 -78
- package/dist/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge.d.ts.map +0 -1
- package/dist/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge.js +0 -4
- package/dist/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge.js.map +0 -1
- package/dist/contracts/mock/MockCircleBridge.d.ts +0 -86
- package/dist/contracts/mock/MockCircleBridge.d.ts.map +0 -1
- package/dist/contracts/mock/MockCircleBridge.js +0 -4
- package/dist/contracts/mock/MockCircleBridge.js.map +0 -1
- package/dist/contracts/mock/MockInterchainAccountRouter.d.ts +0 -422
- package/dist/contracts/mock/MockInterchainAccountRouter.d.ts.map +0 -1
- package/dist/contracts/mock/MockInterchainAccountRouter.js +0 -4
- package/dist/contracts/mock/MockInterchainAccountRouter.js.map +0 -1
- package/dist/contracts/test/TestMultisigIsm.d.ts +0 -306
- package/dist/contracts/test/TestMultisigIsm.d.ts.map +0 -1
- package/dist/contracts/test/TestMultisigIsm.js +0 -4
- package/dist/contracts/test/TestMultisigIsm.js.map +0 -1
- package/dist/factories/contracts/Create2Factory__factory.d.ts +0 -55
- package/dist/factories/contracts/Create2Factory__factory.d.ts.map +0 -1
- package/dist/factories/contracts/Create2Factory__factory.js +0 -163
- package/dist/factories/contracts/Create2Factory__factory.js.map +0 -1
- package/dist/factories/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient__factory.d.ts +0 -43
- package/dist/factories/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient__factory.d.ts.map +0 -1
- package/dist/factories/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient__factory.js +0 -200
- package/dist/factories/contracts/ImmutableConnectionClient.sol/HyperlaneConnectionClient__factory.js.map +0 -1
- package/dist/factories/contracts/ImmutableConnectionClient.sol/index.d.ts +0 -2
- package/dist/factories/contracts/ImmutableConnectionClient.sol/index.d.ts.map +0 -1
- package/dist/factories/contracts/ImmutableConnectionClient.sol/index.js +0 -9
- package/dist/factories/contracts/ImmutableConnectionClient.sol/index.js.map +0 -1
- package/dist/factories/contracts/InterchainGasPaymaster__factory.d.ts +0 -62
- package/dist/factories/contracts/InterchainGasPaymaster__factory.d.ts.map +0 -1
- package/dist/factories/contracts/InterchainGasPaymaster__factory.js +0 -178
- package/dist/factories/contracts/InterchainGasPaymaster__factory.js.map +0 -1
- package/dist/factories/contracts/interfaces/IAggregationIsm__factory.d.ts.map +0 -1
- package/dist/factories/contracts/interfaces/IAggregationIsm__factory.js.map +0 -1
- package/dist/factories/contracts/isms/MultisigIsm__factory.d.ts +0 -55
- package/dist/factories/contracts/isms/MultisigIsm__factory.d.ts.map +0 -1
- package/dist/factories/contracts/isms/MultisigIsm__factory.js +0 -437
- package/dist/factories/contracts/isms/MultisigIsm__factory.js.map +0 -1
- package/dist/factories/contracts/libs/ImmutableOwnable__factory.d.ts +0 -19
- package/dist/factories/contracts/libs/ImmutableOwnable__factory.d.ts.map +0 -1
- package/dist/factories/contracts/libs/ImmutableOwnable__factory.js +0 -31
- package/dist/factories/contracts/libs/ImmutableOwnable__factory.js.map +0 -1
- package/dist/factories/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge__factory.d.ts +0 -36
- package/dist/factories/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge__factory.d.ts.map +0 -1
- package/dist/factories/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge__factory.js +0 -104
- package/dist/factories/contracts/middleware/liquidity-layer/interfaces/circle/ICircleBridge__factory.js.map +0 -1
- package/dist/factories/contracts/mock/MockCircleBridge__factory.d.ts +0 -59
- package/dist/factories/contracts/mock/MockCircleBridge__factory.d.ts.map +0 -1
- package/dist/factories/contracts/mock/MockCircleBridge__factory.js +0 -151
- package/dist/factories/contracts/mock/MockCircleBridge__factory.js.map +0 -1
- package/dist/factories/contracts/mock/MockInterchainAccountRouter__factory.d.ts +0 -69
- package/dist/factories/contracts/mock/MockInterchainAccountRouter__factory.d.ts.map +0 -1
- package/dist/factories/contracts/mock/MockInterchainAccountRouter__factory.js +0 -556
- package/dist/factories/contracts/mock/MockInterchainAccountRouter__factory.js.map +0 -1
- package/dist/factories/contracts/test/TestMultisigIsm__factory.d.ts +0 -48
- package/dist/factories/contracts/test/TestMultisigIsm__factory.d.ts.map +0 -1
- package/dist/factories/contracts/test/TestMultisigIsm__factory.js +0 -480
- package/dist/factories/contracts/test/TestMultisigIsm__factory.js.map +0 -1
- package/dist/factories/interfaces/IAggregationIsm__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IAggregationIsm__factory.js +0 -79
- package/dist/factories/interfaces/IAggregationIsm__factory.js.map +0 -1
- package/dist/factories/interfaces/IGasOracle__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IGasOracle__factory.js +0 -42
- package/dist/factories/interfaces/IGasOracle__factory.js.map +0 -1
- package/dist/factories/interfaces/IHyperlaneConnectionClient__factory.d.ts +0 -29
- package/dist/factories/interfaces/IHyperlaneConnectionClient__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IHyperlaneConnectionClient__factory.js +0 -96
- package/dist/factories/interfaces/IHyperlaneConnectionClient__factory.js.map +0 -1
- package/dist/factories/interfaces/IInterchainAccountRouter__factory.d.ts +0 -33
- package/dist/factories/interfaces/IInterchainAccountRouter__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IInterchainAccountRouter__factory.js +0 -107
- package/dist/factories/interfaces/IInterchainAccountRouter__factory.js.map +0 -1
- package/dist/factories/interfaces/IInterchainGasPaymaster__factory.d.ts +0 -19
- package/dist/factories/interfaces/IInterchainGasPaymaster__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IInterchainGasPaymaster__factory.js +0 -46
- package/dist/factories/interfaces/IInterchainGasPaymaster__factory.js.map +0 -1
- package/dist/factories/interfaces/IInterchainQueryRouter__factory.d.ts +0 -33
- package/dist/factories/interfaces/IInterchainQueryRouter__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IInterchainQueryRouter__factory.js +0 -134
- package/dist/factories/interfaces/IInterchainQueryRouter__factory.js.map +0 -1
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule__factory.d.ts +0 -23
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule__factory.js +0 -55
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule__factory.js.map +0 -1
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule__factory.d.ts +0 -19
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule__factory.js +0 -31
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule__factory.js.map +0 -1
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/index.d.ts +0 -3
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/index.d.ts.map +0 -1
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/index.js +0 -11
- package/dist/factories/interfaces/IInterchainSecurityModule.sol/index.js.map +0 -1
- package/dist/factories/interfaces/ILiquidityLayerMessageRecipient__factory.d.ts +0 -19
- package/dist/factories/interfaces/ILiquidityLayerMessageRecipient__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/ILiquidityLayerMessageRecipient__factory.js +0 -51
- package/dist/factories/interfaces/ILiquidityLayerMessageRecipient__factory.js.map +0 -1
- package/dist/factories/interfaces/ILiquidityLayerRouter__factory.d.ts +0 -23
- package/dist/factories/interfaces/ILiquidityLayerRouter__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/ILiquidityLayerRouter__factory.js +0 -62
- package/dist/factories/interfaces/ILiquidityLayerRouter__factory.js.map +0 -1
- package/dist/factories/interfaces/IMailbox__factory.d.ts +0 -23
- package/dist/factories/interfaces/IMailbox__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IMailbox__factory.js +0 -141
- package/dist/factories/interfaces/IMailbox__factory.js.map +0 -1
- package/dist/factories/interfaces/IMessageRecipient__factory.d.ts +0 -19
- package/dist/factories/interfaces/IMessageRecipient__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IMessageRecipient__factory.js +0 -41
- package/dist/factories/interfaces/IMessageRecipient__factory.js.map +0 -1
- package/dist/factories/interfaces/IMultisigIsm__factory.d.ts +0 -23
- package/dist/factories/interfaces/IMultisigIsm__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IMultisigIsm__factory.js.map +0 -1
- package/dist/factories/interfaces/IRouter__factory.d.ts +0 -23
- package/dist/factories/interfaces/IRouter__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IRouter__factory.js +0 -86
- package/dist/factories/interfaces/IRouter__factory.js.map +0 -1
- package/dist/factories/interfaces/IValidatorAnnounce__factory.d.ts +0 -23
- package/dist/factories/interfaces/IValidatorAnnounce__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/IValidatorAnnounce__factory.js +0 -105
- package/dist/factories/interfaces/IValidatorAnnounce__factory.js.map +0 -1
- package/dist/factories/interfaces/index.d.ts +0 -10
- package/dist/factories/interfaces/index.d.ts.map +0 -1
- package/dist/factories/interfaces/index.js +0 -47
- package/dist/factories/interfaces/index.js.map +0 -1
- package/dist/factories/interfaces/isms/IMultisigIsm__factory.d.ts +0 -23
- package/dist/factories/interfaces/isms/IMultisigIsm__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/isms/IMultisigIsm__factory.js.map +0 -1
- package/dist/factories/interfaces/isms/index.d.ts +0 -2
- package/dist/factories/interfaces/isms/index.d.ts.map +0 -1
- package/dist/factories/interfaces/isms/index.js +0 -9
- package/dist/factories/interfaces/isms/index.js.map +0 -1
- package/dist/factories/interfaces/middleware/IInterchainAccountRouter__factory.d.ts +0 -33
- package/dist/factories/interfaces/middleware/IInterchainAccountRouter__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/middleware/IInterchainAccountRouter__factory.js +0 -265
- package/dist/factories/interfaces/middleware/IInterchainAccountRouter__factory.js.map +0 -1
- package/dist/factories/interfaces/middleware/IInterchainQueryRouter__factory.d.ts +0 -43
- package/dist/factories/interfaces/middleware/IInterchainQueryRouter__factory.d.ts.map +0 -1
- package/dist/factories/interfaces/middleware/IInterchainQueryRouter__factory.js +0 -100
- package/dist/factories/interfaces/middleware/IInterchainQueryRouter__factory.js.map +0 -1
- package/dist/factories/interfaces/middleware/index.d.ts +0 -3
- package/dist/factories/interfaces/middleware/index.d.ts.map +0 -1
- package/dist/factories/interfaces/middleware/index.js +0 -11
- package/dist/factories/interfaces/middleware/index.js.map +0 -1
- package/dist/interfaces/IAggregationIsm.d.ts.map +0 -1
- package/dist/interfaces/IAggregationIsm.js +0 -4
- package/dist/interfaces/IAggregationIsm.js.map +0 -1
- package/dist/interfaces/IGasOracle.d.ts +0 -61
- package/dist/interfaces/IGasOracle.d.ts.map +0 -1
- package/dist/interfaces/IGasOracle.js +0 -4
- package/dist/interfaces/IGasOracle.js.map +0 -1
- package/dist/interfaces/IHyperlaneConnectionClient.d.ts +0 -107
- package/dist/interfaces/IHyperlaneConnectionClient.d.ts.map +0 -1
- package/dist/interfaces/IHyperlaneConnectionClient.js +0 -4
- package/dist/interfaces/IHyperlaneConnectionClient.js.map +0 -1
- package/dist/interfaces/IInterchainAccountRouter.d.ts +0 -83
- package/dist/interfaces/IInterchainAccountRouter.d.ts.map +0 -1
- package/dist/interfaces/IInterchainAccountRouter.js +0 -4
- package/dist/interfaces/IInterchainAccountRouter.js.map +0 -1
- package/dist/interfaces/IInterchainGasPaymaster.d.ts +0 -51
- package/dist/interfaces/IInterchainGasPaymaster.d.ts.map +0 -1
- package/dist/interfaces/IInterchainGasPaymaster.js +0 -4
- package/dist/interfaces/IInterchainGasPaymaster.js.map +0 -1
- package/dist/interfaces/IInterchainQueryRouter.d.ts +0 -91
- package/dist/interfaces/IInterchainQueryRouter.d.ts.map +0 -1
- package/dist/interfaces/IInterchainQueryRouter.js +0 -4
- package/dist/interfaces/IInterchainQueryRouter.js.map +0 -1
- package/dist/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule.d.ts.map +0 -1
- package/dist/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule.js +0 -4
- package/dist/interfaces/IInterchainSecurityModule.sol/IInterchainSecurityModule.js.map +0 -1
- package/dist/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule.d.ts +0 -43
- package/dist/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule.d.ts.map +0 -1
- package/dist/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule.js +0 -4
- package/dist/interfaces/IInterchainSecurityModule.sol/ISpecifiesInterchainSecurityModule.js.map +0 -1
- package/dist/interfaces/IInterchainSecurityModule.sol/index.d.ts +0 -3
- package/dist/interfaces/IInterchainSecurityModule.sol/index.d.ts.map +0 -1
- package/dist/interfaces/IInterchainSecurityModule.sol/index.js +0 -3
- package/dist/interfaces/IInterchainSecurityModule.sol/index.js.map +0 -1
- package/dist/interfaces/ILiquidityLayerMessageRecipient.d.ts +0 -51
- package/dist/interfaces/ILiquidityLayerMessageRecipient.d.ts.map +0 -1
- package/dist/interfaces/ILiquidityLayerMessageRecipient.js +0 -4
- package/dist/interfaces/ILiquidityLayerMessageRecipient.js.map +0 -1
- package/dist/interfaces/ILiquidityLayerRouter.d.ts +0 -51
- package/dist/interfaces/ILiquidityLayerRouter.d.ts.map +0 -1
- package/dist/interfaces/ILiquidityLayerRouter.js +0 -4
- package/dist/interfaces/ILiquidityLayerRouter.js.map +0 -1
- package/dist/interfaces/IMailbox.d.ts +0 -107
- package/dist/interfaces/IMailbox.d.ts.map +0 -1
- package/dist/interfaces/IMailbox.js +0 -4
- package/dist/interfaces/IMailbox.js.map +0 -1
- package/dist/interfaces/IMessageRecipient.d.ts +0 -51
- package/dist/interfaces/IMessageRecipient.d.ts.map +0 -1
- package/dist/interfaces/IMessageRecipient.js +0 -4
- package/dist/interfaces/IMessageRecipient.js.map +0 -1
- package/dist/interfaces/IMultisigIsm.d.ts.map +0 -1
- package/dist/interfaces/IMultisigIsm.js +0 -4
- package/dist/interfaces/IMultisigIsm.js.map +0 -1
- package/dist/interfaces/IRouter.d.ts +0 -83
- package/dist/interfaces/IRouter.d.ts.map +0 -1
- package/dist/interfaces/IRouter.js +0 -4
- package/dist/interfaces/IRouter.js.map +0 -1
- package/dist/interfaces/IValidatorAnnounce.d.ts +0 -83
- package/dist/interfaces/IValidatorAnnounce.d.ts.map +0 -1
- package/dist/interfaces/IValidatorAnnounce.js +0 -4
- package/dist/interfaces/IValidatorAnnounce.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -11
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -4
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/isms/IMultisigIsm.d.ts +0 -82
- package/dist/interfaces/isms/IMultisigIsm.d.ts.map +0 -1
- package/dist/interfaces/isms/IMultisigIsm.js +0 -4
- package/dist/interfaces/isms/IMultisigIsm.js.map +0 -1
- package/dist/interfaces/isms/index.d.ts +0 -2
- package/dist/interfaces/isms/index.d.ts.map +0 -1
- package/dist/interfaces/isms/index.js +0 -3
- package/dist/interfaces/isms/index.js.map +0 -1
- package/dist/interfaces/middleware/IInterchainAccountRouter.d.ts +0 -127
- package/dist/interfaces/middleware/IInterchainAccountRouter.d.ts.map +0 -1
- package/dist/interfaces/middleware/IInterchainAccountRouter.js +0 -4
- package/dist/interfaces/middleware/IInterchainAccountRouter.js.map +0 -1
- package/dist/interfaces/middleware/IInterchainQueryRouter.d.ts +0 -88
- package/dist/interfaces/middleware/IInterchainQueryRouter.d.ts.map +0 -1
- package/dist/interfaces/middleware/IInterchainQueryRouter.js +0 -4
- package/dist/interfaces/middleware/IInterchainQueryRouter.js.map +0 -1
- package/dist/interfaces/middleware/index.d.ts +0 -3
- package/dist/interfaces/middleware/index.d.ts.map +0 -1
- package/dist/interfaces/middleware/index.js +0 -3
- package/dist/interfaces/middleware/index.js.map +0 -1
- /package/dist/contracts/interfaces/{IAggregationIsm.js → isms/IAggregationIsm.js} +0 -0
- /package/dist/contracts/{ImmutableConnectionClient.sol → isms/routing}/index.js +0 -0
- /package/dist/factories/contracts/interfaces/{IAggregationIsm__factory.js → isms/IAggregationIsm__factory.js} +0 -0
package/README.md
CHANGED
package/contracts/Mailbox.sol
CHANGED
|
@@ -189,7 +189,7 @@ contract Mailbox is
|
|
|
189
189
|
* @return root The root of the Mailbox's merkle tree.
|
|
190
190
|
* @return index The index of the last element in the tree.
|
|
191
191
|
*/
|
|
192
|
-
function latestCheckpoint()
|
|
192
|
+
function latestCheckpoint() external view returns (bytes32, uint32) {
|
|
193
193
|
return (root(), count() - 1);
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -241,6 +241,7 @@ contract Mailbox is
|
|
|
241
241
|
if (address(_val) != address(0)) {
|
|
242
242
|
return _val;
|
|
243
243
|
}
|
|
244
|
+
// solhint-disable-next-line no-empty-blocks
|
|
244
245
|
} catch {}
|
|
245
246
|
return defaultIsm;
|
|
246
247
|
}
|
package/contracts/Router.sol
CHANGED
|
@@ -11,7 +11,7 @@ import {EnumerableMapExtended} from "./libs/EnumerableMapExtended.sol";
|
|
|
11
11
|
abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
12
12
|
using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;
|
|
13
13
|
|
|
14
|
-
string constant NO_ROUTER_ENROLLED_REVERT_MESSAGE =
|
|
14
|
+
string private constant NO_ROUTER_ENROLLED_REVERT_MESSAGE =
|
|
15
15
|
"No router enrolled for domain. Did you specify the right domain ID?";
|
|
16
16
|
|
|
17
17
|
// ============ Mutable Storage ============
|
|
@@ -71,8 +71,9 @@ abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
|
71
71
|
// ============ External functions ============
|
|
72
72
|
function domains() external view returns (uint32[] memory) {
|
|
73
73
|
bytes32[] storage rawKeys = _routers.keys();
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
uint256 length = rawKeys.length;
|
|
75
|
+
uint32[] memory keys = new uint32[](length);
|
|
76
|
+
for (uint256 i = 0; i < length; i++) {
|
|
76
77
|
keys[i] = uint32(uint256(rawKeys[i]));
|
|
77
78
|
}
|
|
78
79
|
return keys;
|
|
@@ -109,7 +110,8 @@ abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
|
109
110
|
bytes32[] calldata _addresses
|
|
110
111
|
) external virtual onlyOwner {
|
|
111
112
|
require(_domains.length == _addresses.length, "!length");
|
|
112
|
-
|
|
113
|
+
uint256 length = _domains.length;
|
|
114
|
+
for (uint256 i = 0; i < length; i += 1) {
|
|
113
115
|
_enrollRemoteRouter(_domains[i], _addresses[i]);
|
|
114
116
|
}
|
|
115
117
|
}
|
|
@@ -125,7 +127,6 @@ abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
|
125
127
|
bytes32 _sender,
|
|
126
128
|
bytes calldata _message
|
|
127
129
|
) external virtual override onlyMailbox onlyRemoteRouter(_origin, _sender) {
|
|
128
|
-
// TODO: callbacks on success/failure
|
|
129
130
|
_handle(_origin, _sender, _message);
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
-
pragma solidity >=0.6.
|
|
2
|
+
pragma solidity >=0.6.11;
|
|
3
3
|
|
|
4
|
-
import {IInterchainSecurityModule} from "
|
|
4
|
+
import {IInterchainSecurityModule} from "../IInterchainSecurityModule.sol";
|
|
5
5
|
|
|
6
6
|
interface IAggregationIsm is IInterchainSecurityModule {
|
|
7
7
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
import {IInterchainSecurityModule} from "../IInterchainSecurityModule.sol";
|
|
5
|
+
|
|
6
|
+
interface IRoutingIsm is IInterchainSecurityModule {
|
|
7
|
+
/**
|
|
8
|
+
* @notice Returns the ISM responsible for verifying _message
|
|
9
|
+
* @dev Can change based on the content of _message
|
|
10
|
+
* @param _message Formatted Hyperlane message (see Message.sol).
|
|
11
|
+
* @return module The ISM to use to verify _message
|
|
12
|
+
*/
|
|
13
|
+
function route(bytes calldata _message)
|
|
14
|
+
external
|
|
15
|
+
view
|
|
16
|
+
returns (IInterchainSecurityModule);
|
|
17
|
+
}
|
|
@@ -6,7 +6,7 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
|
6
6
|
|
|
7
7
|
// ============ Internal Imports ============
|
|
8
8
|
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
9
|
-
import {IAggregationIsm} from "../../interfaces/IAggregationIsm.sol";
|
|
9
|
+
import {IAggregationIsm} from "../../interfaces/isms/IAggregationIsm.sol";
|
|
10
10
|
import {AggregationIsmMetadata} from "../../libs/isms/AggregationIsmMetadata.sol";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -17,8 +17,9 @@ import {AggregationIsmMetadata} from "../../libs/isms/AggregationIsmMetadata.sol
|
|
|
17
17
|
abstract contract AbstractAggregationIsm is IAggregationIsm {
|
|
18
18
|
// ============ Constants ============
|
|
19
19
|
|
|
20
|
+
// solhint-disable-next-line const-name-snakecase
|
|
20
21
|
uint8 public constant moduleType =
|
|
21
|
-
uint8(IInterchainSecurityModule.Types.
|
|
22
|
+
uint8(IInterchainSecurityModule.Types.AGGREGATION);
|
|
22
23
|
|
|
23
24
|
// ============ Virtual Functions ============
|
|
24
25
|
// ======= OVERRIDE THESE TO IMPLEMENT =======
|
|
@@ -20,6 +20,7 @@ import {MerkleLib} from "../../libs/Merkle.sol";
|
|
|
20
20
|
abstract contract AbstractMultisigIsm is IMultisigIsm {
|
|
21
21
|
// ============ Constants ============
|
|
22
22
|
|
|
23
|
+
// solhint-disable-next-line const-name-snakecase
|
|
23
24
|
uint8 public constant moduleType =
|
|
24
25
|
uint8(IInterchainSecurityModule.Types.MULTISIG);
|
|
25
26
|
|
|
@@ -109,12 +110,12 @@ abstract contract AbstractMultisigIsm is IMultisigIsm {
|
|
|
109
110
|
MultisigIsmMetadata.signatureAt(_metadata, i)
|
|
110
111
|
);
|
|
111
112
|
// Loop through remaining validators until we find a match
|
|
112
|
-
|
|
113
|
-
;
|
|
113
|
+
while (
|
|
114
114
|
_validatorIndex < _validatorCount &&
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
_signer != _validators[_validatorIndex]
|
|
116
|
+
) {
|
|
117
|
+
++_validatorIndex;
|
|
118
|
+
}
|
|
118
119
|
// Fail if we never found a match
|
|
119
120
|
require(_validatorIndex < _validatorCount, "!threshold");
|
|
120
121
|
++_validatorIndex;
|
|
@@ -29,6 +29,7 @@ contract LegacyMultisigIsm is IMultisigIsm, Ownable {
|
|
|
29
29
|
|
|
30
30
|
// ============ Constants ============
|
|
31
31
|
|
|
32
|
+
// solhint-disable-next-line const-name-snakecase
|
|
32
33
|
uint8 public constant moduleType =
|
|
33
34
|
uint8(IInterchainSecurityModule.Types.LEGACY_MULTISIG);
|
|
34
35
|
|
|
@@ -102,10 +103,12 @@ contract LegacyMultisigIsm is IMultisigIsm, Ownable {
|
|
|
102
103
|
uint32[] calldata _domains,
|
|
103
104
|
address[][] calldata _validators
|
|
104
105
|
) external onlyOwner {
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
uint256 domainsLength = _domains.length;
|
|
107
|
+
require(domainsLength == _validators.length, "!length");
|
|
108
|
+
for (uint256 i = 0; i < domainsLength; i += 1) {
|
|
107
109
|
address[] calldata _domainValidators = _validators[i];
|
|
108
|
-
|
|
110
|
+
uint256 validatorsLength = _domainValidators.length;
|
|
111
|
+
for (uint256 j = 0; j < validatorsLength; j += 1) {
|
|
109
112
|
_enrollValidator(_domains[i], _domainValidators[j]);
|
|
110
113
|
}
|
|
111
114
|
_updateCommitment(_domains[i]);
|
|
@@ -155,8 +158,9 @@ contract LegacyMultisigIsm is IMultisigIsm, Ownable {
|
|
|
155
158
|
uint32[] calldata _domains,
|
|
156
159
|
uint8[] calldata _thresholds
|
|
157
160
|
) external onlyOwner {
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
uint256 length = _domains.length;
|
|
162
|
+
require(length == _thresholds.length, "!length");
|
|
163
|
+
for (uint256 i = 0; i < length; i += 1) {
|
|
160
164
|
setThreshold(_domains[i], _thresholds[i]);
|
|
161
165
|
}
|
|
162
166
|
}
|
|
@@ -202,7 +206,7 @@ contract LegacyMultisigIsm is IMultisigIsm, Ownable {
|
|
|
202
206
|
* @param _message Formatted Hyperlane message (see Message.sol).
|
|
203
207
|
*/
|
|
204
208
|
function verify(bytes calldata _metadata, bytes calldata _message)
|
|
205
|
-
|
|
209
|
+
external
|
|
206
210
|
view
|
|
207
211
|
returns (bool)
|
|
208
212
|
{
|
|
@@ -340,12 +344,12 @@ contract LegacyMultisigIsm is IMultisigIsm, Ownable {
|
|
|
340
344
|
for (uint256 i = 0; i < _threshold; ++i) {
|
|
341
345
|
address _signer = ECDSA.recover(_digest, _metadata.signatureAt(i));
|
|
342
346
|
// Loop through remaining validators until we find a match
|
|
343
|
-
|
|
344
|
-
;
|
|
347
|
+
while (
|
|
345
348
|
_validatorIndex < _validatorCount &&
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
+
_signer != _metadata.validatorAt(_validatorIndex)
|
|
350
|
+
) {
|
|
351
|
+
++_validatorIndex;
|
|
352
|
+
}
|
|
349
353
|
// Fail if we never found a match
|
|
350
354
|
require(_validatorIndex < _validatorCount, "!threshold");
|
|
351
355
|
++_validatorIndex;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
// ============ Internal Imports ============
|
|
5
|
+
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
6
|
+
import {IRoutingIsm} from "../../interfaces/isms/IRoutingIsm.sol";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title RoutingIsm
|
|
10
|
+
*/
|
|
11
|
+
abstract contract AbstractRoutingIsm is IRoutingIsm {
|
|
12
|
+
// ============ Constants ============
|
|
13
|
+
|
|
14
|
+
uint8 public constant moduleType =
|
|
15
|
+
uint8(IInterchainSecurityModule.Types.ROUTING);
|
|
16
|
+
|
|
17
|
+
// ============ Virtual Functions ============
|
|
18
|
+
// ======= OVERRIDE THESE TO IMPLEMENT =======
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @notice Returns the ISM responsible for verifying _message
|
|
22
|
+
* @dev Can change based on the content of _message
|
|
23
|
+
* @param _message Formatted Hyperlane message (see Message.sol).
|
|
24
|
+
* @return module The ISM to use to verify _message
|
|
25
|
+
*/
|
|
26
|
+
function route(bytes calldata _message)
|
|
27
|
+
public
|
|
28
|
+
view
|
|
29
|
+
virtual
|
|
30
|
+
returns (IInterchainSecurityModule);
|
|
31
|
+
|
|
32
|
+
// ============ Public Functions ============
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @notice Routes _metadata and _message to the correct ISM
|
|
36
|
+
* @param _metadata ABI encoded module metadata
|
|
37
|
+
* @param _message Formatted Hyperlane message (see Message.sol).
|
|
38
|
+
*/
|
|
39
|
+
function verify(bytes calldata _metadata, bytes calldata _message)
|
|
40
|
+
public
|
|
41
|
+
returns (bool)
|
|
42
|
+
{
|
|
43
|
+
return route(_message).verify(_metadata, _message);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
// ============ External Imports ============
|
|
4
|
+
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
|
|
5
|
+
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
|
6
|
+
|
|
7
|
+
// ============ Internal Imports ============
|
|
8
|
+
import {AbstractRoutingIsm} from "./AbstractRoutingIsm.sol";
|
|
9
|
+
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
10
|
+
import {Message} from "../../libs/Message.sol";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title DomainRoutingIsm
|
|
14
|
+
*/
|
|
15
|
+
contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
16
|
+
// ============ Public Storage ============
|
|
17
|
+
mapping(uint32 => IInterchainSecurityModule) public modules;
|
|
18
|
+
|
|
19
|
+
// ============ Events ============
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @notice Emitted when a module is set for a domain
|
|
23
|
+
* @param domain The origin domain.
|
|
24
|
+
* @param module The ISM to use.
|
|
25
|
+
*/
|
|
26
|
+
event ModuleSet(uint32 indexed domain, IInterchainSecurityModule module);
|
|
27
|
+
|
|
28
|
+
// ============ External Functions ============
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param _owner The owner of the contract.
|
|
32
|
+
*/
|
|
33
|
+
function initialize(address _owner) public initializer {
|
|
34
|
+
__Ownable_init();
|
|
35
|
+
_transferOwnership(_owner);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @notice Sets the ISMs to be used for the specified origin domains
|
|
40
|
+
* @param _owner The owner of the contract.
|
|
41
|
+
* @param _domains The origin domains
|
|
42
|
+
* @param _modules The ISMs to use to verify messages
|
|
43
|
+
*/
|
|
44
|
+
function initialize(
|
|
45
|
+
address _owner,
|
|
46
|
+
uint32[] calldata _domains,
|
|
47
|
+
IInterchainSecurityModule[] calldata _modules
|
|
48
|
+
) public initializer {
|
|
49
|
+
__Ownable_init();
|
|
50
|
+
require(_domains.length == _modules.length, "length mismatch");
|
|
51
|
+
uint256 _length = _domains.length;
|
|
52
|
+
for (uint256 i = 0; i < _length; ++i) {
|
|
53
|
+
_set(_domains[i], _modules[i]);
|
|
54
|
+
}
|
|
55
|
+
_transferOwnership(_owner);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @notice Sets the ISM to be used for the specified origin domain
|
|
60
|
+
* @param _domain The origin domain
|
|
61
|
+
* @param _module The ISM to use to verify messages
|
|
62
|
+
*/
|
|
63
|
+
function set(uint32 _domain, IInterchainSecurityModule _module)
|
|
64
|
+
external
|
|
65
|
+
onlyOwner
|
|
66
|
+
{
|
|
67
|
+
_set(_domain, _module);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ============ Public Functions ============
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @notice Returns the ISM responsible for verifying _message
|
|
74
|
+
* @dev Can change based on the content of _message
|
|
75
|
+
* @param _message Formatted Hyperlane message (see Message.sol).
|
|
76
|
+
* @return module The ISM to use to verify _message
|
|
77
|
+
*/
|
|
78
|
+
function route(bytes calldata _message)
|
|
79
|
+
public
|
|
80
|
+
view
|
|
81
|
+
virtual
|
|
82
|
+
override
|
|
83
|
+
returns (IInterchainSecurityModule)
|
|
84
|
+
{
|
|
85
|
+
IInterchainSecurityModule module = modules[Message.origin(_message)];
|
|
86
|
+
require(
|
|
87
|
+
address(module) != address(0),
|
|
88
|
+
"No ISM found for origin domain"
|
|
89
|
+
);
|
|
90
|
+
return module;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ============ Internal Functions ============
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @notice Sets the ISM to be used for the specified origin domain
|
|
97
|
+
* @param _domain The origin domain
|
|
98
|
+
* @param _module The ISM to use to verify messages
|
|
99
|
+
*/
|
|
100
|
+
function _set(uint32 _domain, IInterchainSecurityModule _module) internal {
|
|
101
|
+
require(Address.isContract(address(_module)), "!contract");
|
|
102
|
+
modules[_domain] = _module;
|
|
103
|
+
emit ModuleSet(_domain, _module);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
// ============ Internal Imports ============
|
|
5
|
+
import {DomainRoutingIsm} from "./DomainRoutingIsm.sol";
|
|
6
|
+
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
7
|
+
import {MinimalProxy} from "../../libs/MinimalProxy.sol";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @title DomainRoutingIsmFactory
|
|
11
|
+
*/
|
|
12
|
+
contract DomainRoutingIsmFactory {
|
|
13
|
+
// ============ Immutables ============
|
|
14
|
+
address private immutable _implementation;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @notice Emitted when a routing module is deployed
|
|
18
|
+
* @param module The deployed ISM
|
|
19
|
+
*/
|
|
20
|
+
event ModuleDeployed(DomainRoutingIsm module);
|
|
21
|
+
|
|
22
|
+
// ============ Constructor ============
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
_implementation = address(new DomainRoutingIsm());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ============ External Functions ============
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @notice Deploys and initializes a DomainRoutingIsm using a minimal proxy
|
|
32
|
+
* @param _domains The origin domains
|
|
33
|
+
* @param _modules The ISMs to use to verify messages
|
|
34
|
+
*/
|
|
35
|
+
function deploy(
|
|
36
|
+
uint32[] calldata _domains,
|
|
37
|
+
IInterchainSecurityModule[] calldata _modules
|
|
38
|
+
) external returns (DomainRoutingIsm) {
|
|
39
|
+
DomainRoutingIsm _ism = DomainRoutingIsm(
|
|
40
|
+
MinimalProxy.create(_implementation)
|
|
41
|
+
);
|
|
42
|
+
emit ModuleDeployed(_ism);
|
|
43
|
+
_ism.initialize(msg.sender, _domains, _modules);
|
|
44
|
+
return _ism;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
// ============ Internal Imports ============
|
|
4
|
+
import {AbstractRoutingIsm} from "./AbstractRoutingIsm.sol";
|
|
5
|
+
import {IMailbox} from "../../interfaces/IMailbox.sol";
|
|
6
|
+
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
7
|
+
import {Message} from "../../libs/Message.sol";
|
|
8
|
+
import {InterchainAccountMessage} from "../../libs/middleware/InterchainAccountMessage.sol";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @title InterchainAccountIsm
|
|
12
|
+
*/
|
|
13
|
+
contract InterchainAccountIsm is AbstractRoutingIsm {
|
|
14
|
+
IMailbox private immutable mailbox;
|
|
15
|
+
|
|
16
|
+
// ============ Constructor ============
|
|
17
|
+
constructor(address _mailbox) {
|
|
18
|
+
mailbox = IMailbox(_mailbox);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ============ Public Functions ============
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @notice Returns the ISM responsible for verifying _message
|
|
25
|
+
* @param _message Formatted Hyperlane message (see Message.sol).
|
|
26
|
+
* @return module The ISM to use to verify _message
|
|
27
|
+
*/
|
|
28
|
+
function route(bytes calldata _message)
|
|
29
|
+
public
|
|
30
|
+
view
|
|
31
|
+
virtual
|
|
32
|
+
override
|
|
33
|
+
returns (IInterchainSecurityModule)
|
|
34
|
+
{
|
|
35
|
+
address _ism = InterchainAccountMessage.ism(Message.body(_message));
|
|
36
|
+
if (_ism == address(0)) {
|
|
37
|
+
return mailbox.defaultIsm();
|
|
38
|
+
} else {
|
|
39
|
+
return IInterchainSecurityModule(_ism);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -3,9 +3,9 @@ pragma solidity >=0.7.6;
|
|
|
3
3
|
|
|
4
4
|
/// @dev Adapted from https://eips.ethereum.org/EIPS/eip-3448
|
|
5
5
|
library MetaProxy {
|
|
6
|
-
bytes32 constant PREFIX =
|
|
6
|
+
bytes32 private constant PREFIX =
|
|
7
7
|
hex"600b380380600b3d393df3363d3d373d3d3d3d60368038038091363936013d73";
|
|
8
|
-
bytes13 constant SUFFIX = hex"5af43d3d93803e603457fd5bf3";
|
|
8
|
+
bytes13 private constant SUFFIX = hex"5af43d3d93803e603457fd5bf3";
|
|
9
9
|
|
|
10
10
|
function bytecode(address _implementation, bytes memory _metadata)
|
|
11
11
|
internal
|
|
@@ -3,8 +3,16 @@ pragma solidity >=0.6.11;
|
|
|
3
3
|
|
|
4
4
|
// Library for building bytecode of minimal proxies (see https://eips.ethereum.org/EIPS/eip-1167)
|
|
5
5
|
library MinimalProxy {
|
|
6
|
-
bytes20 constant PREFIX =
|
|
7
|
-
|
|
6
|
+
bytes20 private constant PREFIX =
|
|
7
|
+
hex"3d602d80600a3d3981f3363d3d373d3d3d363d73";
|
|
8
|
+
bytes15 private constant SUFFIX = hex"5af43d82803e903d91602b57fd5bf3";
|
|
9
|
+
|
|
10
|
+
function create(address implementation) internal returns (address proxy) {
|
|
11
|
+
bytes memory _bytecode = bytecode(implementation);
|
|
12
|
+
assembly {
|
|
13
|
+
proxy := create(0, add(_bytecode, 32), mload(_bytecode))
|
|
14
|
+
}
|
|
15
|
+
}
|
|
8
16
|
|
|
9
17
|
function bytecode(address implementation)
|
|
10
18
|
internal
|
|
@@ -83,4 +83,13 @@ library InterchainAccountMessage {
|
|
|
83
83
|
{
|
|
84
84
|
return abi.decode(_message, (bytes32, bytes32, CallLib.Call[]));
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @notice Parses and returns the ISM address from the provided message
|
|
89
|
+
* @param _message The interchain account message
|
|
90
|
+
* @return The ISM encoded in the message
|
|
91
|
+
*/
|
|
92
|
+
function ism(bytes calldata _message) internal pure returns (address) {
|
|
93
|
+
return address(bytes20(_message[44:64]));
|
|
94
|
+
}
|
|
86
95
|
}
|
|
@@ -136,7 +136,6 @@ contract InterchainQueryRouter is Router, IInterchainQueryRouter {
|
|
|
136
136
|
address senderAddress = sender.bytes32ToAddress();
|
|
137
137
|
bytes[] memory rawCalls = InterchainQueryMessage.rawCalls(_message);
|
|
138
138
|
CallLib.multicallto(senderAddress, rawCalls);
|
|
139
|
-
//
|
|
140
139
|
emit QueryResolved(_origin, senderAddress);
|
|
141
140
|
} else {
|
|
142
141
|
assert(false);
|
|
@@ -11,8 +11,11 @@ import {ILiquidityLayerMessageRecipient} from "../../interfaces/ILiquidityLayerM
|
|
|
11
11
|
import {TypeCasts} from "../../libs/TypeCasts.sol";
|
|
12
12
|
|
|
13
13
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
14
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
14
15
|
|
|
15
16
|
contract LiquidityLayerRouter is Router, ILiquidityLayerRouter {
|
|
17
|
+
using SafeERC20 for IERC20;
|
|
18
|
+
|
|
16
19
|
// Token bridge => adapter address
|
|
17
20
|
mapping(string => address) public liquidityLayerAdapters;
|
|
18
21
|
|
|
@@ -50,12 +53,7 @@ contract LiquidityLayerRouter is Router, ILiquidityLayerRouter {
|
|
|
50
53
|
ILiquidityLayerAdapter _adapter = _getAdapter(_bridge);
|
|
51
54
|
|
|
52
55
|
// Transfer the tokens to the adapter
|
|
53
|
-
|
|
54
|
-
// TODO: Are there scenarios where a transferFrom fails and it doesn't revert?
|
|
55
|
-
require(
|
|
56
|
-
IERC20(_token).transferFrom(msg.sender, address(_adapter), _amount),
|
|
57
|
-
"!transfer in"
|
|
58
|
-
);
|
|
56
|
+
IERC20(_token).safeTransferFrom(msg.sender, address(_adapter), _amount);
|
|
59
57
|
|
|
60
58
|
// Reverts if the bridge was unsuccessful.
|
|
61
59
|
// Gets adapter-specific data that is encoded into the message
|
|
@@ -8,8 +8,11 @@ import {ICircleMessageTransmitter} from "../interfaces/circle/ICircleMessageTran
|
|
|
8
8
|
import {ILiquidityLayerAdapter} from "../interfaces/ILiquidityLayerAdapter.sol";
|
|
9
9
|
|
|
10
10
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
11
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
11
12
|
|
|
12
13
|
contract CircleBridgeAdapter is ILiquidityLayerAdapter, Router {
|
|
14
|
+
using SafeERC20 for IERC20;
|
|
15
|
+
|
|
13
16
|
/// @notice The TokenMessenger contract.
|
|
14
17
|
ITokenMessenger public tokenMessenger;
|
|
15
18
|
|
|
@@ -22,7 +25,7 @@ contract CircleBridgeAdapter is ILiquidityLayerAdapter, Router {
|
|
|
22
25
|
/// @notice Hyperlane domain => Circle domain.
|
|
23
26
|
/// ATM, known Circle domains are Ethereum = 0 and Avalanche = 1.
|
|
24
27
|
/// Note this could result in ambiguity between the Circle domain being
|
|
25
|
-
/// Ethereum or unknown.
|
|
28
|
+
/// Ethereum or unknown.
|
|
26
29
|
mapping(uint32 => uint32) public hyperlaneDomainToCircleDomain;
|
|
27
30
|
|
|
28
31
|
/// @notice Token symbol => address of token on local chain.
|
|
@@ -70,8 +73,8 @@ contract CircleBridgeAdapter is ILiquidityLayerAdapter, Router {
|
|
|
70
73
|
address _tokenMessenger,
|
|
71
74
|
address _circleMessageTransmitter,
|
|
72
75
|
address _liquidityLayerRouter
|
|
73
|
-
)
|
|
74
|
-
|
|
76
|
+
) external initializer {
|
|
77
|
+
__Ownable_init();
|
|
75
78
|
_transferOwnership(_owner);
|
|
76
79
|
|
|
77
80
|
tokenMessenger = ITokenMessenger(_tokenMessenger);
|
|
@@ -96,11 +99,7 @@ contract CircleBridgeAdapter is ILiquidityLayerAdapter, Router {
|
|
|
96
99
|
uint32 _circleDomain = hyperlaneDomainToCircleDomain[
|
|
97
100
|
_destinationDomain
|
|
98
101
|
];
|
|
99
|
-
bytes32 _remoteRouter =
|
|
100
|
-
require(
|
|
101
|
-
_remoteRouter != bytes32(0),
|
|
102
|
-
"CircleBridgeAdapter: No router for domain"
|
|
103
|
-
);
|
|
102
|
+
bytes32 _remoteRouter = _mustHaveRemoteRouter(_destinationDomain);
|
|
104
103
|
|
|
105
104
|
// Approve the token to Circle. We assume that the LiquidityLayerRouter
|
|
106
105
|
// has already transferred the token to this contract.
|
|
@@ -127,6 +126,7 @@ contract CircleBridgeAdapter is ILiquidityLayerAdapter, Router {
|
|
|
127
126
|
uint256 _amount,
|
|
128
127
|
bytes calldata _adapterData // The adapter data from the message
|
|
129
128
|
) external onlyLiquidityLayerRouter returns (address, uint256) {
|
|
129
|
+
_mustHaveRemoteRouter(_originDomain);
|
|
130
130
|
// The origin Circle domain
|
|
131
131
|
uint32 _originCircleDomain = hyperlaneDomainToCircleDomain[
|
|
132
132
|
_originDomain
|
|
@@ -151,10 +151,9 @@ contract CircleBridgeAdapter is ILiquidityLayerAdapter, Router {
|
|
|
151
151
|
);
|
|
152
152
|
|
|
153
153
|
// Transfer the token out to the recipient
|
|
154
|
-
// TODO: use safeTransfer
|
|
155
154
|
// Circle doesn't charge any fee, so we can safely transfer out the
|
|
156
155
|
// exact amount that was bridged over.
|
|
157
|
-
|
|
156
|
+
_token.safeTransfer(_recipient, _amount);
|
|
158
157
|
|
|
159
158
|
return (address(_token), _amount);
|
|
160
159
|
}
|
|
@@ -21,7 +21,7 @@ contract PortalAdapter is ILiquidityLayerAdapter, Router {
|
|
|
21
21
|
/// @notice transferId => token address
|
|
22
22
|
mapping(bytes32 => address) public portalTransfersProcessed;
|
|
23
23
|
|
|
24
|
-
uint32 localDomain;
|
|
24
|
+
uint32 public localDomain;
|
|
25
25
|
|
|
26
26
|
// We could technically use Portal's sequence number here but it doesn't
|
|
27
27
|
// get passed through, so we would have to parse the VAA twice
|
|
@@ -33,6 +33,9 @@ contract MockHyperlaneEnvironment {
|
|
|
33
33
|
isms[originDomain] = new TestIsm();
|
|
34
34
|
isms[destinationDomain] = new TestIsm();
|
|
35
35
|
|
|
36
|
+
originMailbox.setDefaultIsm(isms[originDomain]);
|
|
37
|
+
destinationMailbox.setDefaultIsm(isms[destinationDomain]);
|
|
38
|
+
|
|
36
39
|
mailboxes[_originDomain] = originMailbox;
|
|
37
40
|
mailboxes[_destinationDomain] = destinationMailbox;
|
|
38
41
|
|