@hyperlane-xyz/core 1.4.3-beta1 → 1.5.0
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/contracts/Router.sol +18 -17
- package/contracts/igps/InterchainGasPaymaster.sol +9 -1
- package/contracts/isms/PausableIsm.sol +34 -0
- package/contracts/isms/routing/DefaultFallbackRoutingIsm.sol +39 -0
- package/contracts/isms/routing/DomainRoutingIsm.sol +35 -19
- package/contracts/isms/routing/DomainRoutingIsmFactory.sol +39 -14
- package/contracts/libs/EnumerableMapExtended.sol +28 -2
- package/contracts/middleware/InterchainAccountRouter.sol +99 -97
- package/dist/@eth-optimism/contracts/libraries/bridge/ICrossDomainMessenger.d.ts +6 -6
- package/dist/@eth-optimism/contracts/libraries/bridge/ICrossDomainMessenger.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/access/AccessControl.d.ts +6 -6
- package/dist/@openzeppelin/contracts/access/AccessControl.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/access/IAccessControl.d.ts +6 -6
- package/dist/@openzeppelin/contracts/access/IAccessControl.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/access/Ownable.d.ts +2 -2
- package/dist/@openzeppelin/contracts/access/Ownable.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/governance/TimelockController.d.ts +14 -14
- package/dist/@openzeppelin/contracts/governance/TimelockController.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/index.d.ts +2 -0
- package/dist/@openzeppelin/contracts/index.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.d.ts +6 -6
- package/dist/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.d.ts +6 -6
- package/dist/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts +2 -2
- package/dist/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.d.ts +6 -6
- package/dist/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts/security/Pausable.d.ts +63 -0
- package/dist/@openzeppelin/contracts/security/Pausable.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/security/Pausable.js +4 -0
- package/dist/@openzeppelin/contracts/security/Pausable.js.map +1 -0
- package/dist/@openzeppelin/contracts/security/index.d.ts +2 -0
- package/dist/@openzeppelin/contracts/security/index.d.ts.map +1 -0
- package/dist/@openzeppelin/contracts/security/index.js +3 -0
- package/dist/@openzeppelin/contracts/security/index.js.map +1 -0
- package/dist/@openzeppelin/contracts/token/ERC20/IERC20.d.ts +4 -4
- package/dist/@openzeppelin/contracts/token/ERC20/IERC20.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.d.ts +4 -4
- package/dist/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.d.ts +2 -2
- package/dist/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.d.ts +6 -6
- package/dist/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.d.ts +4 -4
- package/dist/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.d.ts +4 -4
- package/dist/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.d.ts.map +1 -1
- package/dist/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.d.ts +2 -2
- package/dist/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.d.ts.map +1 -1
- package/dist/common.d.ts +4 -4
- package/dist/common.d.ts.map +1 -1
- package/dist/contracts/GasRouter.d.ts +14 -14
- package/dist/contracts/GasRouter.d.ts.map +1 -1
- package/dist/contracts/HyperlaneConnectionClient.d.ts +10 -10
- package/dist/contracts/HyperlaneConnectionClient.d.ts.map +1 -1
- package/dist/contracts/Mailbox.d.ts +18 -18
- package/dist/contracts/Mailbox.d.ts.map +1 -1
- package/dist/contracts/PausableReentrancyGuard.sol/PausableReentrancyGuardUpgradeable.d.ts +2 -2
- package/dist/contracts/PausableReentrancyGuard.sol/PausableReentrancyGuardUpgradeable.d.ts.map +1 -1
- package/dist/contracts/Router.d.ts +12 -12
- package/dist/contracts/Router.d.ts.map +1 -1
- package/dist/contracts/ValidatorAnnounce.d.ts +2 -2
- package/dist/contracts/ValidatorAnnounce.d.ts.map +1 -1
- package/dist/contracts/hooks/ERC5164/interfaces/IMessageDispatcher.d.ts +2 -2
- package/dist/contracts/hooks/ERC5164/interfaces/IMessageDispatcher.d.ts.map +1 -1
- package/dist/contracts/igps/InterchainGasPaymaster.d.ts +10 -10
- package/dist/contracts/igps/InterchainGasPaymaster.d.ts.map +1 -1
- package/dist/contracts/igps/OverheadIgp.d.ts +6 -6
- package/dist/contracts/igps/OverheadIgp.d.ts.map +1 -1
- package/dist/contracts/igps/gas-oracles/StorageGasOracle.d.ts +4 -4
- package/dist/contracts/igps/gas-oracles/StorageGasOracle.d.ts.map +1 -1
- package/dist/contracts/interfaces/IInterchainGasPaymaster.d.ts +2 -2
- package/dist/contracts/interfaces/IInterchainGasPaymaster.d.ts.map +1 -1
- package/dist/contracts/interfaces/IMailbox.d.ts +8 -8
- package/dist/contracts/interfaces/IMailbox.d.ts.map +1 -1
- package/dist/contracts/isms/PausableIsm.d.ts +164 -0
- package/dist/contracts/isms/PausableIsm.d.ts.map +1 -0
- package/dist/contracts/isms/PausableIsm.js +4 -0
- package/dist/contracts/isms/PausableIsm.js.map +1 -0
- package/dist/contracts/isms/hook/AbstractHookISM.d.ts +4 -4
- package/dist/contracts/isms/hook/AbstractHookISM.d.ts.map +1 -1
- package/dist/contracts/isms/hook/ERC5164ISM.d.ts +4 -4
- package/dist/contracts/isms/hook/ERC5164ISM.d.ts.map +1 -1
- package/dist/contracts/isms/hook/OptimismISM.d.ts +4 -4
- package/dist/contracts/isms/hook/OptimismISM.d.ts.map +1 -1
- package/dist/contracts/isms/index.d.ts +1 -0
- package/dist/contracts/isms/index.d.ts.map +1 -1
- package/dist/contracts/isms/multisig/LegacyMultisigIsm.d.ts +10 -10
- package/dist/contracts/isms/multisig/LegacyMultisigIsm.d.ts.map +1 -1
- package/dist/contracts/isms/routing/DefaultFallbackRoutingIsm.d.ts +213 -0
- package/dist/contracts/isms/routing/DefaultFallbackRoutingIsm.d.ts.map +1 -0
- package/dist/contracts/isms/routing/DefaultFallbackRoutingIsm.js +4 -0
- package/dist/contracts/isms/routing/DefaultFallbackRoutingIsm.js.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsm.d.ts +25 -17
- package/dist/contracts/isms/routing/DomainRoutingIsm.d.ts.map +1 -1
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory.d.ts +64 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory.d.ts.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory.js +4 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory.js.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory.d.ts +64 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory.d.ts.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory.js +4 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory.js.map +1 -0
- package/dist/contracts/isms/routing/{DomainRoutingIsmFactory.d.ts → DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory.d.ts} +3 -3
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory.d.ts.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory.js.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.d.ts +4 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.d.ts.map +1 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.js +3 -0
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.js.map +1 -0
- package/dist/contracts/isms/routing/index.d.ts +3 -1
- package/dist/contracts/isms/routing/index.d.ts.map +1 -1
- package/dist/contracts/isms/routing/index.js +1 -0
- package/dist/contracts/isms/routing/index.js.map +1 -1
- package/dist/contracts/middleware/InterchainAccountRouter.d.ts +50 -34
- package/dist/contracts/middleware/InterchainAccountRouter.d.ts.map +1 -1
- package/dist/contracts/middleware/InterchainQueryRouter.d.ts +18 -18
- package/dist/contracts/middleware/InterchainQueryRouter.d.ts.map +1 -1
- package/dist/contracts/middleware/liquidity-layer/LiquidityLayerRouter.d.ts +14 -14
- package/dist/contracts/middleware/liquidity-layer/LiquidityLayerRouter.d.ts.map +1 -1
- package/dist/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter.d.ts +20 -20
- package/dist/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter.d.ts.map +1 -1
- package/dist/contracts/middleware/liquidity-layer/adapters/PortalAdapter.d.ts +16 -16
- package/dist/contracts/middleware/liquidity-layer/adapters/PortalAdapter.d.ts.map +1 -1
- package/dist/contracts/middleware/liquidity-layer/interfaces/circle/ITokenMessenger.d.ts +2 -2
- package/dist/contracts/middleware/liquidity-layer/interfaces/circle/ITokenMessenger.d.ts.map +1 -1
- package/dist/contracts/middleware/liquidity-layer/interfaces/portal/IPortalTokenBridge.d.ts +2 -2
- package/dist/contracts/middleware/liquidity-layer/interfaces/portal/IPortalTokenBridge.d.ts.map +1 -1
- package/dist/contracts/mock/MockCircleTokenMessenger.d.ts +2 -2
- package/dist/contracts/mock/MockCircleTokenMessenger.d.ts.map +1 -1
- package/dist/contracts/mock/MockERC5164.sol/MockMessageDispatcher.d.ts +2 -2
- package/dist/contracts/mock/MockERC5164.sol/MockMessageDispatcher.d.ts.map +1 -1
- package/dist/contracts/mock/MockERC5164.sol/MockMessageExecutor.d.ts +2 -2
- package/dist/contracts/mock/MockERC5164.sol/MockMessageExecutor.d.ts.map +1 -1
- package/dist/contracts/mock/MockPortalBridge.d.ts +2 -2
- package/dist/contracts/mock/MockPortalBridge.d.ts.map +1 -1
- package/dist/contracts/mock/MockToken.d.ts +6 -6
- package/dist/contracts/mock/MockToken.d.ts.map +1 -1
- package/dist/contracts/test/LightTestRecipient.d.ts +6 -6
- package/dist/contracts/test/LightTestRecipient.d.ts.map +1 -1
- package/dist/contracts/test/TestGasRouter.d.ts +16 -16
- package/dist/contracts/test/TestGasRouter.d.ts.map +1 -1
- package/dist/contracts/test/TestHyperlaneConnectionClient.d.ts +10 -10
- package/dist/contracts/test/TestHyperlaneConnectionClient.d.ts.map +1 -1
- package/dist/contracts/test/TestInterchainGasPaymaster.d.ts +10 -10
- package/dist/contracts/test/TestInterchainGasPaymaster.d.ts.map +1 -1
- package/dist/contracts/test/TestLegacyMultisigIsm.d.ts +10 -10
- package/dist/contracts/test/TestLegacyMultisigIsm.d.ts.map +1 -1
- package/dist/contracts/test/TestLiquidityLayerMessageRecipient.d.ts +2 -2
- package/dist/contracts/test/TestLiquidityLayerMessageRecipient.d.ts.map +1 -1
- package/dist/contracts/test/TestMailbox.d.ts +18 -18
- package/dist/contracts/test/TestMailbox.d.ts.map +1 -1
- package/dist/contracts/test/TestQuery.d.ts +2 -2
- package/dist/contracts/test/TestQuery.d.ts.map +1 -1
- package/dist/contracts/test/TestQuerySender.d.ts +6 -6
- package/dist/contracts/test/TestQuerySender.d.ts.map +1 -1
- package/dist/contracts/test/TestRecipient.d.ts +6 -6
- package/dist/contracts/test/TestRecipient.d.ts.map +1 -1
- package/dist/contracts/test/TestRouter.d.ts +14 -14
- package/dist/contracts/test/TestRouter.d.ts.map +1 -1
- package/dist/contracts/test/TestSendReceiver.d.ts +2 -2
- package/dist/contracts/test/TestSendReceiver.d.ts.map +1 -1
- package/dist/contracts/test/TestTokenRecipient.d.ts +4 -4
- package/dist/contracts/test/TestTokenRecipient.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/governance/TimelockController__factory.d.ts +1 -1
- package/dist/factories/@openzeppelin/contracts/governance/TimelockController__factory.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/index.d.ts +1 -0
- package/dist/factories/@openzeppelin/contracts/index.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/index.js +2 -1
- package/dist/factories/@openzeppelin/contracts/index.js.map +1 -1
- package/dist/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.d.ts +1 -1
- package/dist/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts +1 -1
- package/dist/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy__factory.d.ts +1 -1
- package/dist/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy__factory.d.ts.map +1 -1
- package/dist/factories/@openzeppelin/contracts/security/Pausable__factory.d.ts +32 -0
- package/dist/factories/@openzeppelin/contracts/security/Pausable__factory.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/security/Pausable__factory.js +57 -0
- package/dist/factories/@openzeppelin/contracts/security/Pausable__factory.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts/security/index.d.ts +2 -0
- package/dist/factories/@openzeppelin/contracts/security/index.d.ts.map +1 -0
- package/dist/factories/@openzeppelin/contracts/security/index.js +9 -0
- package/dist/factories/@openzeppelin/contracts/security/index.js.map +1 -0
- package/dist/factories/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable__factory.d.ts +1 -1
- package/dist/factories/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable__factory.d.ts.map +1 -1
- package/dist/factories/contracts/Mailbox__factory.d.ts +1 -1
- package/dist/factories/contracts/Mailbox__factory.d.ts.map +1 -1
- package/dist/factories/contracts/OwnableMulticall__factory.d.ts +1 -1
- package/dist/factories/contracts/OwnableMulticall__factory.d.ts.map +1 -1
- package/dist/factories/contracts/ValidatorAnnounce__factory.d.ts +1 -1
- package/dist/factories/contracts/ValidatorAnnounce__factory.d.ts.map +1 -1
- package/dist/factories/contracts/hooks/ERC5164/ERC5164MessageHook__factory.d.ts +1 -1
- package/dist/factories/contracts/hooks/ERC5164/ERC5164MessageHook__factory.d.ts.map +1 -1
- package/dist/factories/contracts/hooks/OptimismMessageHook__factory.d.ts +1 -1
- package/dist/factories/contracts/hooks/OptimismMessageHook__factory.d.ts.map +1 -1
- package/dist/factories/contracts/igps/InterchainGasPaymaster__factory.d.ts +2 -2
- package/dist/factories/contracts/igps/InterchainGasPaymaster__factory.d.ts.map +1 -1
- package/dist/factories/contracts/igps/InterchainGasPaymaster__factory.js +1 -1
- package/dist/factories/contracts/igps/InterchainGasPaymaster__factory.js.map +1 -1
- package/dist/factories/contracts/igps/OverheadIgp__factory.d.ts +1 -1
- package/dist/factories/contracts/igps/OverheadIgp__factory.d.ts.map +1 -1
- package/dist/factories/contracts/igps/gas-oracles/StorageGasOracle__factory.d.ts +1 -1
- package/dist/factories/contracts/igps/gas-oracles/StorageGasOracle__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/PausableIsm__factory.d.ts +48 -0
- package/dist/factories/contracts/isms/PausableIsm__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/PausableIsm__factory.js +183 -0
- package/dist/factories/contracts/isms/PausableIsm__factory.js.map +1 -0
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsmFactory__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsmFactory__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/aggregation/StaticAggregationIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/hook/ERC5164ISM__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/hook/ERC5164ISM__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/hook/OptimismISM__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/hook/OptimismISM__factory.d.ts.map +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 +3 -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/StaticMultisigIsm.sol/StaticMerkleRootMultisigIsmFactory__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMerkleRootMultisigIsmFactory__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMerkleRootMultisigIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMerkleRootMultisigIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMessageIdMultisigIsmFactory__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMessageIdMultisigIsmFactory__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMessageIdMultisigIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/multisig/StaticMultisigIsm.sol/StaticMessageIdMultisigIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/routing/DefaultFallbackRoutingIsm__factory.d.ts +59 -0
- package/dist/factories/contracts/isms/routing/DefaultFallbackRoutingIsm__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DefaultFallbackRoutingIsm__factory.js +291 -0
- package/dist/factories/contracts/isms/routing/DefaultFallbackRoutingIsm__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory__factory.d.ts +36 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory__factory.js +55 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/AbstractDomainRoutingIsmFactory__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory__factory.d.ts +59 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory__factory.js +89 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DefaultFallbackRoutingIsmFactory__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory__factory.d.ts +55 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory__factory.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory__factory.js +83 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory__factory.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.d.ts +4 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.d.ts.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.js +13 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory.sol/index.js.map +1 -0
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.d.ts +2 -2
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.js +17 -4
- package/dist/factories/contracts/isms/routing/DomainRoutingIsm__factory.js.map +1 -1
- package/dist/factories/contracts/isms/routing/InterchainAccountIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/isms/routing/InterchainAccountIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/isms/routing/index.d.ts +2 -1
- package/dist/factories/contracts/isms/routing/index.d.ts.map +1 -1
- package/dist/factories/contracts/isms/routing/index.js +27 -3
- package/dist/factories/contracts/isms/routing/index.js.map +1 -1
- package/dist/factories/contracts/middleware/InterchainAccountRouter__factory.d.ts +2 -2
- package/dist/factories/contracts/middleware/InterchainAccountRouter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/middleware/InterchainAccountRouter__factory.js +26 -3
- package/dist/factories/contracts/middleware/InterchainAccountRouter__factory.js.map +1 -1
- package/dist/factories/contracts/middleware/InterchainQueryRouter__factory.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +1 -1
- package/dist/factories/contracts/middleware/liquidity-layer/adapters/PortalAdapter__factory.js.map +1 -1
- package/dist/factories/contracts/mock/MockCircleMessageTransmitter__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockCircleMessageTransmitter__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockCircleTokenMessenger__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockCircleTokenMessenger__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockERC5164.sol/MockMessageDispatcher__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockERC5164.sol/MockMessageDispatcher__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockERC5164.sol/MockMessageExecutor__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockERC5164.sol/MockMessageExecutor__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockHyperlaneEnvironment__factory.d.ts +2 -2
- 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/MockPortalBridge__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockPortalBridge__factory.d.ts.map +1 -1
- package/dist/factories/contracts/mock/MockToken__factory.d.ts +1 -1
- package/dist/factories/contracts/mock/MockToken__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/LightTestRecipient__factory.d.ts +1 -1
- package/dist/factories/contracts/test/LightTestRecipient__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestGasRouter__factory.d.ts +2 -2
- 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.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestInterchainGasPaymaster__factory.d.ts +2 -2
- package/dist/factories/contracts/test/TestInterchainGasPaymaster__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestInterchainGasPaymaster__factory.js +1 -1
- package/dist/factories/contracts/test/TestInterchainGasPaymaster__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/TestLiquidityLayerMessageRecipient__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestLiquidityLayerMessageRecipient__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestMailbox__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestMailbox__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestMerkle__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestMerkle__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestMessage__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestMessage__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestMultisigIsm__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestMultisigIsm__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestQuerySender__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestQuerySender__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestQuery__factory.d.ts +2 -2
- package/dist/factories/contracts/test/TestQuery__factory.d.ts.map +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.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestRouter__factory.d.ts +2 -2
- 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.d.ts.map +1 -1
- package/dist/factories/contracts/test/TestTokenRecipient__factory.d.ts +1 -1
- package/dist/factories/contracts/test/TestTokenRecipient__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient1__factory.d.ts +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient1__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient2__factory.d.ts +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient2__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient3__factory.d.ts +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient3__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient5__factory.d.ts +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient5__factory.d.ts.map +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient6__factory.d.ts +1 -1
- package/dist/factories/contracts/test/bad-recipient/BadRecipient6__factory.d.ts.map +1 -1
- package/dist/factories/contracts/upgrade/Versioned__factory.d.ts +1 -1
- package/dist/factories/contracts/upgrade/Versioned__factory.d.ts.map +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 +6 -8
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.d.ts.map +0 -1
- package/dist/contracts/isms/routing/DomainRoutingIsmFactory.js.map +0 -1
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.d.ts +0 -55
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.d.ts.map +0 -1
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.js +0 -83
- package/dist/factories/contracts/isms/routing/DomainRoutingIsmFactory__factory.js.map +0 -1
- /package/dist/contracts/isms/routing/{DomainRoutingIsmFactory.js → DomainRoutingIsmFactory.sol/DomainRoutingIsmFactory.js} +0 -0
package/contracts/Router.sol
CHANGED
|
@@ -70,21 +70,18 @@ abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
|
70
70
|
|
|
71
71
|
// ============ External functions ============
|
|
72
72
|
function domains() external view returns (uint32[] memory) {
|
|
73
|
-
|
|
74
|
-
uint256 length = rawKeys.length;
|
|
75
|
-
uint32[] memory keys = new uint32[](length);
|
|
76
|
-
for (uint256 i = 0; i < length; i++) {
|
|
77
|
-
keys[i] = uint32(uint256(rawKeys[i]));
|
|
78
|
-
}
|
|
79
|
-
return keys;
|
|
73
|
+
return _routers.uint32Keys();
|
|
80
74
|
}
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
/**
|
|
77
|
+
* @notice Returns the address of the Router contract for the given domain
|
|
78
|
+
* @param _domain The remote domain ID.
|
|
79
|
+
* @dev Returns 0 address if no router is enrolled for the given domain
|
|
80
|
+
* @return router The address of the Router contract for the given domain
|
|
81
|
+
*/
|
|
82
|
+
function routers(uint32 _domain) public view virtual returns (bytes32) {
|
|
83
|
+
(, bytes32 _router) = _routers.tryGet(_domain);
|
|
84
|
+
return _router;
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
/**
|
|
@@ -144,7 +141,10 @@ abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
|
144
141
|
* @param _domain The domain
|
|
145
142
|
* @param _address The new router
|
|
146
143
|
*/
|
|
147
|
-
function _enrollRemoteRouter(uint32 _domain, bytes32 _address)
|
|
144
|
+
function _enrollRemoteRouter(uint32 _domain, bytes32 _address)
|
|
145
|
+
internal
|
|
146
|
+
virtual
|
|
147
|
+
{
|
|
148
148
|
_routers.set(_domain, _address);
|
|
149
149
|
emit RemoteRouterEnrolled(_domain, _address);
|
|
150
150
|
}
|
|
@@ -170,10 +170,11 @@ abstract contract Router is HyperlaneConnectionClient, IMessageRecipient {
|
|
|
170
170
|
function _mustHaveRemoteRouter(uint32 _domain)
|
|
171
171
|
internal
|
|
172
172
|
view
|
|
173
|
-
returns (bytes32
|
|
173
|
+
returns (bytes32)
|
|
174
174
|
{
|
|
175
|
-
_router =
|
|
176
|
-
require(
|
|
175
|
+
(bool contained, bytes32 _router) = _routers.tryGet(_domain);
|
|
176
|
+
require(contained, NO_ROUTER_ENROLLED_REVERT_MESSAGE);
|
|
177
|
+
return _router;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
/**
|
|
@@ -5,6 +5,7 @@ pragma solidity >=0.8.0;
|
|
|
5
5
|
import {IGasOracle} from "../interfaces/IGasOracle.sol";
|
|
6
6
|
import {IInterchainGasPaymaster} from "../interfaces/IInterchainGasPaymaster.sol";
|
|
7
7
|
// ============ External Imports ============
|
|
8
|
+
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
|
|
8
9
|
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -174,7 +175,14 @@ contract InterchainGasPaymaster is
|
|
|
174
175
|
returns (uint128 tokenExchangeRate, uint128 gasPrice)
|
|
175
176
|
{
|
|
176
177
|
IGasOracle _gasOracle = gasOracles[_destinationDomain];
|
|
177
|
-
|
|
178
|
+
|
|
179
|
+
require(
|
|
180
|
+
address(_gasOracle) != address(0),
|
|
181
|
+
string.concat(
|
|
182
|
+
"Configured IGP doesn't support domain ",
|
|
183
|
+
Strings.toString(_destinationDomain)
|
|
184
|
+
)
|
|
185
|
+
);
|
|
178
186
|
|
|
179
187
|
return _gasOracle.getExchangeRateAndGasPrice(_destinationDomain);
|
|
180
188
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
// ============ External Imports ============
|
|
5
|
+
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
|
|
6
|
+
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
|
|
7
|
+
|
|
8
|
+
// ============ Internal Imports ============
|
|
9
|
+
import {IInterchainSecurityModule} from "../interfaces/IInterchainSecurityModule.sol";
|
|
10
|
+
|
|
11
|
+
contract PausableIsm is IInterchainSecurityModule, Ownable, Pausable {
|
|
12
|
+
uint8 public constant override moduleType = uint8(Types.NULL);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @inheritdoc IInterchainSecurityModule
|
|
16
|
+
* @dev Reverts when paused, otherwise returns `true`.
|
|
17
|
+
*/
|
|
18
|
+
function verify(bytes calldata, bytes calldata)
|
|
19
|
+
external
|
|
20
|
+
view
|
|
21
|
+
whenNotPaused
|
|
22
|
+
returns (bool)
|
|
23
|
+
{
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function pause() external onlyOwner {
|
|
28
|
+
_pause();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function unpause() external onlyOwner {
|
|
32
|
+
_unpause();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
import {DomainRoutingIsm} from "./DomainRoutingIsm.sol";
|
|
5
|
+
import {IMailbox} from "../../Mailbox.sol";
|
|
6
|
+
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
7
|
+
import {EnumerableMapExtended} from "../../libs/EnumerableMapExtended.sol";
|
|
8
|
+
import {TypeCasts} from "../../libs/TypeCasts.sol";
|
|
9
|
+
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
|
|
10
|
+
|
|
11
|
+
contract DefaultFallbackRoutingIsm is DomainRoutingIsm {
|
|
12
|
+
using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;
|
|
13
|
+
using Address for address;
|
|
14
|
+
using TypeCasts for bytes32;
|
|
15
|
+
|
|
16
|
+
IMailbox public immutable mailbox;
|
|
17
|
+
|
|
18
|
+
constructor(address _mailbox) {
|
|
19
|
+
require(
|
|
20
|
+
_mailbox.isContract(),
|
|
21
|
+
"DefaultFallbackRoutingIsm: INVALID_MAILBOX"
|
|
22
|
+
);
|
|
23
|
+
mailbox = IMailbox(_mailbox);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function modules(uint32 origin)
|
|
27
|
+
public
|
|
28
|
+
view
|
|
29
|
+
override
|
|
30
|
+
returns (IInterchainSecurityModule)
|
|
31
|
+
{
|
|
32
|
+
(bool contained, bytes32 _module) = _modules.tryGet(origin);
|
|
33
|
+
if (contained) {
|
|
34
|
+
return IInterchainSecurityModule(_module.bytes32ToAddress());
|
|
35
|
+
} else {
|
|
36
|
+
return mailbox.defaultIsm();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -8,13 +8,21 @@ import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Own
|
|
|
8
8
|
import {AbstractRoutingIsm} from "./AbstractRoutingIsm.sol";
|
|
9
9
|
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
10
10
|
import {Message} from "../../libs/Message.sol";
|
|
11
|
+
import {TypeCasts} from "../../libs/TypeCasts.sol";
|
|
12
|
+
import {EnumerableMapExtended} from "../../libs/EnumerableMapExtended.sol";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @title DomainRoutingIsm
|
|
14
16
|
*/
|
|
15
17
|
contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;
|
|
19
|
+
using Message for bytes;
|
|
20
|
+
using TypeCasts for bytes32;
|
|
21
|
+
using TypeCasts for address;
|
|
22
|
+
using Address for address;
|
|
23
|
+
|
|
24
|
+
// ============ Mutable Storage ============
|
|
25
|
+
EnumerableMapExtended.UintToBytes32Map internal _modules;
|
|
18
26
|
|
|
19
27
|
// ============ Events ============
|
|
20
28
|
|
|
@@ -23,7 +31,7 @@ contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
|
23
31
|
* @param domain The origin domain.
|
|
24
32
|
* @param module The ISM to use.
|
|
25
33
|
*/
|
|
26
|
-
event ModuleSet(uint32 indexed domain,
|
|
34
|
+
event ModuleSet(uint32 indexed domain, address module);
|
|
27
35
|
|
|
28
36
|
// ============ External Functions ============
|
|
29
37
|
|
|
@@ -39,18 +47,18 @@ contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
|
39
47
|
* @notice Sets the ISMs to be used for the specified origin domains
|
|
40
48
|
* @param _owner The owner of the contract.
|
|
41
49
|
* @param _domains The origin domains
|
|
42
|
-
* @param
|
|
50
|
+
* @param __modules The ISMs to use to verify messages
|
|
43
51
|
*/
|
|
44
52
|
function initialize(
|
|
45
53
|
address _owner,
|
|
46
54
|
uint32[] calldata _domains,
|
|
47
|
-
IInterchainSecurityModule[] calldata
|
|
55
|
+
IInterchainSecurityModule[] calldata __modules
|
|
48
56
|
) public initializer {
|
|
49
57
|
__Ownable_init();
|
|
50
|
-
require(_domains.length ==
|
|
58
|
+
require(_domains.length == __modules.length, "length mismatch");
|
|
51
59
|
uint256 _length = _domains.length;
|
|
52
60
|
for (uint256 i = 0; i < _length; ++i) {
|
|
53
|
-
_set(_domains[i],
|
|
61
|
+
_set(_domains[i], address(__modules[i]));
|
|
54
62
|
}
|
|
55
63
|
_transferOwnership(_owner);
|
|
56
64
|
}
|
|
@@ -64,11 +72,25 @@ contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
|
64
72
|
external
|
|
65
73
|
onlyOwner
|
|
66
74
|
{
|
|
67
|
-
_set(_domain, _module);
|
|
75
|
+
_set(_domain, address(_module));
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
|
|
78
|
+
function domains() external view returns (uint256[] memory) {
|
|
79
|
+
return _modules.keys();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function modules(uint32 origin)
|
|
83
|
+
public
|
|
84
|
+
view
|
|
85
|
+
virtual
|
|
86
|
+
returns (IInterchainSecurityModule)
|
|
87
|
+
{
|
|
88
|
+
(bool contained, bytes32 _module) = _modules.tryGet(origin);
|
|
89
|
+
require(contained, "No ISM found for origin domain");
|
|
90
|
+
return IInterchainSecurityModule(_module.bytes32ToAddress());
|
|
91
|
+
}
|
|
71
92
|
|
|
93
|
+
// ============ Public Functions ============
|
|
72
94
|
/**
|
|
73
95
|
* @notice Returns the ISM responsible for verifying _message
|
|
74
96
|
* @dev Can change based on the content of _message
|
|
@@ -78,16 +100,10 @@ contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
|
78
100
|
function route(bytes calldata _message)
|
|
79
101
|
public
|
|
80
102
|
view
|
|
81
|
-
virtual
|
|
82
103
|
override
|
|
83
104
|
returns (IInterchainSecurityModule)
|
|
84
105
|
{
|
|
85
|
-
|
|
86
|
-
require(
|
|
87
|
-
address(module) != address(0),
|
|
88
|
-
"No ISM found for origin domain"
|
|
89
|
-
);
|
|
90
|
-
return module;
|
|
106
|
+
return modules(_message.origin());
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
// ============ Internal Functions ============
|
|
@@ -97,9 +113,9 @@ contract DomainRoutingIsm is AbstractRoutingIsm, OwnableUpgradeable {
|
|
|
97
113
|
* @param _domain The origin domain
|
|
98
114
|
* @param _module The ISM to use to verify messages
|
|
99
115
|
*/
|
|
100
|
-
function _set(uint32 _domain,
|
|
101
|
-
require(
|
|
102
|
-
|
|
116
|
+
function _set(uint32 _domain, address _module) internal {
|
|
117
|
+
require(_module.isContract(), "!contract");
|
|
118
|
+
_modules.set(_domain, _module.addressToBytes32());
|
|
103
119
|
emit ModuleSet(_domain, _module);
|
|
104
120
|
}
|
|
105
121
|
}
|
|
@@ -3,28 +3,17 @@ pragma solidity >=0.8.0;
|
|
|
3
3
|
|
|
4
4
|
// ============ Internal Imports ============
|
|
5
5
|
import {DomainRoutingIsm} from "./DomainRoutingIsm.sol";
|
|
6
|
+
import {DefaultFallbackRoutingIsm} from "./DefaultFallbackRoutingIsm.sol";
|
|
6
7
|
import {IInterchainSecurityModule} from "../../interfaces/IInterchainSecurityModule.sol";
|
|
7
8
|
import {MinimalProxy} from "../../libs/MinimalProxy.sol";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
* @title DomainRoutingIsmFactory
|
|
11
|
-
*/
|
|
12
|
-
contract DomainRoutingIsmFactory {
|
|
13
|
-
// ============ Immutables ============
|
|
14
|
-
address private immutable _implementation;
|
|
15
|
-
|
|
10
|
+
abstract contract AbstractDomainRoutingIsmFactory {
|
|
16
11
|
/**
|
|
17
12
|
* @notice Emitted when a routing module is deployed
|
|
18
13
|
* @param module The deployed ISM
|
|
19
14
|
*/
|
|
20
15
|
event ModuleDeployed(DomainRoutingIsm module);
|
|
21
16
|
|
|
22
|
-
// ============ Constructor ============
|
|
23
|
-
|
|
24
|
-
constructor() {
|
|
25
|
-
_implementation = address(new DomainRoutingIsm());
|
|
26
|
-
}
|
|
27
|
-
|
|
28
17
|
// ============ External Functions ============
|
|
29
18
|
|
|
30
19
|
/**
|
|
@@ -37,10 +26,46 @@ contract DomainRoutingIsmFactory {
|
|
|
37
26
|
IInterchainSecurityModule[] calldata _modules
|
|
38
27
|
) external returns (DomainRoutingIsm) {
|
|
39
28
|
DomainRoutingIsm _ism = DomainRoutingIsm(
|
|
40
|
-
MinimalProxy.create(
|
|
29
|
+
MinimalProxy.create(implementation())
|
|
41
30
|
);
|
|
42
31
|
emit ModuleDeployed(_ism);
|
|
43
32
|
_ism.initialize(msg.sender, _domains, _modules);
|
|
44
33
|
return _ism;
|
|
45
34
|
}
|
|
35
|
+
|
|
36
|
+
// ============ Internal Functions ============
|
|
37
|
+
|
|
38
|
+
function implementation() internal view virtual returns (address);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @title DomainRoutingIsmFactory
|
|
43
|
+
*/
|
|
44
|
+
contract DomainRoutingIsmFactory is AbstractDomainRoutingIsmFactory {
|
|
45
|
+
// ============ Immutables ============
|
|
46
|
+
address internal immutable _implementation;
|
|
47
|
+
|
|
48
|
+
constructor() {
|
|
49
|
+
_implementation = address(new DomainRoutingIsm());
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function implementation() internal view override returns (address) {
|
|
53
|
+
return _implementation;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @title DefaultFallbackRoutingIsmFactory
|
|
59
|
+
*/
|
|
60
|
+
contract DefaultFallbackRoutingIsmFactory is AbstractDomainRoutingIsmFactory {
|
|
61
|
+
// ============ Immutables ============
|
|
62
|
+
address internal immutable _implementation;
|
|
63
|
+
|
|
64
|
+
constructor(address mailbox) {
|
|
65
|
+
_implementation = address(new DefaultFallbackRoutingIsm(mailbox));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function implementation() internal view override returns (address) {
|
|
69
|
+
return _implementation;
|
|
70
|
+
}
|
|
46
71
|
}
|
|
@@ -3,11 +3,13 @@ pragma solidity >=0.6.11;
|
|
|
3
3
|
|
|
4
4
|
// ============ External Imports ============
|
|
5
5
|
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
|
|
6
|
+
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
6
7
|
|
|
7
8
|
// extends EnumerableMap with uint256 => bytes32 type
|
|
8
9
|
// modelled after https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/utils/structs/EnumerableMap.sol
|
|
9
10
|
library EnumerableMapExtended {
|
|
10
11
|
using EnumerableMap for EnumerableMap.Bytes32ToBytes32Map;
|
|
12
|
+
using EnumerableSet for EnumerableSet.Bytes32Set;
|
|
11
13
|
|
|
12
14
|
struct UintToBytes32Map {
|
|
13
15
|
EnumerableMap.Bytes32ToBytes32Map _inner;
|
|
@@ -17,9 +19,25 @@ library EnumerableMapExtended {
|
|
|
17
19
|
function keys(UintToBytes32Map storage map)
|
|
18
20
|
internal
|
|
19
21
|
view
|
|
20
|
-
returns (
|
|
22
|
+
returns (uint256[] memory _keys)
|
|
21
23
|
{
|
|
22
|
-
|
|
24
|
+
uint256 _length = map._inner.length();
|
|
25
|
+
_keys = new uint256[](_length);
|
|
26
|
+
for (uint256 i = 0; i < _length; i++) {
|
|
27
|
+
_keys[i] = uint256(map._inner._keys.at(i));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function uint32Keys(UintToBytes32Map storage map)
|
|
32
|
+
internal
|
|
33
|
+
view
|
|
34
|
+
returns (uint32[] memory _keys)
|
|
35
|
+
{
|
|
36
|
+
uint256[] memory uint256keys = keys(map);
|
|
37
|
+
_keys = new uint32[](uint256keys.length);
|
|
38
|
+
for (uint256 i = 0; i < uint256keys.length; i++) {
|
|
39
|
+
_keys[i] = uint32(uint256keys[i]);
|
|
40
|
+
}
|
|
23
41
|
}
|
|
24
42
|
|
|
25
43
|
function set(
|
|
@@ -38,6 +56,14 @@ library EnumerableMapExtended {
|
|
|
38
56
|
return map._inner.get(bytes32(key));
|
|
39
57
|
}
|
|
40
58
|
|
|
59
|
+
function tryGet(UintToBytes32Map storage map, uint256 key)
|
|
60
|
+
internal
|
|
61
|
+
view
|
|
62
|
+
returns (bool, bytes32)
|
|
63
|
+
{
|
|
64
|
+
return map._inner.tryGet(bytes32(key));
|
|
65
|
+
}
|
|
66
|
+
|
|
41
67
|
function remove(UintToBytes32Map storage map, uint256 key)
|
|
42
68
|
internal
|
|
43
69
|
returns (bool)
|