Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 65b4ec6

Browse files
committed
Interface changes
1 parent 9e28250 commit 65b4ec6

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

ethereum/contracts/interfaces/IWormholeRelayer.sol

+19-15
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface IWormholeRelayer {
2828
* 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
2929
* @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.
3030
* 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
3232
*
3333
* This function must be called with a payment of at least maxTransactionFee + receiverValue + one wormhole message fee.
3434
*
@@ -41,7 +41,7 @@ interface IWormholeRelayer {
4141
bytes32 refundAddress,
4242
uint256 maxTransactionFee,
4343
uint256 receiverValue,
44-
uint32 nonce
44+
MessageInfo[] memory messages
4545
) external payable returns (uint64 sequence);
4646

4747
/**
@@ -76,7 +76,7 @@ interface IWormholeRelayer {
7676
*
7777
*
7878
* @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
8080
* @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.
8181
* If request.maxTransactionFee >= quoteGas(request.targetChain, gasLimit, relayProvider),
8282
* 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 {
8888
* @return sequence The sequence number for the emitted wormhole message, which contains encoded delivery instructions meant for your specified relay provider.
8989
* The relay provider will listen for these messages, and then execute the delivery as described.
9090
*/
91-
function send(Send memory request, uint32 nonce, address relayProvider)
91+
function send(Send memory request, MessageInfo[] memory messages, address relayProvider)
9292
external
9393
payable
9494
returns (uint64 sequence);
@@ -123,8 +123,7 @@ interface IWormholeRelayer {
123123
* 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
124124
* @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.
125125
* 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
128127
* 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.
129128
*/
130129
function forward(
@@ -133,7 +132,7 @@ interface IWormholeRelayer {
133132
bytes32 refundAddress,
134133
uint256 maxTransactionFee,
135134
uint256 receiverValue,
136-
uint32 nonce
135+
MessageInfo[] memory messages
137136
) external payable;
138137

139138
/**
@@ -159,7 +158,7 @@ interface IWormholeRelayer {
159158
* @param request The Send request containing info about the targetChain, targetAddress, refundAddress, maxTransactionFee, receiverValue, and relayParameters
160159
* (specifically, the send info that will be used to deliver all of the wormhole messages emitted during the execution of oldTargetAddress's receiveWormholeMessages)
161160
* 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
163162
* @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.
164163
* If request.maxTransactionFee >= quoteGas(request.targetChain, gasLimit, relayProvider),
165164
* 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 {
168167
*
169168
* This function must be called with a payment of at least request.maxTransactionFee + request.receiverValue + one wormhole message fee.
170169
*/
171-
function forward(Send memory request, uint32 nonce, address relayProvider) external payable;
170+
function forward(Send memory request, MessageInfo[] memory messages, address relayProvider) external payable;
172171

173172
/**
174173
* @notice This 'MultichainSend' struct represents a collection of send requests 'requests' and a specified relay provider 'relayProviderAddress'
@@ -181,6 +180,7 @@ interface IWormholeRelayer {
181180
*/
182181
struct MultichainSend {
183182
address relayProviderAddress;
183+
IWormholeRelayer.MessageInfo[] messages;
184184
Send[] requests;
185185
}
186186

@@ -189,14 +189,13 @@ interface IWormholeRelayer {
189189
* with each destination specified in a Send struct, describing the desired targetAddress, targetChain, maxTransactionFee, receiverValue, refundAddress, and relayParameters
190190
*
191191
* @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'
193192
*
194193
* 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].
195194
*
196195
* @return sequence The sequence number for the emitted wormhole message, which contains encoded delivery instructions meant for the default wormhole relay provider.
197196
* The relay provider will listen for these messages, and then execute the delivery as described
198197
*/
199-
function multichainSend(MultichainSend memory sendContainer, uint32 nonce)
198+
function multichainSend(MultichainSend memory sendContainer)
200199
external
201200
payable
202201
returns (uint64 sequence);
@@ -214,10 +213,9 @@ interface IWormholeRelayer {
214213
* 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'
215214
*
216215
* @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'
218216
*
219217
*/
220-
function multichainForward(MultichainSend memory requests, uint32 nonce) external payable;
218+
function multichainForward(MultichainSend memory requests) external payable;
221219

222220
/**
223221
* @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 {
228226
* @custom:member sourceChain The chain (that the original Send was initiated from (or equivalent, the chain that the original wormhole messages were emitted from).
229227
* Important note: This does not need to be the current chain. A resend can be requested from any chain.
230228
* @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
232230
* @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
233231
* @custom:member deliveryIndex If all the originally emitted wormhole messages are ordered, *including* the wormhole message emitted from the original Send request,
234232
* 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 {
246244
struct ResendByTx {
247245
uint16 sourceChain;
248246
bytes32 sourceTxHash;
249-
uint32 sourceNonce;
247+
uint64 sourceSequence;
250248
uint16 targetChain;
251249
uint8 deliveryIndex;
252250
uint8 multisendIndex;
@@ -354,6 +352,12 @@ interface IWormholeRelayer {
354352
*/
355353
function getDefaultRelayParams() external pure returns (bytes memory relayParams);
356354

355+
struct MessageInfo {
356+
bytes32 emitterAddress;
357+
uint64 sequence;
358+
bytes32 vaaHash;
359+
}
360+
357361
error FundsTooMuch(uint8 multisendIndex); // (maxTransactionFee, converted to target chain currency) + (receiverValue, converted to target chain currency) is greater than what your chosen relay provider allows
358362
error MaxTransactionFeeNotEnough(uint8 multisendIndex); // maxTransactionFee is less than the minimum needed by your chosen relay provider
359363
error MsgValueTooLow(); // msg.value is too low

0 commit comments

Comments
 (0)