@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,251 @@
|
|
|
1
|
+
# Mailbox
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/Mailbox.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[IMailbox](/contracts/interfaces/IMailbox.sol/interface.IMailbox.md), OwnableUpgradeable, [PausableReentrancyGuardUpgradeable](/contracts/PausableReentrancyGuard.sol/abstract.PausableReentrancyGuardUpgradeable.md), [Versioned](/contracts/upgrade/Versioned.sol/contract.Versioned.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## State Variables
|
|
9
|
+
### MAX_MESSAGE_BODY_BYTES
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
uint256 public constant MAX_MESSAGE_BODY_BYTES = 2 * 2 ** 10;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### localDomain
|
|
17
|
+
|
|
18
|
+
```solidity
|
|
19
|
+
uint32 public immutable localDomain;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### defaultIsm
|
|
24
|
+
|
|
25
|
+
```solidity
|
|
26
|
+
IInterchainSecurityModule public defaultIsm;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### tree
|
|
31
|
+
|
|
32
|
+
```solidity
|
|
33
|
+
MerkleLib.Tree public tree;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### delivered
|
|
38
|
+
|
|
39
|
+
```solidity
|
|
40
|
+
mapping(bytes32 => bool) public delivered;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### __GAP
|
|
45
|
+
|
|
46
|
+
```solidity
|
|
47
|
+
uint256[47] private __GAP;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## Functions
|
|
52
|
+
### constructor
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
```solidity
|
|
56
|
+
constructor(uint32 _localDomain);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### initialize
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
```solidity
|
|
63
|
+
function initialize(address _owner, address _defaultIsm) external initializer;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### setDefaultIsm
|
|
67
|
+
|
|
68
|
+
Sets the default ISM for the Mailbox.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
```solidity
|
|
72
|
+
function setDefaultIsm(address _module) external onlyOwner;
|
|
73
|
+
```
|
|
74
|
+
**Parameters**
|
|
75
|
+
|
|
76
|
+
|Name|Type|Description|
|
|
77
|
+
|----|----|-----------|
|
|
78
|
+
|`_module`|`address`|The new default ISM. Must be a contract.|
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### dispatch
|
|
82
|
+
|
|
83
|
+
Dispatches a message to the destination domain & recipient.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
```solidity
|
|
87
|
+
function dispatch(uint32 _destinationDomain, bytes32 _recipientAddress, bytes calldata _messageBody)
|
|
88
|
+
external
|
|
89
|
+
override
|
|
90
|
+
notPaused
|
|
91
|
+
returns (bytes32);
|
|
92
|
+
```
|
|
93
|
+
**Parameters**
|
|
94
|
+
|
|
95
|
+
|Name|Type|Description|
|
|
96
|
+
|----|----|-----------|
|
|
97
|
+
|`_destinationDomain`|`uint32`|Domain of destination chain|
|
|
98
|
+
|`_recipientAddress`|`bytes32`|Address of recipient on destination chain as bytes32|
|
|
99
|
+
|`_messageBody`|`bytes`|Raw bytes content of message body|
|
|
100
|
+
|
|
101
|
+
**Returns**
|
|
102
|
+
|
|
103
|
+
|Name|Type|Description|
|
|
104
|
+
|----|----|-----------|
|
|
105
|
+
|`<none>`|`bytes32`|The message ID inserted into the Mailbox's merkle tree|
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### process
|
|
109
|
+
|
|
110
|
+
Attempts to deliver `_message` to its recipient. Verifies
|
|
111
|
+
`_message` via the recipient's ISM using the provided `_metadata`.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
```solidity
|
|
115
|
+
function process(bytes calldata _metadata, bytes calldata _message) external override nonReentrantAndNotPaused;
|
|
116
|
+
```
|
|
117
|
+
**Parameters**
|
|
118
|
+
|
|
119
|
+
|Name|Type|Description|
|
|
120
|
+
|----|----|-----------|
|
|
121
|
+
|`_metadata`|`bytes`|Metadata used by the ISM to verify `_message`.|
|
|
122
|
+
|`_message`|`bytes`|Formatted Hyperlane message (refer to Message.sol).|
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### root
|
|
126
|
+
|
|
127
|
+
Calculates and returns tree's current root
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
```solidity
|
|
131
|
+
function root() public view returns (bytes32);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### count
|
|
135
|
+
|
|
136
|
+
Returns the number of inserted leaves in the tree
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
```solidity
|
|
140
|
+
function count() public view returns (uint32);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### latestCheckpoint
|
|
144
|
+
|
|
145
|
+
Returns a checkpoint representing the current merkle tree.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
```solidity
|
|
149
|
+
function latestCheckpoint() external view returns (bytes32, uint32);
|
|
150
|
+
```
|
|
151
|
+
**Returns**
|
|
152
|
+
|
|
153
|
+
|Name|Type|Description|
|
|
154
|
+
|----|----|-----------|
|
|
155
|
+
|`<none>`|`bytes32`|root The root of the Mailbox's merkle tree.|
|
|
156
|
+
|`<none>`|`uint32`|index The index of the last element in the tree.|
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### pause
|
|
160
|
+
|
|
161
|
+
Pauses mailbox and prevents further dispatch/process calls
|
|
162
|
+
|
|
163
|
+
*Only `owner` can pause the mailbox.*
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
```solidity
|
|
167
|
+
function pause() external onlyOwner;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### unpause
|
|
171
|
+
|
|
172
|
+
Unpauses mailbox and allows for message processing.
|
|
173
|
+
|
|
174
|
+
*Only `owner` can unpause the mailbox.*
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
```solidity
|
|
178
|
+
function unpause() external onlyOwner;
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### isPaused
|
|
182
|
+
|
|
183
|
+
Returns whether mailbox is paused.
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
```solidity
|
|
187
|
+
function isPaused() external view returns (bool);
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### recipientIsm
|
|
191
|
+
|
|
192
|
+
Returns the ISM to use for the recipient, defaulting to the
|
|
193
|
+
default ISM if none is specified.
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
```solidity
|
|
197
|
+
function recipientIsm(address _recipient) public view returns (IInterchainSecurityModule);
|
|
198
|
+
```
|
|
199
|
+
**Parameters**
|
|
200
|
+
|
|
201
|
+
|Name|Type|Description|
|
|
202
|
+
|----|----|-----------|
|
|
203
|
+
|`_recipient`|`address`|The message recipient whose ISM should be returned.|
|
|
204
|
+
|
|
205
|
+
**Returns**
|
|
206
|
+
|
|
207
|
+
|Name|Type|Description|
|
|
208
|
+
|----|----|-----------|
|
|
209
|
+
|`<none>`|`IInterchainSecurityModule`|The ISM to use for `_recipient`.|
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
### _setDefaultIsm
|
|
213
|
+
|
|
214
|
+
Sets the default ISM for the Mailbox.
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
```solidity
|
|
218
|
+
function _setDefaultIsm(address _module) internal;
|
|
219
|
+
```
|
|
220
|
+
**Parameters**
|
|
221
|
+
|
|
222
|
+
|Name|Type|Description|
|
|
223
|
+
|----|----|-----------|
|
|
224
|
+
|`_module`|`address`|The new default ISM. Must be a contract.|
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
## Events
|
|
228
|
+
### DefaultIsmSet
|
|
229
|
+
Emitted when the default ISM is updated
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
```solidity
|
|
233
|
+
event DefaultIsmSet(address indexed module);
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Paused
|
|
237
|
+
Emitted when Mailbox is paused
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
```solidity
|
|
241
|
+
event Paused();
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Unpaused
|
|
245
|
+
Emitted when Mailbox is unpaused
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
```solidity
|
|
249
|
+
event Unpaused();
|
|
250
|
+
```
|
|
251
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# OwnableMulticall
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/OwnableMulticall.sol)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## State Variables
|
|
6
|
+
### owner
|
|
7
|
+
|
|
8
|
+
```solidity
|
|
9
|
+
address public immutable owner;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Functions
|
|
14
|
+
### constructor
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
```solidity
|
|
18
|
+
constructor(address _owner);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### onlyOwner
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
```solidity
|
|
25
|
+
modifier onlyOwner();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### multicall
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
```solidity
|
|
32
|
+
function multicall(CallLib.Call[] calldata calls) external onlyOwner;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### receive
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
```solidity
|
|
39
|
+
receive() external payable;
|
|
40
|
+
```
|
|
41
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# PausableReentrancyGuardUpgradeable
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/PausableReentrancyGuard.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
Initializable
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## State Variables
|
|
9
|
+
### _ENTERED
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
uint256 private constant _ENTERED = 0;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### _NOT_ENTERED
|
|
17
|
+
|
|
18
|
+
```solidity
|
|
19
|
+
uint256 private constant _NOT_ENTERED = 1;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### _PAUSED
|
|
24
|
+
|
|
25
|
+
```solidity
|
|
26
|
+
uint256 private constant _PAUSED = 2;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### _status
|
|
31
|
+
|
|
32
|
+
```solidity
|
|
33
|
+
uint256 private _status;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### __gap
|
|
38
|
+
*This empty reserved space is put in place to allow future versions to add new
|
|
39
|
+
variables without shifting down storage in the inheritance chain.
|
|
40
|
+
See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps*
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
```solidity
|
|
44
|
+
uint256[49] private __gap;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Functions
|
|
49
|
+
### __PausableReentrancyGuard_init
|
|
50
|
+
|
|
51
|
+
*MUST be called for `nonReentrant` to not always revert*
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
```solidity
|
|
55
|
+
function __PausableReentrancyGuard_init() internal onlyInitializing;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### _isPaused
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
```solidity
|
|
62
|
+
function _isPaused() internal view returns (bool);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### _pause
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
```solidity
|
|
69
|
+
function _pause() internal notPaused;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### _unpause
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
```solidity
|
|
76
|
+
function _unpause() internal;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### notPaused
|
|
80
|
+
|
|
81
|
+
*Prevents a contract from being entered when paused.*
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
```solidity
|
|
85
|
+
modifier notPaused();
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### nonReentrantAndNotPaused
|
|
89
|
+
|
|
90
|
+
*Prevents a contract from calling itself, directly or indirectly.
|
|
91
|
+
Calling a `nonReentrant` function from another `nonReentrant`
|
|
92
|
+
function is not supported. It is possible to prevent this from happening
|
|
93
|
+
by making the `nonReentrant` function external, and making it call a
|
|
94
|
+
`private` function that does the actual work.*
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
```solidity
|
|
98
|
+
modifier nonReentrantAndNotPaused();
|
|
99
|
+
```
|
|
100
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Contents
|
|
4
|
+
- [hooks](/contracts/hooks)
|
|
5
|
+
- [igps](/contracts/igps)
|
|
6
|
+
- [interfaces](/contracts/interfaces)
|
|
7
|
+
- [isms](/contracts/isms)
|
|
8
|
+
- [libs](/contracts/libs)
|
|
9
|
+
- [middleware](/contracts/middleware)
|
|
10
|
+
- [mock](/contracts/mock)
|
|
11
|
+
- [test](/contracts/test)
|
|
12
|
+
- [upgrade](/contracts/upgrade)
|
|
13
|
+
- [GasRouter](GasRouter.sol/abstract.GasRouter.md)
|
|
14
|
+
- [HyperlaneConnectionClient](HyperlaneConnectionClient.sol/abstract.HyperlaneConnectionClient.md)
|
|
15
|
+
- [Mailbox](Mailbox.sol/contract.Mailbox.md)
|
|
16
|
+
- [OwnableMulticall](OwnableMulticall.sol/contract.OwnableMulticall.md)
|
|
17
|
+
- [PausableReentrancyGuardUpgradeable](PausableReentrancyGuard.sol/abstract.PausableReentrancyGuardUpgradeable.md)
|
|
18
|
+
- [Router](Router.sol/abstract.Router.md)
|
|
19
|
+
- [ValidatorAnnounce](ValidatorAnnounce.sol/contract.ValidatorAnnounce.md)
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Router
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/Router.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[HyperlaneConnectionClient](/contracts/HyperlaneConnectionClient.sol/abstract.HyperlaneConnectionClient.md), [IMessageRecipient](/contracts/interfaces/IMessageRecipient.sol/interface.IMessageRecipient.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## State Variables
|
|
9
|
+
### NO_ROUTER_ENROLLED_REVERT_MESSAGE
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
string private constant NO_ROUTER_ENROLLED_REVERT_MESSAGE =
|
|
13
|
+
"No router enrolled for domain. Did you specify the right domain ID?";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### _routers
|
|
18
|
+
|
|
19
|
+
```solidity
|
|
20
|
+
EnumerableMapExtended.UintToBytes32Map internal _routers;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### __GAP
|
|
25
|
+
|
|
26
|
+
```solidity
|
|
27
|
+
uint256[49] private __GAP;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Functions
|
|
32
|
+
### onlyRemoteRouter
|
|
33
|
+
|
|
34
|
+
Only accept messages from a remote Router contract
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
```solidity
|
|
38
|
+
modifier onlyRemoteRouter(uint32 _origin, bytes32 _router);
|
|
39
|
+
```
|
|
40
|
+
**Parameters**
|
|
41
|
+
|
|
42
|
+
|Name|Type|Description|
|
|
43
|
+
|----|----|-----------|
|
|
44
|
+
|`_origin`|`uint32`|The domain the message is coming from|
|
|
45
|
+
|`_router`|`bytes32`|The address the message is coming from|
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### __Router_initialize
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
```solidity
|
|
52
|
+
function __Router_initialize(address _mailbox) internal onlyInitializing;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### __Router_initialize
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
```solidity
|
|
59
|
+
function __Router_initialize(address _mailbox, address _interchainGasPaymaster) internal onlyInitializing;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### __Router_initialize
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
```solidity
|
|
66
|
+
function __Router_initialize(address _mailbox, address _interchainGasPaymaster, address _interchainSecurityModule)
|
|
67
|
+
internal
|
|
68
|
+
onlyInitializing;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### domains
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
```solidity
|
|
75
|
+
function domains() external view returns (uint32[] memory);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### routers
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
```solidity
|
|
82
|
+
function routers(uint32 _domain) public view returns (bytes32);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### enrollRemoteRouter
|
|
86
|
+
|
|
87
|
+
Register the address of a Router contract for the same Application on a remote chain
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
```solidity
|
|
91
|
+
function enrollRemoteRouter(uint32 _domain, bytes32 _router) external virtual onlyOwner;
|
|
92
|
+
```
|
|
93
|
+
**Parameters**
|
|
94
|
+
|
|
95
|
+
|Name|Type|Description|
|
|
96
|
+
|----|----|-----------|
|
|
97
|
+
|`_domain`|`uint32`|The domain of the remote Application Router|
|
|
98
|
+
|`_router`|`bytes32`|The address of the remote Application Router|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### enrollRemoteRouters
|
|
102
|
+
|
|
103
|
+
Batch version of `enrollRemoteRouter`
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
```solidity
|
|
107
|
+
function enrollRemoteRouters(uint32[] calldata _domains, bytes32[] calldata _addresses) external virtual onlyOwner;
|
|
108
|
+
```
|
|
109
|
+
**Parameters**
|
|
110
|
+
|
|
111
|
+
|Name|Type|Description|
|
|
112
|
+
|----|----|-----------|
|
|
113
|
+
|`_domains`|`uint32[]`|The domaisn of the remote Application Routers|
|
|
114
|
+
|`_addresses`|`bytes32[]`|The addresses of the remote Application Routers|
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### handle
|
|
118
|
+
|
|
119
|
+
Handles an incoming message
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
```solidity
|
|
123
|
+
function handle(uint32 _origin, bytes32 _sender, bytes calldata _message)
|
|
124
|
+
external
|
|
125
|
+
virtual
|
|
126
|
+
override
|
|
127
|
+
onlyMailbox
|
|
128
|
+
onlyRemoteRouter(_origin, _sender);
|
|
129
|
+
```
|
|
130
|
+
**Parameters**
|
|
131
|
+
|
|
132
|
+
|Name|Type|Description|
|
|
133
|
+
|----|----|-----------|
|
|
134
|
+
|`_origin`|`uint32`|The origin domain|
|
|
135
|
+
|`_sender`|`bytes32`|The sender address|
|
|
136
|
+
|`_message`|`bytes`|The message|
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### _handle
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
```solidity
|
|
143
|
+
function _handle(uint32 _origin, bytes32 _sender, bytes calldata _message) internal virtual;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### _enrollRemoteRouter
|
|
147
|
+
|
|
148
|
+
Set the router for a given domain
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
```solidity
|
|
152
|
+
function _enrollRemoteRouter(uint32 _domain, bytes32 _address) internal;
|
|
153
|
+
```
|
|
154
|
+
**Parameters**
|
|
155
|
+
|
|
156
|
+
|Name|Type|Description|
|
|
157
|
+
|----|----|-----------|
|
|
158
|
+
|`_domain`|`uint32`|The domain|
|
|
159
|
+
|`_address`|`bytes32`|The new router|
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### _isRemoteRouter
|
|
163
|
+
|
|
164
|
+
Return true if the given domain / router is the address of a remote Application Router
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
```solidity
|
|
168
|
+
function _isRemoteRouter(uint32 _domain, bytes32 _address) internal view returns (bool);
|
|
169
|
+
```
|
|
170
|
+
**Parameters**
|
|
171
|
+
|
|
172
|
+
|Name|Type|Description|
|
|
173
|
+
|----|----|-----------|
|
|
174
|
+
|`_domain`|`uint32`|The domain of the potential remote Application Router|
|
|
175
|
+
|`_address`|`bytes32`|The address of the potential remote Application Router|
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
### _mustHaveRemoteRouter
|
|
179
|
+
|
|
180
|
+
Assert that the given domain has a Application Router registered and return its address
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
```solidity
|
|
184
|
+
function _mustHaveRemoteRouter(uint32 _domain) internal view returns (bytes32 _router);
|
|
185
|
+
```
|
|
186
|
+
**Parameters**
|
|
187
|
+
|
|
188
|
+
|Name|Type|Description|
|
|
189
|
+
|----|----|-----------|
|
|
190
|
+
|`_domain`|`uint32`|The domain of the chain for which to get the Application Router|
|
|
191
|
+
|
|
192
|
+
**Returns**
|
|
193
|
+
|
|
194
|
+
|Name|Type|Description|
|
|
195
|
+
|----|----|-----------|
|
|
196
|
+
|`_router`|`bytes32`|The address of the remote Application Router on _domain|
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### _dispatchWithGas
|
|
200
|
+
|
|
201
|
+
Dispatches a message to an enrolled router via the local router's Mailbox
|
|
202
|
+
and pays for it to be relayed to the destination.
|
|
203
|
+
|
|
204
|
+
*Reverts if there is no enrolled router for _destinationDomain.*
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
```solidity
|
|
208
|
+
function _dispatchWithGas(
|
|
209
|
+
uint32 _destinationDomain,
|
|
210
|
+
bytes memory _messageBody,
|
|
211
|
+
uint256 _gasAmount,
|
|
212
|
+
uint256 _gasPayment,
|
|
213
|
+
address _gasPaymentRefundAddress
|
|
214
|
+
) internal returns (bytes32 _messageId);
|
|
215
|
+
```
|
|
216
|
+
**Parameters**
|
|
217
|
+
|
|
218
|
+
|Name|Type|Description|
|
|
219
|
+
|----|----|-----------|
|
|
220
|
+
|`_destinationDomain`|`uint32`|The domain of the chain to which to send the message.|
|
|
221
|
+
|`_messageBody`|`bytes`|Raw bytes content of message.|
|
|
222
|
+
|`_gasAmount`|`uint256`|The amount of destination gas for the message that is requested via the InterchainGasPaymaster.|
|
|
223
|
+
|`_gasPayment`|`uint256`|The amount of native tokens to pay for the message to be relayed.|
|
|
224
|
+
|`_gasPaymentRefundAddress`|`address`|The address to refund any gas overpayment to.|
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### _dispatch
|
|
228
|
+
|
|
229
|
+
Dispatches a message to an enrolled router via the provided Mailbox.
|
|
230
|
+
|
|
231
|
+
*Does not pay interchain gas.*
|
|
232
|
+
|
|
233
|
+
*Reverts if there is no enrolled router for _destinationDomain.*
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
```solidity
|
|
237
|
+
function _dispatch(uint32 _destinationDomain, bytes memory _messageBody) internal virtual returns (bytes32);
|
|
238
|
+
```
|
|
239
|
+
**Parameters**
|
|
240
|
+
|
|
241
|
+
|Name|Type|Description|
|
|
242
|
+
|----|----|-----------|
|
|
243
|
+
|`_destinationDomain`|`uint32`|The domain of the chain to which to send the message.|
|
|
244
|
+
|`_messageBody`|`bytes`|Raw bytes content of message.|
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
## Events
|
|
248
|
+
### RemoteRouterEnrolled
|
|
249
|
+
Emitted when a router is set.
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
```solidity
|
|
253
|
+
event RemoteRouterEnrolled(uint32 indexed domain, bytes32 router);
|
|
254
|
+
```
|
|
255
|
+
|