@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,542 @@
|
|
|
1
|
+
# InterchainAccountRouter
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/middleware/InterchainAccountRouter.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[HyperlaneConnectionClient](/contracts/HyperlaneConnectionClient.sol/abstract.HyperlaneConnectionClient.md), [IRouter](/contracts/interfaces/IRouter.sol/interface.IRouter.md), [IInterchainAccountRouter](/contracts/interfaces/middleware/IInterchainAccountRouter.sol/interface.IInterchainAccountRouter.md)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## State Variables
|
|
9
|
+
### localDomain
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
uint32 internal immutable localDomain;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### implementation
|
|
17
|
+
|
|
18
|
+
```solidity
|
|
19
|
+
address internal implementation;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### bytecodeHash
|
|
24
|
+
|
|
25
|
+
```solidity
|
|
26
|
+
bytes32 internal bytecodeHash;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### _domains
|
|
31
|
+
|
|
32
|
+
```solidity
|
|
33
|
+
uint32[] private _domains;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### routers
|
|
38
|
+
|
|
39
|
+
```solidity
|
|
40
|
+
mapping(uint32 => bytes32) public routers;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### isms
|
|
45
|
+
|
|
46
|
+
```solidity
|
|
47
|
+
mapping(uint32 => bytes32) public isms;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### __GAP
|
|
52
|
+
|
|
53
|
+
```solidity
|
|
54
|
+
uint256[47] private __GAP;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Functions
|
|
59
|
+
### constructor
|
|
60
|
+
|
|
61
|
+
Constructor deploys a relay (OwnableMulticall.sol) contract that
|
|
62
|
+
will be cloned for each interchain account.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
```solidity
|
|
66
|
+
constructor(uint32 _localDomain);
|
|
67
|
+
```
|
|
68
|
+
**Parameters**
|
|
69
|
+
|
|
70
|
+
|Name|Type|Description|
|
|
71
|
+
|----|----|-----------|
|
|
72
|
+
|`_localDomain`|`uint32`|The Hyperlane domain ID on which this contract is deployed.|
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### initialize
|
|
76
|
+
|
|
77
|
+
Initializes the contract with HyperlaneConnectionClient contracts
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
```solidity
|
|
81
|
+
function initialize(
|
|
82
|
+
address _mailbox,
|
|
83
|
+
address _interchainGasPaymaster,
|
|
84
|
+
address _interchainSecurityModule,
|
|
85
|
+
address _owner
|
|
86
|
+
) external initializer;
|
|
87
|
+
```
|
|
88
|
+
**Parameters**
|
|
89
|
+
|
|
90
|
+
|Name|Type|Description|
|
|
91
|
+
|----|----|-----------|
|
|
92
|
+
|`_mailbox`|`address`|The address of the mailbox contract|
|
|
93
|
+
|`_interchainGasPaymaster`|`address`|Unused but required by HyperlaneConnectionClient|
|
|
94
|
+
|`_interchainSecurityModule`|`address`|The address of the local ISM contract|
|
|
95
|
+
|`_owner`|`address`|The address with owner privileges|
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### enrollRemoteRouters
|
|
99
|
+
|
|
100
|
+
Registers the address of many remote InterchainAccountRouter
|
|
101
|
+
contracts to use as a default when making interchain calls
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
```solidity
|
|
105
|
+
function enrollRemoteRouters(uint32[] calldata _destinations, bytes32[] calldata _routers) external onlyOwner;
|
|
106
|
+
```
|
|
107
|
+
**Parameters**
|
|
108
|
+
|
|
109
|
+
|Name|Type|Description|
|
|
110
|
+
|----|----|-----------|
|
|
111
|
+
|`_destinations`|`uint32[]`|The remote domains|
|
|
112
|
+
|`_routers`|`bytes32[]`|The addresses of the remote InterchainAccountRouters|
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### callRemote
|
|
116
|
+
|
|
117
|
+
Dispatches a single remote call to be made by an owner's
|
|
118
|
+
interchain account on the destination domain
|
|
119
|
+
|
|
120
|
+
*Uses the default router and ISM addresses for the destination
|
|
121
|
+
domain, reverting if none have been configured*
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
```solidity
|
|
125
|
+
function callRemote(uint32 _destination, address _to, uint256 _value, bytes memory _data) external returns (bytes32);
|
|
126
|
+
```
|
|
127
|
+
**Parameters**
|
|
128
|
+
|
|
129
|
+
|Name|Type|Description|
|
|
130
|
+
|----|----|-----------|
|
|
131
|
+
|`_destination`|`uint32`|The remote domain of the chain to make calls on|
|
|
132
|
+
|`_to`|`address`|The address of the contract to call|
|
|
133
|
+
|`_value`|`uint256`|The value to include in the call|
|
|
134
|
+
|`_data`|`bytes`|The calldata|
|
|
135
|
+
|
|
136
|
+
**Returns**
|
|
137
|
+
|
|
138
|
+
|Name|Type|Description|
|
|
139
|
+
|----|----|-----------|
|
|
140
|
+
|`<none>`|`bytes32`|The Hyperlane message ID|
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### callRemote
|
|
144
|
+
|
|
145
|
+
Dispatches a sequence of remote calls to be made by an owner's
|
|
146
|
+
interchain account on the destination domain
|
|
147
|
+
|
|
148
|
+
*Uses the default router and ISM addresses for the destination
|
|
149
|
+
domain, reverting if none have been configured*
|
|
150
|
+
|
|
151
|
+
*Recommend using CallLib.build to format the interchain calls.*
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
```solidity
|
|
155
|
+
function callRemote(uint32 _destination, CallLib.Call[] calldata _calls) external returns (bytes32);
|
|
156
|
+
```
|
|
157
|
+
**Parameters**
|
|
158
|
+
|
|
159
|
+
|Name|Type|Description|
|
|
160
|
+
|----|----|-----------|
|
|
161
|
+
|`_destination`|`uint32`|The remote domain of the chain to make calls on|
|
|
162
|
+
|`_calls`|`CallLib.Call[]`|The sequence of calls to make|
|
|
163
|
+
|
|
164
|
+
**Returns**
|
|
165
|
+
|
|
166
|
+
|Name|Type|Description|
|
|
167
|
+
|----|----|-----------|
|
|
168
|
+
|`<none>`|`bytes32`|The Hyperlane message ID|
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
### handle
|
|
172
|
+
|
|
173
|
+
Handles dispatched messages by relaying calls to the interchain account
|
|
174
|
+
|
|
175
|
+
*Does not need to be onlyRemoteRouter, as this application is designed
|
|
176
|
+
to receive messages from untrusted remote contracts.*
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
```solidity
|
|
180
|
+
function handle(uint32 _origin, bytes32 _sender, bytes calldata _message) external onlyMailbox;
|
|
181
|
+
```
|
|
182
|
+
**Parameters**
|
|
183
|
+
|
|
184
|
+
|Name|Type|Description|
|
|
185
|
+
|----|----|-----------|
|
|
186
|
+
|`_origin`|`uint32`|The origin domain of the interchain account|
|
|
187
|
+
|`_sender`|`bytes32`|The sender of the interchain message|
|
|
188
|
+
|`_message`|`bytes`|The InterchainAccountMessage containing the account owner, ISM, and sequence of calls to be relayed|
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### getLocalInterchainAccount
|
|
192
|
+
|
|
193
|
+
Returns the local address of an interchain account
|
|
194
|
+
|
|
195
|
+
*This interchain account is not guaranteed to have been deployed*
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
```solidity
|
|
199
|
+
function getLocalInterchainAccount(uint32 _origin, address _owner, address _router, address _ism)
|
|
200
|
+
external
|
|
201
|
+
view
|
|
202
|
+
returns (OwnableMulticall);
|
|
203
|
+
```
|
|
204
|
+
**Parameters**
|
|
205
|
+
|
|
206
|
+
|Name|Type|Description|
|
|
207
|
+
|----|----|-----------|
|
|
208
|
+
|`_origin`|`uint32`|The remote origin domain of the interchain account|
|
|
209
|
+
|`_owner`|`address`|The remote owner of the interchain account|
|
|
210
|
+
|`_router`|`address`|The remote origin InterchainAccountRouter|
|
|
211
|
+
|`_ism`|`address`|The local address of the ISM|
|
|
212
|
+
|
|
213
|
+
**Returns**
|
|
214
|
+
|
|
215
|
+
|Name|Type|Description|
|
|
216
|
+
|----|----|-----------|
|
|
217
|
+
|`<none>`|`OwnableMulticall`|The local address of the interchain account|
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
### getRemoteInterchainAccount
|
|
221
|
+
|
|
222
|
+
Returns the remote address of a locally owned interchain account
|
|
223
|
+
|
|
224
|
+
*This interchain account is not guaranteed to have been deployed*
|
|
225
|
+
|
|
226
|
+
*This function will only work if the destination domain is
|
|
227
|
+
EVM compatible*
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
```solidity
|
|
231
|
+
function getRemoteInterchainAccount(uint32 _destination, address _owner) external view returns (address);
|
|
232
|
+
```
|
|
233
|
+
**Parameters**
|
|
234
|
+
|
|
235
|
+
|Name|Type|Description|
|
|
236
|
+
|----|----|-----------|
|
|
237
|
+
|`_destination`|`uint32`|The remote destination domain of the interchain account|
|
|
238
|
+
|`_owner`|`address`|The local owner of the interchain account|
|
|
239
|
+
|
|
240
|
+
**Returns**
|
|
241
|
+
|
|
242
|
+
|Name|Type|Description|
|
|
243
|
+
|----|----|-----------|
|
|
244
|
+
|`<none>`|`address`|The remote address of the interchain account|
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
### domains
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
```solidity
|
|
251
|
+
function domains() external view returns (uint32[] memory);
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### enrollRemoteRouter
|
|
255
|
+
|
|
256
|
+
Registers the address of a remote InterchainAccountRouter
|
|
257
|
+
contract to use as a default when making interchain calls
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
```solidity
|
|
261
|
+
function enrollRemoteRouter(uint32 _destination, bytes32 _router) public onlyOwner;
|
|
262
|
+
```
|
|
263
|
+
**Parameters**
|
|
264
|
+
|
|
265
|
+
|Name|Type|Description|
|
|
266
|
+
|----|----|-----------|
|
|
267
|
+
|`_destination`|`uint32`|The remote domain|
|
|
268
|
+
|`_router`|`bytes32`|The address of the remote InterchainAccountRouter|
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
### enrollRemoteRouterAndIsm
|
|
272
|
+
|
|
273
|
+
Registers the address of remote InterchainAccountRouter
|
|
274
|
+
and ISM contracts to use as a default when making interchain calls
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
```solidity
|
|
278
|
+
function enrollRemoteRouterAndIsm(uint32 _destination, bytes32 _router, bytes32 _ism) public onlyOwner;
|
|
279
|
+
```
|
|
280
|
+
**Parameters**
|
|
281
|
+
|
|
282
|
+
|Name|Type|Description|
|
|
283
|
+
|----|----|-----------|
|
|
284
|
+
|`_destination`|`uint32`|The remote domain|
|
|
285
|
+
|`_router`|`bytes32`|The address of the remote InterchainAccountRouter|
|
|
286
|
+
|`_ism`|`bytes32`|The address of the remote ISM|
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
### callRemoteWithOverrides
|
|
290
|
+
|
|
291
|
+
Dispatches a sequence of remote calls to be made by an owner's
|
|
292
|
+
interchain account on the destination domain
|
|
293
|
+
|
|
294
|
+
*Recommend using CallLib.build to format the interchain calls*
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
```solidity
|
|
298
|
+
function callRemoteWithOverrides(uint32 _destination, bytes32 _router, bytes32 _ism, CallLib.Call[] calldata _calls)
|
|
299
|
+
public
|
|
300
|
+
returns (bytes32);
|
|
301
|
+
```
|
|
302
|
+
**Parameters**
|
|
303
|
+
|
|
304
|
+
|Name|Type|Description|
|
|
305
|
+
|----|----|-----------|
|
|
306
|
+
|`_destination`|`uint32`|The remote domain of the chain to make calls on|
|
|
307
|
+
|`_router`|`bytes32`|The remote router address|
|
|
308
|
+
|`_ism`|`bytes32`|The remote ISM address|
|
|
309
|
+
|`_calls`|`CallLib.Call[]`|The sequence of calls to make|
|
|
310
|
+
|
|
311
|
+
**Returns**
|
|
312
|
+
|
|
313
|
+
|Name|Type|Description|
|
|
314
|
+
|----|----|-----------|
|
|
315
|
+
|`<none>`|`bytes32`|The Hyperlane message ID|
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
### getDeployedInterchainAccount
|
|
319
|
+
|
|
320
|
+
Returns and deploys (if not already) an interchain account
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
```solidity
|
|
324
|
+
function getDeployedInterchainAccount(uint32 _origin, address _owner, address _router, address _ism)
|
|
325
|
+
public
|
|
326
|
+
returns (OwnableMulticall);
|
|
327
|
+
```
|
|
328
|
+
**Parameters**
|
|
329
|
+
|
|
330
|
+
|Name|Type|Description|
|
|
331
|
+
|----|----|-----------|
|
|
332
|
+
|`_origin`|`uint32`|The remote origin domain of the interchain account|
|
|
333
|
+
|`_owner`|`address`|The remote owner of the interchain account|
|
|
334
|
+
|`_router`|`address`|The remote origin InterchainAccountRouter|
|
|
335
|
+
|`_ism`|`address`|The local address of the ISM|
|
|
336
|
+
|
|
337
|
+
**Returns**
|
|
338
|
+
|
|
339
|
+
|Name|Type|Description|
|
|
340
|
+
|----|----|-----------|
|
|
341
|
+
|`<none>`|`OwnableMulticall`|The address of the interchain account|
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
### getDeployedInterchainAccount
|
|
345
|
+
|
|
346
|
+
Returns and deploys (if not already) an interchain account
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
```solidity
|
|
350
|
+
function getDeployedInterchainAccount(uint32 _origin, bytes32 _owner, bytes32 _router, address _ism)
|
|
351
|
+
public
|
|
352
|
+
returns (OwnableMulticall);
|
|
353
|
+
```
|
|
354
|
+
**Parameters**
|
|
355
|
+
|
|
356
|
+
|Name|Type|Description|
|
|
357
|
+
|----|----|-----------|
|
|
358
|
+
|`_origin`|`uint32`|The remote origin domain of the interchain account|
|
|
359
|
+
|`_owner`|`bytes32`|The remote owner of the interchain account|
|
|
360
|
+
|`_router`|`bytes32`|The remote origin InterchainAccountRouter|
|
|
361
|
+
|`_ism`|`address`|The local address of the ISM|
|
|
362
|
+
|
|
363
|
+
**Returns**
|
|
364
|
+
|
|
365
|
+
|Name|Type|Description|
|
|
366
|
+
|----|----|-----------|
|
|
367
|
+
|`<none>`|`OwnableMulticall`|The address of the interchain account|
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
### getLocalInterchainAccount
|
|
371
|
+
|
|
372
|
+
Returns the local address of a remotely owned interchain account
|
|
373
|
+
|
|
374
|
+
*This interchain account is not guaranteed to have been deployed*
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
```solidity
|
|
378
|
+
function getLocalInterchainAccount(uint32 _origin, bytes32 _owner, bytes32 _router, address _ism)
|
|
379
|
+
public
|
|
380
|
+
view
|
|
381
|
+
returns (OwnableMulticall);
|
|
382
|
+
```
|
|
383
|
+
**Parameters**
|
|
384
|
+
|
|
385
|
+
|Name|Type|Description|
|
|
386
|
+
|----|----|-----------|
|
|
387
|
+
|`_origin`|`uint32`|The remote origin domain of the interchain account|
|
|
388
|
+
|`_owner`|`bytes32`|The remote owner of the interchain account|
|
|
389
|
+
|`_router`|`bytes32`|The remote InterchainAccountRouter|
|
|
390
|
+
|`_ism`|`address`|The local address of the ISM|
|
|
391
|
+
|
|
392
|
+
**Returns**
|
|
393
|
+
|
|
394
|
+
|Name|Type|Description|
|
|
395
|
+
|----|----|-----------|
|
|
396
|
+
|`<none>`|`OwnableMulticall`|The local address of the interchain account|
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
### getRemoteInterchainAccount
|
|
400
|
+
|
|
401
|
+
Returns the remote address of a locally owned interchain account
|
|
402
|
+
|
|
403
|
+
*This interchain account is not guaranteed to have been deployed*
|
|
404
|
+
|
|
405
|
+
*This function will only work if the destination domain is
|
|
406
|
+
EVM compatible*
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
```solidity
|
|
410
|
+
function getRemoteInterchainAccount(address _owner, address _router, address _ism) public view returns (address);
|
|
411
|
+
```
|
|
412
|
+
**Parameters**
|
|
413
|
+
|
|
414
|
+
|Name|Type|Description|
|
|
415
|
+
|----|----|-----------|
|
|
416
|
+
|`_owner`|`address`|The local owner of the interchain account|
|
|
417
|
+
|`_router`|`address`|The remote InterchainAccountRouter|
|
|
418
|
+
|`_ism`|`address`|The remote address of the ISM|
|
|
419
|
+
|
|
420
|
+
**Returns**
|
|
421
|
+
|
|
422
|
+
|Name|Type|Description|
|
|
423
|
+
|----|----|-----------|
|
|
424
|
+
|`<none>`|`address`|The remote address of the interchain account|
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
### _enrollRemoteRouterAndIsm
|
|
428
|
+
|
|
429
|
+
Registers the address of remote InterchainAccountRouter
|
|
430
|
+
and ISM contracts to use as a default when making interchain calls
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
```solidity
|
|
434
|
+
function _enrollRemoteRouterAndIsm(uint32 _destination, bytes32 _router, bytes32 _ism) private;
|
|
435
|
+
```
|
|
436
|
+
**Parameters**
|
|
437
|
+
|
|
438
|
+
|Name|Type|Description|
|
|
439
|
+
|----|----|-----------|
|
|
440
|
+
|`_destination`|`uint32`|The remote domain|
|
|
441
|
+
|`_router`|`bytes32`|The address of the remote InterchainAccountRouter|
|
|
442
|
+
|`_ism`|`bytes32`|The address of the remote ISM|
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
### _dispatchMessage
|
|
446
|
+
|
|
447
|
+
Dispatches an InterchainAccountMessage to the remote router
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
```solidity
|
|
451
|
+
function _dispatchMessage(uint32 _destination, bytes32 _router, bytes32 _ism, bytes memory _body)
|
|
452
|
+
private
|
|
453
|
+
returns (bytes32);
|
|
454
|
+
```
|
|
455
|
+
**Parameters**
|
|
456
|
+
|
|
457
|
+
|Name|Type|Description|
|
|
458
|
+
|----|----|-----------|
|
|
459
|
+
|`_destination`|`uint32`|The remote domain|
|
|
460
|
+
|`_router`|`bytes32`|The address of the remote InterchainAccountRouter|
|
|
461
|
+
|`_ism`|`bytes32`|The address of the remote ISM|
|
|
462
|
+
|`_body`|`bytes`|The InterchainAccountMessage body|
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
### _getSalt
|
|
466
|
+
|
|
467
|
+
Returns the salt used to deploy an interchain account
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
```solidity
|
|
471
|
+
function _getSalt(uint32 _origin, bytes32 _owner, bytes32 _router, bytes32 _ism) private pure returns (bytes32);
|
|
472
|
+
```
|
|
473
|
+
**Parameters**
|
|
474
|
+
|
|
475
|
+
|Name|Type|Description|
|
|
476
|
+
|----|----|-----------|
|
|
477
|
+
|`_origin`|`uint32`|The remote origin domain of the interchain account|
|
|
478
|
+
|`_owner`|`bytes32`|The remote owner of the interchain account|
|
|
479
|
+
|`_router`|`bytes32`|The remote origin InterchainAccountRouter|
|
|
480
|
+
|`_ism`|`bytes32`|The local address of the ISM|
|
|
481
|
+
|
|
482
|
+
**Returns**
|
|
483
|
+
|
|
484
|
+
|Name|Type|Description|
|
|
485
|
+
|----|----|-----------|
|
|
486
|
+
|`<none>`|`bytes32`|The CREATE2 salt used for deploying the interchain account|
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
### _getLocalInterchainAccount
|
|
490
|
+
|
|
491
|
+
Returns the address of the interchain account on the local chain
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
```solidity
|
|
495
|
+
function _getLocalInterchainAccount(bytes32 _salt) private view returns (address payable);
|
|
496
|
+
```
|
|
497
|
+
**Parameters**
|
|
498
|
+
|
|
499
|
+
|Name|Type|Description|
|
|
500
|
+
|----|----|-----------|
|
|
501
|
+
|`_salt`|`bytes32`|The CREATE2 salt used for deploying the interchain account|
|
|
502
|
+
|
|
503
|
+
**Returns**
|
|
504
|
+
|
|
505
|
+
|Name|Type|Description|
|
|
506
|
+
|----|----|-----------|
|
|
507
|
+
|`<none>`|`address payable`|The address of the interchain account|
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
## Events
|
|
511
|
+
### RemoteRouterEnrolled
|
|
512
|
+
Emitted when a default router is set for a remote domain
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
```solidity
|
|
516
|
+
event RemoteRouterEnrolled(uint32 indexed domain, bytes32 router);
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### RemoteIsmEnrolled
|
|
520
|
+
Emitted when a default ISM is set for a remote domain
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
```solidity
|
|
524
|
+
event RemoteIsmEnrolled(uint32 indexed domain, bytes32 ism);
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### RemoteCallDispatched
|
|
528
|
+
Emitted when an interchain call is dispatched to a remote domain
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
```solidity
|
|
532
|
+
event RemoteCallDispatched(uint32 indexed destination, address indexed owner, bytes32 router, bytes32 ism);
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### InterchainAccountCreated
|
|
536
|
+
Emitted when an interchain account contract is deployed
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
```solidity
|
|
540
|
+
event InterchainAccountCreated(uint32 indexed origin, bytes32 indexed owner, address ism, address account);
|
|
541
|
+
```
|
|
542
|
+
|
package/docs/src/contracts/middleware/InterchainQueryRouter.sol/contract.InterchainQueryRouter.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# InterchainQueryRouter
|
|
2
|
+
[Git Source](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/a5209dbd9b0f5eb34e0bc9df2ba157dda2b454d3/contracts/middleware/InterchainQueryRouter.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[Router](/contracts/Router.sol/abstract.Router.md), [IInterchainQueryRouter](/contracts/interfaces/middleware/IInterchainQueryRouter.sol/interface.IInterchainQueryRouter.md)
|
|
6
|
+
|
|
7
|
+
*Currently does not support Sovereign Consensus (user specified Interchain Security Modules).*
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Functions
|
|
11
|
+
### initialize
|
|
12
|
+
|
|
13
|
+
Initializes the Router contract with Hyperlane core contracts and the address of the interchain security module.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```solidity
|
|
17
|
+
function initialize(
|
|
18
|
+
address _mailbox,
|
|
19
|
+
address _interchainGasPaymaster,
|
|
20
|
+
address _interchainSecurityModule,
|
|
21
|
+
address _owner
|
|
22
|
+
) external initializer;
|
|
23
|
+
```
|
|
24
|
+
**Parameters**
|
|
25
|
+
|
|
26
|
+
|Name|Type|Description|
|
|
27
|
+
|----|----|-----------|
|
|
28
|
+
|`_mailbox`|`address`|The address of the mailbox contract.|
|
|
29
|
+
|`_interchainGasPaymaster`|`address`|The address of the interchain gas paymaster contract.|
|
|
30
|
+
|`_interchainSecurityModule`|`address`|The address of the interchain security module contract.|
|
|
31
|
+
|`_owner`|`address`|The address with owner privileges.|
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### query
|
|
35
|
+
|
|
36
|
+
Dispatches a sequence of static calls (query) to the destination domain and set of callbacks to resolve the results on the dispatcher.
|
|
37
|
+
|
|
38
|
+
*Callbacks must be returned to the `msg.sender` for security reasons. Require this contract is the `msg.sender` on callbacks.*
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
```solidity
|
|
42
|
+
function query(uint32 _destination, address _to, bytes memory _data, bytes memory _callback)
|
|
43
|
+
public
|
|
44
|
+
returns (bytes32 messageId);
|
|
45
|
+
```
|
|
46
|
+
**Parameters**
|
|
47
|
+
|
|
48
|
+
|Name|Type|Description|
|
|
49
|
+
|----|----|-----------|
|
|
50
|
+
|`_destination`|`uint32`|The domain of the chain to query.|
|
|
51
|
+
|`_to`|`address`|The address of the contract to query|
|
|
52
|
+
|`_data`|`bytes`|The calldata encoding the query|
|
|
53
|
+
|`_callback`|`bytes`|The calldata of the callback that will be made on the sender. The return value of the query will be appended.|
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### query
|
|
57
|
+
|
|
58
|
+
Dispatches a sequence of static calls (query) to the destination domain and set of callbacks to resolve the results on the dispatcher.
|
|
59
|
+
|
|
60
|
+
*Recommend using CallLib.build to format the interchain calls.*
|
|
61
|
+
|
|
62
|
+
*Callbacks must be returned to the `msg.sender` for security reasons. Require this contract is the `msg.sender` on callbacks.*
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
```solidity
|
|
66
|
+
function query(uint32 _destination, CallLib.StaticCallWithCallback[] calldata calls)
|
|
67
|
+
public
|
|
68
|
+
returns (bytes32 messageId);
|
|
69
|
+
```
|
|
70
|
+
**Parameters**
|
|
71
|
+
|
|
72
|
+
|Name|Type|Description|
|
|
73
|
+
|----|----|-----------|
|
|
74
|
+
|`_destination`|`uint32`|The domain of the chain to query.|
|
|
75
|
+
|`calls`|`CallLib.StaticCallWithCallback[]`|The sequence of static calls to dispatch and callbacks on the sender to resolve the results.|
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### _handle
|
|
79
|
+
|
|
80
|
+
Handles a message from remote enrolled Interchain Query Router.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
```solidity
|
|
84
|
+
function _handle(uint32 _origin, bytes32, bytes calldata _message) internal override;
|
|
85
|
+
```
|
|
86
|
+
**Parameters**
|
|
87
|
+
|
|
88
|
+
|Name|Type|Description|
|
|
89
|
+
|----|----|-----------|
|
|
90
|
+
|`_origin`|`uint32`|The domain of the chain that sent the message.|
|
|
91
|
+
|`<none>`|`bytes32`||
|
|
92
|
+
|`_message`|`bytes`|The ABI-encoded interchain query.|
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## Events
|
|
96
|
+
### QueryDispatched
|
|
97
|
+
Emitted when a query is dispatched to another chain.
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
```solidity
|
|
101
|
+
event QueryDispatched(uint32 indexed destination, address indexed sender);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### QueryExecuted
|
|
105
|
+
Emitted when a query is executed on the and callback dispatched to the origin chain.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
```solidity
|
|
109
|
+
event QueryExecuted(uint32 indexed originDomain, bytes32 indexed sender);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### QueryResolved
|
|
113
|
+
Emitted when a query is resolved on the origin chain.
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
```solidity
|
|
117
|
+
event QueryResolved(uint32 indexed destination, address indexed sender);
|
|
118
|
+
```
|
|
119
|
+
|