@hyperlane-xyz/core 1.4.1 → 1.4.2
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/docs/book.css +13 -0
- package/docs/book.toml +12 -0
- package/docs/solidity.min.js +74 -0
- package/docs/src/README.md +15 -0
- package/docs/src/SUMMARY.md +139 -0
- package/docs/src/contracts/GasRouter.sol/abstract.GasRouter.md +124 -0
- package/docs/src/contracts/HyperlaneConnectionClient.sol/abstract.HyperlaneConnectionClient.md +191 -0
- package/docs/src/contracts/Mailbox.sol/contract.Mailbox.md +251 -0
- package/docs/src/contracts/OwnableMulticall.sol/contract.OwnableMulticall.md +41 -0
- package/docs/src/contracts/PausableReentrancyGuard.sol/abstract.PausableReentrancyGuardUpgradeable.md +100 -0
- package/docs/src/contracts/README.md +19 -0
- package/docs/src/contracts/Router.sol/abstract.Router.md +255 -0
- package/docs/src/contracts/ValidatorAnnounce.sol/contract.ValidatorAnnounce.md +117 -0
- package/docs/src/contracts/hooks/ERC5164/ERC5164MessageHook.sol/contract.ERC5164MessageHook.md +64 -0
- package/docs/src/contracts/hooks/ERC5164/README.md +5 -0
- package/docs/src/contracts/hooks/ERC5164/interfaces/IMessageDispatcher.sol/interface.IMessageDispatcher.md +25 -0
- package/docs/src/contracts/hooks/ERC5164/interfaces/README.md +4 -0
- package/docs/src/contracts/hooks/OptimismMessageHook.sol/contract.OptimismMessageHook.md +71 -0
- package/docs/src/contracts/hooks/README.md +5 -0
- package/docs/src/contracts/igps/InterchainGasPaymaster.sol/contract.InterchainGasPaymaster.md +231 -0
- package/docs/src/contracts/igps/OverheadIgp.sol/contract.OverheadIgp.md +161 -0
- package/docs/src/contracts/igps/README.md +6 -0
- package/docs/src/contracts/igps/gas-oracles/README.md +4 -0
- package/docs/src/contracts/igps/gas-oracles/StorageGasOracle.sol/contract.StorageGasOracle.md +114 -0
- package/docs/src/contracts/interfaces/IGasOracle.sol/interface.IGasOracle.md +25 -0
- package/docs/src/contracts/interfaces/IHyperlaneConnectionClient.sol/interface.IHyperlaneConnectionClient.md +43 -0
- package/docs/src/contracts/interfaces/IInterchainGasPaymaster.sol/interface.IInterchainGasPaymaster.md +33 -0
- package/docs/src/contracts/interfaces/IInterchainSecurityModule.sol/interface.IInterchainSecurityModule.md +55 -0
- package/docs/src/contracts/interfaces/IInterchainSecurityModule.sol/interface.ISpecifiesInterchainSecurityModule.md +12 -0
- package/docs/src/contracts/interfaces/ILiquidityLayerMessageRecipient.sol/interface.ILiquidityLayerMessageRecipient.md +13 -0
- package/docs/src/contracts/interfaces/ILiquidityLayerRouter.sol/interface.ILiquidityLayerRouter.md +19 -0
- package/docs/src/contracts/interfaces/IMailbox.sol/interface.IMailbox.md +103 -0
- package/docs/src/contracts/interfaces/IMessageRecipient.sol/interface.IMessageRecipient.md +12 -0
- package/docs/src/contracts/interfaces/IRouter.sol/interface.IRouter.md +33 -0
- package/docs/src/contracts/interfaces/IValidatorAnnounce.sol/interface.IValidatorAnnounce.md +78 -0
- package/docs/src/contracts/interfaces/README.md +17 -0
- package/docs/src/contracts/interfaces/hooks/IMessageHook.sol/interface.IMessageHook.md +12 -0
- package/docs/src/contracts/interfaces/hooks/README.md +4 -0
- package/docs/src/contracts/interfaces/isms/IAggregationIsm.sol/interface.IAggregationIsm.md +36 -0
- package/docs/src/contracts/interfaces/isms/IMultisigIsm.sol/interface.IMultisigIsm.md +36 -0
- package/docs/src/contracts/interfaces/isms/IRoutingIsm.sol/interface.IRoutingIsm.md +31 -0
- package/docs/src/contracts/interfaces/isms/README.md +6 -0
- package/docs/src/contracts/interfaces/middleware/IInterchainAccountRouter.sol/interface.IInterchainAccountRouter.md +64 -0
- package/docs/src/contracts/interfaces/middleware/IInterchainQueryRouter.sol/interface.IInterchainQueryRouter.md +21 -0
- package/docs/src/contracts/interfaces/middleware/README.md +5 -0
- package/docs/src/contracts/isms/README.md +7 -0
- package/docs/src/contracts/isms/aggregation/AbstractAggregationIsm.sol/abstract.AbstractAggregationIsm.md +60 -0
- package/docs/src/contracts/isms/aggregation/README.md +6 -0
- package/docs/src/contracts/isms/aggregation/StaticAggregationIsm.sol/contract.StaticAggregationIsm.md +30 -0
- package/docs/src/contracts/isms/aggregation/StaticAggregationIsmFactory.sol/contract.StaticAggregationIsmFactory.md +15 -0
- package/docs/src/contracts/isms/hook/AbstractHookISM.sol/abstract.AbstractHookISM.md +44 -0
- package/docs/src/contracts/isms/hook/CrossChainEnabled.sol/abstract.CrossChainEnabled.md +74 -0
- package/docs/src/contracts/isms/hook/ERC5164ISM.sol/contract.ERC5164ISM.md +57 -0
- package/docs/src/contracts/isms/hook/README.md +7 -0
- package/docs/src/contracts/isms/hook/optimism/CrossChainEnabledOptimism.sol/abstract.CrossChainEnabledOptimism.md +53 -0
- package/docs/src/contracts/isms/hook/optimism/LibOptimism.sol/library.LibOptimism.md +39 -0
- package/docs/src/contracts/isms/hook/optimism/OptimismISM.sol/contract.OptimismISM.md +66 -0
- package/docs/src/contracts/isms/hook/optimism/README.md +6 -0
- package/docs/src/contracts/isms/multisig/AbstractMerkleRootMultisigIsm.sol/abstract.AbstractMerkleRootMultisigIsm.md +78 -0
- package/docs/src/contracts/isms/multisig/AbstractMessageIdMultisigIsm.sol/abstract.AbstractMessageIdMultisigIsm.md +69 -0
- package/docs/src/contracts/isms/multisig/AbstractMultisigIsm.sol/abstract.AbstractMultisigIsm.md +102 -0
- package/docs/src/contracts/isms/multisig/LegacyMultisigIsm.sol/contract.LegacyMultisigIsm.md +355 -0
- package/docs/src/contracts/isms/multisig/README.md +12 -0
- package/docs/src/contracts/isms/multisig/StaticMultisigIsm.sol/abstract.AbstractMetaProxyMultisigIsm.md +36 -0
- package/docs/src/contracts/isms/multisig/StaticMultisigIsm.sol/contract.StaticMerkleRootMultisigIsm.md +11 -0
- package/docs/src/contracts/isms/multisig/StaticMultisigIsm.sol/contract.StaticMerkleRootMultisigIsmFactory.md +15 -0
- package/docs/src/contracts/isms/multisig/StaticMultisigIsm.sol/contract.StaticMessageIdMultisigIsm.md +10 -0
- package/docs/src/contracts/isms/multisig/StaticMultisigIsm.sol/contract.StaticMessageIdMultisigIsmFactory.md +15 -0
- package/docs/src/contracts/isms/routing/AbstractRoutingIsm.sol/abstract.AbstractRoutingIsm.md +55 -0
- package/docs/src/contracts/isms/routing/DomainRoutingIsm.sol/contract.DomainRoutingIsm.md +112 -0
- package/docs/src/contracts/isms/routing/DomainRoutingIsmFactory.sol/contract.DomainRoutingIsmFactory.md +47 -0
- package/docs/src/contracts/isms/routing/InterchainAccountIsm.sol/contract.InterchainAccountIsm.md +44 -0
- package/docs/src/contracts/isms/routing/README.md +7 -0
- package/docs/src/contracts/libs/Call.sol/library.CallLib.md +124 -0
- package/docs/src/contracts/libs/CheckpointLib.sol/library.CheckpointLib.md +61 -0
- package/docs/src/contracts/libs/EnumerableMapExtended.sol/library.EnumerableMapExtended.md +63 -0
- package/docs/src/contracts/libs/LegacyCheckpointLib.sol/library.LegacyCheckpointLib.md +55 -0
- package/docs/src/contracts/libs/Merkle.sol/library.MerkleLib.md +354 -0
- package/docs/src/contracts/libs/Message.sol/library.Message.md +304 -0
- package/docs/src/contracts/libs/MetaProxy.sol/library.MetaProxy.md +36 -0
- package/docs/src/contracts/libs/MinimalProxy.sol/library.MinimalProxy.md +34 -0
- package/docs/src/contracts/libs/README.md +16 -0
- package/docs/src/contracts/libs/StaticMOfNAddressSetFactory.sol/abstract.StaticMOfNAddressSetFactory.md +123 -0
- package/docs/src/contracts/libs/TypeCasts.sol/library.TypeCasts.md +19 -0
- package/docs/src/contracts/libs/ValidatorAnnouncements.sol/library.ValidatorAnnouncements.md +31 -0
- package/docs/src/contracts/libs/isms/AggregationIsmMetadata.sol/library.AggregationIsmMetadata.md +97 -0
- package/docs/src/contracts/libs/isms/LegacyMultisigIsmMetadata.sol/library.LegacyMultisigIsmMetadata.md +296 -0
- package/docs/src/contracts/libs/isms/MerkleRootMultisigIsmMetadata.sol/library.MerkleRootMultisigIsmMetadata.md +177 -0
- package/docs/src/contracts/libs/isms/MessageIdMultisigIsmMetadata.sol/library.MessageIdMultisigIsmMetadata.md +109 -0
- package/docs/src/contracts/libs/isms/README.md +7 -0
- package/docs/src/contracts/libs/middleware/InterchainAccountMessage.sol/library.InterchainAccountMessage.md +134 -0
- package/docs/src/contracts/libs/middleware/InterchainQueryMessage.sol/library.InterchainQueryMessage.md +203 -0
- package/docs/src/contracts/libs/middleware/README.md +5 -0
- package/docs/src/contracts/middleware/InterchainAccountRouter.sol/contract.InterchainAccountRouter.md +542 -0
- package/docs/src/contracts/middleware/InterchainQueryRouter.sol/contract.InterchainQueryRouter.md +119 -0
- package/docs/src/contracts/middleware/README.md +6 -0
- package/docs/src/contracts/middleware/liquidity-layer/LiquidityLayerRouter.sol/contract.LiquidityLayerRouter.md +81 -0
- package/docs/src/contracts/middleware/liquidity-layer/README.md +6 -0
- package/docs/src/contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter.sol/contract.CircleBridgeAdapter.md +197 -0
- package/docs/src/contracts/middleware/liquidity-layer/adapters/PortalAdapter.sol/contract.PortalAdapter.md +189 -0
- package/docs/src/contracts/middleware/liquidity-layer/adapters/README.md +5 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/ILiquidityLayerAdapter.sol/interface.ILiquidityLayerAdapter.md +23 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/README.md +6 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/circle/ICircleMessageTransmitter.sol/interface.ICircleMessageTransmitter.md +54 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/circle/ITokenMessenger.sol/interface.ITokenMessenger.md +92 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/circle/README.md +5 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/portal/IPortalTokenBridge.sol/interface.IPortalTokenBridge.md +131 -0
- package/docs/src/contracts/middleware/liquidity-layer/interfaces/portal/README.md +4 -0
- package/docs/src/contracts/mock/MockCircleMessageTransmitter.sol/contract.MockCircleMessageTransmitter.md +58 -0
- package/docs/src/contracts/mock/MockCircleTokenMessenger.sol/contract.MockCircleTokenMessenger.md +44 -0
- package/docs/src/contracts/mock/MockERC5164.sol/contract.MockMessageDispatcher.md +15 -0
- package/docs/src/contracts/mock/MockERC5164.sol/contract.MockMessageExecutor.md +11 -0
- package/docs/src/contracts/mock/MockHyperlaneEnvironment.sol/contract.MockHyperlaneEnvironment.md +69 -0
- package/docs/src/contracts/mock/MockMailbox.sol/contract.MockMailbox.md +137 -0
- package/docs/src/contracts/mock/MockPortalBridge.sol/contract.MockPortalBridge.md +82 -0
- package/docs/src/contracts/mock/MockToken.sol/contract.MockToken.md +22 -0
- package/docs/src/contracts/mock/README.md +11 -0
- package/docs/src/contracts/test/LightTestRecipient.sol/contract.LightTestRecipient.md +15 -0
- package/docs/src/contracts/test/README.md +20 -0
- package/docs/src/contracts/test/TestGasRouter.sol/contract.TestGasRouter.md +27 -0
- package/docs/src/contracts/test/TestHyperlaneConnectionClient.sol/contract.TestHyperlaneConnectionClient.md +29 -0
- package/docs/src/contracts/test/TestInterchainGasPaymaster.sol/contract.TestInterchainGasPaymaster.md +30 -0
- package/docs/src/contracts/test/TestLegacyMultisigIsm.sol/contract.TestLegacyMultisigIsm.md +15 -0
- package/docs/src/contracts/test/TestLiquidityLayerMessageRecipient.sol/contract.TestLiquidityLayerMessageRecipient.md +23 -0
- package/docs/src/contracts/test/TestMailbox.sol/contract.TestMailbox.md +29 -0
- package/docs/src/contracts/test/TestMerkle.sol/contract.TestMerkle.md +50 -0
- package/docs/src/contracts/test/TestMessage.sol/contract.TestMessage.md +68 -0
- package/docs/src/contracts/test/TestMultisigIsm.sol/contract.TestMultisigIsm.md +51 -0
- package/docs/src/contracts/test/TestQuery.sol/contract.TestQuery.md +45 -0
- package/docs/src/contracts/test/TestQuerySender.sol/contract.TestQuerySender.md +128 -0
- package/docs/src/contracts/test/TestRecipient.sol/contract.TestRecipient.md +78 -0
- package/docs/src/contracts/test/TestRouter.sol/contract.TestRouter.md +63 -0
- package/docs/src/contracts/test/TestSendReceiver.sol/contract.TestSendReceiver.md +49 -0
- package/docs/src/contracts/test/TestTokenRecipient.sol/contract.TestTokenRecipient.md +80 -0
- package/docs/src/contracts/test/bad-recipient/BadRecipient1.sol/contract.BadRecipient1.md +15 -0
- package/docs/src/contracts/test/bad-recipient/BadRecipient2.sol/contract.BadRecipient2.md +12 -0
- package/docs/src/contracts/test/bad-recipient/BadRecipient3.sol/contract.BadRecipient3.md +15 -0
- package/docs/src/contracts/test/bad-recipient/BadRecipient5.sol/contract.BadRecipient5.md +15 -0
- package/docs/src/contracts/test/bad-recipient/BadRecipient6.sol/contract.BadRecipient6.md +15 -0
- package/docs/src/contracts/test/bad-recipient/README.md +8 -0
- package/docs/src/contracts/upgrade/README.md +4 -0
- package/docs/src/contracts/upgrade/Versioned.sol/contract.Versioned.md +14 -0
- package/package.json +3 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# AbstractMessageIdMultisigIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/AbstractMessageIdMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[AbstractMultisigIsm](/contracts/isms/multisig/AbstractMultisigIsm.sol/abstract.AbstractMultisigIsm.md)
|
|
6
|
+
|
|
7
|
+
This ISM minimizes gas/performance overhead of the checkpoints verification by compromising on the censorship resistance.
|
|
8
|
+
For censorship resistance consider using `AbstractMerkleRootMultisigIsm`.
|
|
9
|
+
If the validators (`validatorsAndThreshold`) skip messages by not sign checkpoints for them,
|
|
10
|
+
the relayers will not be able to aggregate a quorum of signatures sufficient to deliver these messages via this ISM.
|
|
11
|
+
Integrations are free to choose the trade-off between the censorship resistance and the gas/processing overhead.
|
|
12
|
+
|
|
13
|
+
*Provides the default implementation of verifying signatures over a checkpoint related to a specific message ID.
|
|
14
|
+
This abstract contract can be customized to change the `validatorsAndThreshold()` (static or dynamic).*
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## State Variables
|
|
18
|
+
### moduleType
|
|
19
|
+
|
|
20
|
+
```solidity
|
|
21
|
+
uint8 public constant moduleType = uint8(IInterchainSecurityModule.Types.MESSAGE_ID_MULTISIG);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Functions
|
|
26
|
+
### digest
|
|
27
|
+
|
|
28
|
+
Returns the digest to be used for signature verification.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
```solidity
|
|
32
|
+
function digest(bytes calldata _metadata, bytes calldata _message) internal pure override returns (bytes32);
|
|
33
|
+
```
|
|
34
|
+
**Parameters**
|
|
35
|
+
|
|
36
|
+
|Name|Type|Description|
|
|
37
|
+
|----|----|-----------|
|
|
38
|
+
|`_metadata`|`bytes`|ABI encoded module metadata|
|
|
39
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
40
|
+
|
|
41
|
+
**Returns**
|
|
42
|
+
|
|
43
|
+
|Name|Type|Description|
|
|
44
|
+
|----|----|-----------|
|
|
45
|
+
|`<none>`|`bytes32`|digest The digest to be signed by validators|
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### signatureAt
|
|
49
|
+
|
|
50
|
+
Returns the signature at a given index from the metadata.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
```solidity
|
|
54
|
+
function signatureAt(bytes calldata _metadata, uint256 _index) internal pure virtual override returns (bytes memory);
|
|
55
|
+
```
|
|
56
|
+
**Parameters**
|
|
57
|
+
|
|
58
|
+
|Name|Type|Description|
|
|
59
|
+
|----|----|-----------|
|
|
60
|
+
|`_metadata`|`bytes`|ABI encoded module metadata|
|
|
61
|
+
|`_index`|`uint256`|The index of the signature to return|
|
|
62
|
+
|
|
63
|
+
**Returns**
|
|
64
|
+
|
|
65
|
+
|Name|Type|Description|
|
|
66
|
+
|----|----|-----------|
|
|
67
|
+
|`<none>`|`bytes`|signature Packed encoding of signature (65 bytes)|
|
|
68
|
+
|
|
69
|
+
|
package/docs/src/contracts/isms/multisig/AbstractMultisigIsm.sol/abstract.AbstractMultisigIsm.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# AbstractMultisigIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/AbstractMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[IMultisigIsm](/contracts/interfaces/isms/IMultisigIsm.sol/interface.IMultisigIsm.md)
|
|
6
|
+
|
|
7
|
+
Manages per-domain m-of-n Validator sets that are used to verify
|
|
8
|
+
interchain messages.
|
|
9
|
+
|
|
10
|
+
*See ./AbstractMerkleRootMultisigIsm.sol and ./AbstractMessageIdMultisigIsm.sol
|
|
11
|
+
for concrete implementations of `digest` and `signatureAt`.*
|
|
12
|
+
|
|
13
|
+
*See ./StaticMultisigIsm.sol for concrete implementations.*
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Functions
|
|
17
|
+
### validatorsAndThreshold
|
|
18
|
+
|
|
19
|
+
Returns the set of validators responsible for verifying _message
|
|
20
|
+
and the number of signatures required
|
|
21
|
+
|
|
22
|
+
*Can change based on the content of _message*
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
```solidity
|
|
26
|
+
function validatorsAndThreshold(bytes calldata _message) public view virtual returns (address[] memory, uint8);
|
|
27
|
+
```
|
|
28
|
+
**Parameters**
|
|
29
|
+
|
|
30
|
+
|Name|Type|Description|
|
|
31
|
+
|----|----|-----------|
|
|
32
|
+
|`_message`|`bytes`|Hyperlane formatted interchain message|
|
|
33
|
+
|
|
34
|
+
**Returns**
|
|
35
|
+
|
|
36
|
+
|Name|Type|Description|
|
|
37
|
+
|----|----|-----------|
|
|
38
|
+
|`<none>`|`address[]`|validators The array of validator addresses|
|
|
39
|
+
|`<none>`|`uint8`|threshold The number of validator signatures needed|
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### digest
|
|
43
|
+
|
|
44
|
+
Returns the digest to be used for signature verification.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
```solidity
|
|
48
|
+
function digest(bytes calldata _metadata, bytes calldata _message) internal view virtual returns (bytes32);
|
|
49
|
+
```
|
|
50
|
+
**Parameters**
|
|
51
|
+
|
|
52
|
+
|Name|Type|Description|
|
|
53
|
+
|----|----|-----------|
|
|
54
|
+
|`_metadata`|`bytes`|ABI encoded module metadata|
|
|
55
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
56
|
+
|
|
57
|
+
**Returns**
|
|
58
|
+
|
|
59
|
+
|Name|Type|Description|
|
|
60
|
+
|----|----|-----------|
|
|
61
|
+
|`<none>`|`bytes32`|digest The digest to be signed by validators|
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### signatureAt
|
|
65
|
+
|
|
66
|
+
Returns the signature at a given index from the metadata.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
```solidity
|
|
70
|
+
function signatureAt(bytes calldata _metadata, uint256 _index) internal pure virtual returns (bytes memory);
|
|
71
|
+
```
|
|
72
|
+
**Parameters**
|
|
73
|
+
|
|
74
|
+
|Name|Type|Description|
|
|
75
|
+
|----|----|-----------|
|
|
76
|
+
|`_metadata`|`bytes`|ABI encoded module metadata|
|
|
77
|
+
|`_index`|`uint256`|The index of the signature to return|
|
|
78
|
+
|
|
79
|
+
**Returns**
|
|
80
|
+
|
|
81
|
+
|Name|Type|Description|
|
|
82
|
+
|----|----|-----------|
|
|
83
|
+
|`<none>`|`bytes`|signature Packed encoding of signature (65 bytes)|
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### verify
|
|
87
|
+
|
|
88
|
+
Requires that m-of-n validators verify a merkle root,
|
|
89
|
+
and verifies a me∑rkle proof of `_message` against that root.
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
```solidity
|
|
93
|
+
function verify(bytes calldata _metadata, bytes calldata _message) public view returns (bool);
|
|
94
|
+
```
|
|
95
|
+
**Parameters**
|
|
96
|
+
|
|
97
|
+
|Name|Type|Description|
|
|
98
|
+
|----|----|-----------|
|
|
99
|
+
|`_metadata`|`bytes`|ABI encoded module metadata|
|
|
100
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# LegacyMultisigIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/LegacyMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[IMultisigIsm](/contracts/interfaces/isms/IMultisigIsm.sol/interface.IMultisigIsm.md), Ownable
|
|
6
|
+
|
|
7
|
+
Manages an ownable set of validators that ECDSA sign checkpoints to
|
|
8
|
+
reach a quorum.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## State Variables
|
|
12
|
+
### moduleType
|
|
13
|
+
|
|
14
|
+
```solidity
|
|
15
|
+
uint8 public constant moduleType = uint8(IInterchainSecurityModule.Types.LEGACY_MULTISIG);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### threshold
|
|
20
|
+
The validator threshold for each remote domain.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
```solidity
|
|
24
|
+
mapping(uint32 => uint8) public threshold;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### validatorSet
|
|
29
|
+
The validator set for each remote domain.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
```solidity
|
|
33
|
+
mapping(uint32 => EnumerableSet.AddressSet) private validatorSet;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### commitment
|
|
38
|
+
A succinct commitment to the validator set and threshold for each remote
|
|
39
|
+
domain.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
```solidity
|
|
43
|
+
mapping(uint32 => bytes32) public commitment;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Functions
|
|
48
|
+
### constructor
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
```solidity
|
|
52
|
+
constructor() Ownable;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### enrollValidators
|
|
56
|
+
|
|
57
|
+
Enrolls multiple validators into a validator set.
|
|
58
|
+
|
|
59
|
+
*Reverts if `_validator` is already in the validator set.*
|
|
60
|
+
|
|
61
|
+
*_validators[i] are the validators to enroll for _domains[i].*
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
```solidity
|
|
65
|
+
function enrollValidators(uint32[] calldata _domains, address[][] calldata _validators) external onlyOwner;
|
|
66
|
+
```
|
|
67
|
+
**Parameters**
|
|
68
|
+
|
|
69
|
+
|Name|Type|Description|
|
|
70
|
+
|----|----|-----------|
|
|
71
|
+
|`_domains`|`uint32[]`|The remote domains of the validator sets.|
|
|
72
|
+
|`_validators`|`address[][]`|The validators to add to the validator sets.|
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### enrollValidator
|
|
76
|
+
|
|
77
|
+
Enrolls a validator into a validator set.
|
|
78
|
+
|
|
79
|
+
*Reverts if `_validator` is already in the validator set.*
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
```solidity
|
|
83
|
+
function enrollValidator(uint32 _domain, address _validator) external onlyOwner;
|
|
84
|
+
```
|
|
85
|
+
**Parameters**
|
|
86
|
+
|
|
87
|
+
|Name|Type|Description|
|
|
88
|
+
|----|----|-----------|
|
|
89
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
90
|
+
|`_validator`|`address`|The validator to add to the validator set.|
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### unenrollValidator
|
|
94
|
+
|
|
95
|
+
Unenrolls a validator from a validator set.
|
|
96
|
+
|
|
97
|
+
*Reverts if `_validator` is not in the validator set.*
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
```solidity
|
|
101
|
+
function unenrollValidator(uint32 _domain, address _validator) external onlyOwner;
|
|
102
|
+
```
|
|
103
|
+
**Parameters**
|
|
104
|
+
|
|
105
|
+
|Name|Type|Description|
|
|
106
|
+
|----|----|-----------|
|
|
107
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
108
|
+
|`_validator`|`address`|The validator to remove from the validator set.|
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### setThresholds
|
|
112
|
+
|
|
113
|
+
Sets the quorum threshold for multiple domains.
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
```solidity
|
|
117
|
+
function setThresholds(uint32[] calldata _domains, uint8[] calldata _thresholds) external onlyOwner;
|
|
118
|
+
```
|
|
119
|
+
**Parameters**
|
|
120
|
+
|
|
121
|
+
|Name|Type|Description|
|
|
122
|
+
|----|----|-----------|
|
|
123
|
+
|`_domains`|`uint32[]`|The remote domains of the validator sets.|
|
|
124
|
+
|`_thresholds`|`uint8[]`|The new quorum thresholds.|
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### isEnrolled
|
|
128
|
+
|
|
129
|
+
Returns whether an address is enrolled in a validator set.
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
```solidity
|
|
133
|
+
function isEnrolled(uint32 _domain, address _address) external view returns (bool);
|
|
134
|
+
```
|
|
135
|
+
**Parameters**
|
|
136
|
+
|
|
137
|
+
|Name|Type|Description|
|
|
138
|
+
|----|----|-----------|
|
|
139
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
140
|
+
|`_address`|`address`|The address to test for set membership.|
|
|
141
|
+
|
|
142
|
+
**Returns**
|
|
143
|
+
|
|
144
|
+
|Name|Type|Description|
|
|
145
|
+
|----|----|-----------|
|
|
146
|
+
|`<none>`|`bool`|True if the address is enrolled, false otherwise.|
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### setThreshold
|
|
150
|
+
|
|
151
|
+
Sets the quorum threshold.
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
```solidity
|
|
155
|
+
function setThreshold(uint32 _domain, uint8 _threshold) public onlyOwner;
|
|
156
|
+
```
|
|
157
|
+
**Parameters**
|
|
158
|
+
|
|
159
|
+
|Name|Type|Description|
|
|
160
|
+
|----|----|-----------|
|
|
161
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
162
|
+
|`_threshold`|`uint8`|The new quorum threshold.|
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### verify
|
|
166
|
+
|
|
167
|
+
Verifies that a quorum of the origin domain's validators signed
|
|
168
|
+
a checkpoint, and verifies the merkle proof of `_message` against that
|
|
169
|
+
checkpoint.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
```solidity
|
|
173
|
+
function verify(bytes calldata _metadata, bytes calldata _message) external view returns (bool);
|
|
174
|
+
```
|
|
175
|
+
**Parameters**
|
|
176
|
+
|
|
177
|
+
|Name|Type|Description|
|
|
178
|
+
|----|----|-----------|
|
|
179
|
+
|`_metadata`|`bytes`|ABI encoded module metadata (see LegacyMultisigIsmMetadata.sol)|
|
|
180
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### validators
|
|
184
|
+
|
|
185
|
+
Gets the current validator set
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
```solidity
|
|
189
|
+
function validators(uint32 _domain) public view returns (address[] memory);
|
|
190
|
+
```
|
|
191
|
+
**Parameters**
|
|
192
|
+
|
|
193
|
+
|Name|Type|Description|
|
|
194
|
+
|----|----|-----------|
|
|
195
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
196
|
+
|
|
197
|
+
**Returns**
|
|
198
|
+
|
|
199
|
+
|Name|Type|Description|
|
|
200
|
+
|----|----|-----------|
|
|
201
|
+
|`<none>`|`address[]`|The addresses of the validator set.|
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
### validatorsAndThreshold
|
|
205
|
+
|
|
206
|
+
Returns the set of validators responsible for verifying _message
|
|
207
|
+
and the number of signatures required
|
|
208
|
+
|
|
209
|
+
*Can change based on the content of _message*
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
```solidity
|
|
213
|
+
function validatorsAndThreshold(bytes calldata _message) external view returns (address[] memory, uint8);
|
|
214
|
+
```
|
|
215
|
+
**Parameters**
|
|
216
|
+
|
|
217
|
+
|Name|Type|Description|
|
|
218
|
+
|----|----|-----------|
|
|
219
|
+
|`_message`|`bytes`|Hyperlane formatted interchain message|
|
|
220
|
+
|
|
221
|
+
**Returns**
|
|
222
|
+
|
|
223
|
+
|Name|Type|Description|
|
|
224
|
+
|----|----|-----------|
|
|
225
|
+
|`<none>`|`address[]`|validators The array of validator addresses|
|
|
226
|
+
|`<none>`|`uint8`|threshold The number of validator signatures needed|
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### validatorCount
|
|
230
|
+
|
|
231
|
+
Returns the number of validators enrolled in the validator set.
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
```solidity
|
|
235
|
+
function validatorCount(uint32 _domain) public view returns (uint256);
|
|
236
|
+
```
|
|
237
|
+
**Parameters**
|
|
238
|
+
|
|
239
|
+
|Name|Type|Description|
|
|
240
|
+
|----|----|-----------|
|
|
241
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
242
|
+
|
|
243
|
+
**Returns**
|
|
244
|
+
|
|
245
|
+
|Name|Type|Description|
|
|
246
|
+
|----|----|-----------|
|
|
247
|
+
|`<none>`|`uint256`|The number of validators enrolled in the validator set.|
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
### _enrollValidator
|
|
251
|
+
|
|
252
|
+
Enrolls a validator into a validator set.
|
|
253
|
+
|
|
254
|
+
*Reverts if `_validator` is already in the validator set.*
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
```solidity
|
|
258
|
+
function _enrollValidator(uint32 _domain, address _validator) internal;
|
|
259
|
+
```
|
|
260
|
+
**Parameters**
|
|
261
|
+
|
|
262
|
+
|Name|Type|Description|
|
|
263
|
+
|----|----|-----------|
|
|
264
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
265
|
+
|`_validator`|`address`|The validator to add to the validator set.|
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
### _updateCommitment
|
|
269
|
+
|
|
270
|
+
Updates the commitment to the validator set for `_domain`.
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
```solidity
|
|
274
|
+
function _updateCommitment(uint32 _domain) internal returns (bytes32);
|
|
275
|
+
```
|
|
276
|
+
**Parameters**
|
|
277
|
+
|
|
278
|
+
|Name|Type|Description|
|
|
279
|
+
|----|----|-----------|
|
|
280
|
+
|`_domain`|`uint32`|The remote domain of the validator set.|
|
|
281
|
+
|
|
282
|
+
**Returns**
|
|
283
|
+
|
|
284
|
+
|Name|Type|Description|
|
|
285
|
+
|----|----|-----------|
|
|
286
|
+
|`<none>`|`bytes32`|The commitment to the validator set for `_domain`.|
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
### _verifyMerkleProof
|
|
290
|
+
|
|
291
|
+
Verifies the merkle proof of `_message` against the provided
|
|
292
|
+
checkpoint.
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
```solidity
|
|
296
|
+
function _verifyMerkleProof(bytes calldata _metadata, bytes calldata _message) internal pure returns (bool);
|
|
297
|
+
```
|
|
298
|
+
**Parameters**
|
|
299
|
+
|
|
300
|
+
|Name|Type|Description|
|
|
301
|
+
|----|----|-----------|
|
|
302
|
+
|`_metadata`|`bytes`|ABI encoded module metadata (see LegacyMultisigIsmMetadata.sol)|
|
|
303
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
### _verifyValidatorSignatures
|
|
307
|
+
|
|
308
|
+
Verifies that a quorum of the origin domain's validators signed
|
|
309
|
+
the provided checkpoint.
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
```solidity
|
|
313
|
+
function _verifyValidatorSignatures(bytes calldata _metadata, bytes calldata _message) internal view returns (bool);
|
|
314
|
+
```
|
|
315
|
+
**Parameters**
|
|
316
|
+
|
|
317
|
+
|Name|Type|Description|
|
|
318
|
+
|----|----|-----------|
|
|
319
|
+
|`_metadata`|`bytes`|ABI encoded module metadata (see LegacyMultisigIsmMetadata.sol)|
|
|
320
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
## Events
|
|
324
|
+
### ValidatorEnrolled
|
|
325
|
+
Emitted when a validator is enrolled in a validator set.
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
```solidity
|
|
329
|
+
event ValidatorEnrolled(uint32 indexed domain, address indexed validator, uint256 validatorCount);
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### ValidatorUnenrolled
|
|
333
|
+
Emitted when a validator is unenrolled from a validator set.
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
```solidity
|
|
337
|
+
event ValidatorUnenrolled(uint32 indexed domain, address indexed validator, uint256 validatorCount);
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### ThresholdSet
|
|
341
|
+
Emitted when the quorum threshold is set.
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
```solidity
|
|
345
|
+
event ThresholdSet(uint32 indexed domain, uint8 threshold);
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### CommitmentUpdated
|
|
349
|
+
Emitted when the validator set or threshold changes.
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
```solidity
|
|
353
|
+
event CommitmentUpdated(uint32 domain, bytes32 commitment);
|
|
354
|
+
```
|
|
355
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Contents
|
|
4
|
+
- [AbstractMerkleRootMultisigIsm](AbstractMerkleRootMultisigIsm.sol/abstract.AbstractMerkleRootMultisigIsm.md)
|
|
5
|
+
- [AbstractMessageIdMultisigIsm](AbstractMessageIdMultisigIsm.sol/abstract.AbstractMessageIdMultisigIsm.md)
|
|
6
|
+
- [AbstractMultisigIsm](AbstractMultisigIsm.sol/abstract.AbstractMultisigIsm.md)
|
|
7
|
+
- [LegacyMultisigIsm](LegacyMultisigIsm.sol/contract.LegacyMultisigIsm.md)
|
|
8
|
+
- [AbstractMetaProxyMultisigIsm](StaticMultisigIsm.sol/abstract.AbstractMetaProxyMultisigIsm.md)
|
|
9
|
+
- [StaticMerkleRootMultisigIsm](StaticMultisigIsm.sol/contract.StaticMerkleRootMultisigIsm.md)
|
|
10
|
+
- [StaticMessageIdMultisigIsm](StaticMultisigIsm.sol/contract.StaticMessageIdMultisigIsm.md)
|
|
11
|
+
- [StaticMerkleRootMultisigIsmFactory](StaticMultisigIsm.sol/contract.StaticMerkleRootMultisigIsmFactory.md)
|
|
12
|
+
- [StaticMessageIdMultisigIsmFactory](StaticMultisigIsm.sol/contract.StaticMessageIdMultisigIsmFactory.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# AbstractMetaProxyMultisigIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/StaticMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[AbstractMultisigIsm](/contracts/isms/multisig/AbstractMultisigIsm.sol/abstract.AbstractMultisigIsm.md)
|
|
6
|
+
|
|
7
|
+
Manages per-domain m-of-n Validator set that is used
|
|
8
|
+
to verify interchain messages.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Functions
|
|
12
|
+
### validatorsAndThreshold
|
|
13
|
+
|
|
14
|
+
Returns the set of validators responsible for verifying _message
|
|
15
|
+
and the number of signatures required
|
|
16
|
+
|
|
17
|
+
*Can change based on the content of _message*
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
```solidity
|
|
21
|
+
function validatorsAndThreshold(bytes calldata) public pure override returns (address[] memory, uint8);
|
|
22
|
+
```
|
|
23
|
+
**Parameters**
|
|
24
|
+
|
|
25
|
+
|Name|Type|Description|
|
|
26
|
+
|----|----|-----------|
|
|
27
|
+
|`<none>`|`bytes`||
|
|
28
|
+
|
|
29
|
+
**Returns**
|
|
30
|
+
|
|
31
|
+
|Name|Type|Description|
|
|
32
|
+
|----|----|-----------|
|
|
33
|
+
|`<none>`|`address[]`|validators The array of validator addresses|
|
|
34
|
+
|`<none>`|`uint8`|threshold The number of validator signatures needed|
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# StaticMerkleRootMultisigIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/StaticMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[AbstractMerkleRootMultisigIsm](/contracts/isms/multisig/AbstractMerkleRootMultisigIsm.sol/abstract.AbstractMerkleRootMultisigIsm.md), [AbstractMetaProxyMultisigIsm](/contracts/isms/multisig/StaticMultisigIsm.sol/abstract.AbstractMetaProxyMultisigIsm.md)
|
|
6
|
+
|
|
7
|
+
Manages per-domain m-of-n validator set that is used
|
|
8
|
+
to verify interchain messages using a merkle root signature quorum
|
|
9
|
+
and merkle proof of inclusion.
|
|
10
|
+
|
|
11
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# StaticMerkleRootMultisigIsmFactory
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/StaticMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[StaticMOfNAddressSetFactory](/contracts/libs/StaticMOfNAddressSetFactory.sol/abstract.StaticMOfNAddressSetFactory.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Functions
|
|
9
|
+
### _deployImplementation
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
```solidity
|
|
13
|
+
function _deployImplementation() internal override returns (address);
|
|
14
|
+
```
|
|
15
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# StaticMessageIdMultisigIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/StaticMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[AbstractMessageIdMultisigIsm](/contracts/isms/multisig/AbstractMessageIdMultisigIsm.sol/abstract.AbstractMessageIdMultisigIsm.md), [AbstractMetaProxyMultisigIsm](/contracts/isms/multisig/StaticMultisigIsm.sol/abstract.AbstractMetaProxyMultisigIsm.md)
|
|
6
|
+
|
|
7
|
+
Manages per-domain m-of-n validator set that is used
|
|
8
|
+
to verify interchain messages using a message ID signature quorum.
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# StaticMessageIdMultisigIsmFactory
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/multisig/StaticMultisigIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[StaticMOfNAddressSetFactory](/contracts/libs/StaticMOfNAddressSetFactory.sol/abstract.StaticMOfNAddressSetFactory.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Functions
|
|
9
|
+
### _deployImplementation
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
```solidity
|
|
13
|
+
function _deployImplementation() internal override returns (address);
|
|
14
|
+
```
|
|
15
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# AbstractRoutingIsm
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/isms/routing/AbstractRoutingIsm.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[IRoutingIsm](/contracts/interfaces/isms/IRoutingIsm.sol/interface.IRoutingIsm.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## State Variables
|
|
9
|
+
### moduleType
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
uint8 public constant moduleType = uint8(IInterchainSecurityModule.Types.ROUTING);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Functions
|
|
17
|
+
### route
|
|
18
|
+
|
|
19
|
+
Returns the ISM responsible for verifying _message
|
|
20
|
+
|
|
21
|
+
*Can change based on the content of _message*
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
```solidity
|
|
25
|
+
function route(bytes calldata _message) public view virtual returns (IInterchainSecurityModule);
|
|
26
|
+
```
|
|
27
|
+
**Parameters**
|
|
28
|
+
|
|
29
|
+
|Name|Type|Description|
|
|
30
|
+
|----|----|-----------|
|
|
31
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
32
|
+
|
|
33
|
+
**Returns**
|
|
34
|
+
|
|
35
|
+
|Name|Type|Description|
|
|
36
|
+
|----|----|-----------|
|
|
37
|
+
|`<none>`|`IInterchainSecurityModule`|module The ISM to use to verify _message|
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### verify
|
|
41
|
+
|
|
42
|
+
Routes _metadata and _message to the correct ISM
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
```solidity
|
|
46
|
+
function verify(bytes calldata _metadata, bytes calldata _message) public returns (bool);
|
|
47
|
+
```
|
|
48
|
+
**Parameters**
|
|
49
|
+
|
|
50
|
+
|Name|Type|Description|
|
|
51
|
+
|----|----|-----------|
|
|
52
|
+
|`_metadata`|`bytes`|ABI encoded module metadata|
|
|
53
|
+
|`_message`|`bytes`|Formatted Hyperlane message (see Message.sol).|
|
|
54
|
+
|
|
55
|
+
|