You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 23, 2023. It is now read-only.
Copy file name to clipboardexpand all lines: ethereum/contracts/interfaces/IWormholeRelayer.sol
+19-15
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ interface IWormholeRelayer {
28
28
* If maxTransactionFee >= quoteGas(targetChain, gasLimit, getDefaultRelayProvider()), then as long as 'targetAddress''s receiveWormholeMessage function uses at most 'gasLimit' units of gas (and doesn't revert), the delivery will succeed
29
29
* @param receiverValue The amount (denominated in source chain currency) that will be converted to target chain currency and passed into the receiveWormholeMessage endpoint as value.
30
30
* If receiverValue >= quoteReceiverValue(targetChain, targetAmount, getDefaultRelayProvider()), then at least 'targetAmount' of targetChain currency will be passed into the 'receiveWormholeFunction' as value.
31
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'.
31
+
* @param messages The messages to be relayed are described here
32
32
*
33
33
* This function must be called with a payment of at least maxTransactionFee + receiverValue + one wormhole message fee.
34
34
*
@@ -41,7 +41,7 @@ interface IWormholeRelayer {
41
41
bytes32refundAddress,
42
42
uint256maxTransactionFee,
43
43
uint256receiverValue,
44
-
uint32nonce
44
+
MessageInfo[] memorymessages
45
45
) externalpayablereturns (uint64sequence);
46
46
47
47
/**
@@ -76,7 +76,7 @@ interface IWormholeRelayer {
76
76
*
77
77
*
78
78
* @param request The Send request containing info about the targetChain, targetAddress, refundAddress, maxTransactionFee, receiverValue, and relayParameters
79
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'.
79
+
* @param messages The messages to be relayed are described here
80
80
* @param relayProvider The address of (the relay provider you wish to deliver the messages)'s contract on this source chain. This must be a contract that implements IRelayProvider.
81
81
* If request.maxTransactionFee >= quoteGas(request.targetChain, gasLimit, relayProvider),
82
82
* then as long as 'request.targetAddress''s receiveWormholeMessage function uses at most 'gasLimit' units of gas (and doesn't revert), the delivery will succeed
@@ -88,7 +88,7 @@ interface IWormholeRelayer {
88
88
* @return sequence The sequence number for the emitted wormhole message, which contains encoded delivery instructions meant for your specified relay provider.
89
89
* The relay provider will listen for these messages, and then execute the delivery as described.
90
90
*/
91
-
function send(Send memoryrequest, uint32nonce, addressrelayProvider)
91
+
function send(Send memoryrequest, MessageInfo[] memorymessages, addressrelayProvider)
92
92
external
93
93
payable
94
94
returns (uint64sequence);
@@ -123,8 +123,7 @@ interface IWormholeRelayer {
123
123
* If maxTransactionFee >= quoteGas(targetChain, gasLimit, getDefaultRelayProvider()), then as long as 'targetAddress''s receiveWormholeMessage function uses at most 'gasLimit' units of gas (and doesn't revert), the delivery will succeed
124
124
* @param receiverValue The amount (denominated in source chain currency) that will be converted to target chain currency and passed into the receiveWormholeMessage endpoint as value.
125
125
* If receiverValue >= quoteReceiverValue(targetChain, targetAmount, getDefaultRelayProvider()), then at least 'targetAmount' of targetChain currency will be passed into the 'receiveWormholeFunction' as value.
126
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'.
127
-
*
126
+
* @param messages The messages to be relayed are described here
128
127
* This forward will succeed if (leftover funds from the current delivery that would have been refunded) + (any extra msg.value passed into forward) is at least maxTransactionFee + receiverValue + one wormhole message fee.
129
128
*/
130
129
function forward(
@@ -133,7 +132,7 @@ interface IWormholeRelayer {
133
132
bytes32refundAddress,
134
133
uint256maxTransactionFee,
135
134
uint256receiverValue,
136
-
uint32nonce
135
+
MessageInfo[] memorymessages
137
136
) externalpayable;
138
137
139
138
/**
@@ -159,7 +158,7 @@ interface IWormholeRelayer {
159
158
* @param request The Send request containing info about the targetChain, targetAddress, refundAddress, maxTransactionFee, receiverValue, and relayParameters
160
159
* (specifically, the send info that will be used to deliver all of the wormhole messages emitted during the execution of oldTargetAddress's receiveWormholeMessages)
161
160
* This forward will succeed if (leftover funds from the current delivery that would have been refunded) + (any extra msg.value passed into forward) is at least maxTransactionFee + receiverValue + one wormhole message fee.
162
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction (during execution of oldTargetAddress's receiveWormholeMessages) that have nonce 'nonce'.
161
+
* @param messages The messages to be relayed are described here
163
162
* @param relayProvider The address of (the relay provider you wish to deliver the messages)'s contract on this source chain. This must be a contract that implements IRelayProvider.
164
163
* If request.maxTransactionFee >= quoteGas(request.targetChain, gasLimit, relayProvider),
165
164
* then as long as 'request.targetAddress''s receiveWormholeMessage function uses at most 'gasLimit' units of gas (and doesn't revert), the delivery will succeed
@@ -168,7 +167,7 @@ interface IWormholeRelayer {
168
167
*
169
168
* This function must be called with a payment of at least request.maxTransactionFee + request.receiverValue + one wormhole message fee.
170
169
*/
171
-
function forward(Send memoryrequest, uint32nonce, addressrelayProvider) externalpayable;
170
+
function forward(Send memoryrequest, MessageInfo[] memorymessages, addressrelayProvider) externalpayable;
172
171
173
172
/**
174
173
* @notice This 'MultichainSend' struct represents a collection of send requests 'requests' and a specified relay provider 'relayProviderAddress'
* with each destination specified in a Send struct, describing the desired targetAddress, targetChain, maxTransactionFee, receiverValue, refundAddress, and relayParameters
190
190
*
191
191
* @param sendContainer The MultichainSend struct, containing the array of Send requests, as well as the desired relayProviderAddress
192
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'
193
192
*
194
193
* This function must be called with a payment of at least (one wormhole message fee) + Sum_(i=0 -> sendContainer.requests.length - 1) [sendContainer.requests[i].maxTransactionFee + sendContainer.requests[i].receiverValue].
195
194
*
196
195
* @return sequence The sequence number for the emitted wormhole message, which contains encoded delivery instructions meant for the default wormhole relay provider.
197
196
* The relay provider will listen for these messages, and then execute the delivery as described
198
197
*/
199
-
function multichainSend(MultichainSend memorysendContainer, uint32nonce)
198
+
function multichainSend(MultichainSend memorysendContainer)
200
199
external
201
200
payable
202
201
returns (uint64sequence);
@@ -214,10 +213,9 @@ interface IWormholeRelayer {
214
213
* note: If LEFTOVER_VALUE > NEEDED_VALUE, then the maxTransactionFee of the first request in the array of sends will be incremented by 'LEFTOVER_VALUE - NEEDED_VALUE'
215
214
*
216
215
* @param requests The MultichainSend struct, containing the array of Send requests, as well as the desired relayProviderAddress
217
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'
218
216
*
219
217
*/
220
-
function multichainForward(MultichainSend memoryrequests, uint32nonce) externalpayable;
218
+
function multichainForward(MultichainSend memoryrequests) externalpayable;
221
219
222
220
/**
223
221
* @notice This 'ResendByTx' struct represents a request to resend an array of messages that have been previously requested to be sent
@@ -228,7 +226,7 @@ interface IWormholeRelayer {
228
226
* @custom:member sourceChain The chain (that the original Send was initiated from (or equivalent, the chain that the original wormhole messages were emitted from).
229
227
* Important note: This does not need to be the current chain. A resend can be requested from any chain.
230
228
* @custom:member sourceTxHash The transaction hash of the original source chain transaction that contained the original wormhole messages and the original 'Send' request
231
-
* @custom:member sourceNonce The nonce of the original wormhole messages and original 'Send' request
229
+
* @custom:member sourceSequence The wormhole sequence number for the original delivery VAA
232
230
* @custom:member targetChain The chain that the encoded+signed Wormhole messages (VAAs) were originally delivered to (and will be redelivered to), in Wormhole Chain ID format
233
231
* @custom:member deliveryIndex If all the originally emitted wormhole messages are ordered, *including* the wormhole message emitted from the original Send request,
234
232
* this is the (0-indexed) index of the wormhole message emitted from the original Send request. So, if originally the 'send' request was made after the publishing of x wormhole messages,
@@ -246,7 +244,7 @@ interface IWormholeRelayer {
246
244
struct ResendByTx {
247
245
uint16 sourceChain;
248
246
bytes32 sourceTxHash;
249
-
uint32 sourceNonce;
247
+
uint64 sourceSequence;
250
248
uint16 targetChain;
251
249
uint8 deliveryIndex;
252
250
uint8 multisendIndex;
@@ -354,6 +352,12 @@ interface IWormholeRelayer {
354
352
*/
355
353
function getDefaultRelayParams() externalpurereturns (bytesmemoryrelayParams);
356
354
355
+
struct MessageInfo {
356
+
bytes32 emitterAddress;
357
+
uint64 sequence;
358
+
bytes32 vaaHash;
359
+
}
360
+
357
361
error FundsTooMuch(uint8multisendIndex); // (maxTransactionFee, converted to target chain currency) + (receiverValue, converted to target chain currency) is greater than what your chosen relay provider allows
358
362
error MaxTransactionFeeNotEnough(uint8multisendIndex); // maxTransactionFee is less than the minimum needed by your chosen relay provider
0 commit comments