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/coreRelayer/CoreRelayer.sol
+33-34
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ contract CoreRelayer is CoreRelayerDelivery {
27
27
* 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
28
28
* @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.
29
29
* If receiverValue >= quoteReceiverValue(targetChain, targetAmount, getDefaultRelayProvider()), then at least 'targetAmount' of targetChain currency will be passed into the 'receiveWormholeFunction' as value.
30
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'.
30
+
* @param messages Array of (emitterAddress, sequence, hash) structs identifying each message to be relayed. For each entry in this array, either the (emitterAddress, sequence) pair must be provided, or the hash must be provided.
31
31
*
32
32
* This function must be called with a payment of at least maxTransactionFee + receiverValue + one wormhole message fee.
33
33
*
@@ -40,13 +40,13 @@ contract CoreRelayer is CoreRelayerDelivery {
@@ -61,7 +61,7 @@ contract CoreRelayer is CoreRelayerDelivery {
61
61
*
62
62
*
63
63
* @param request The Send request containing info about the targetChain, targetAddress, refundAddress, maxTransactionFee, receiverValue, and relayParameters
64
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'.
64
+
* @param messages Array of (emitterAddress, sequence, hash) structs identifying each message to be relayed. For each entry in this array, either the (emitterAddress, sequence) pair must be provided, or the hash must be provided.
65
65
* @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.
66
66
* If request.maxTransactionFee >= quoteGas(request.targetChain, gasLimit, relayProvider),
67
67
* then as long as 'request.targetAddress''s receiveWormholeMessage function uses at most 'gasLimit' units of gas (and doesn't revert), the delivery will succeed
@@ -73,13 +73,13 @@ contract CoreRelayer is CoreRelayerDelivery {
73
73
* @return sequence The sequence number for the emitted wormhole message, which contains encoded delivery instructions meant for your specified relay provider.
74
74
* The relay provider will listen for these messages, and then execute the delivery as described.
75
75
*/
76
-
function send(IWormholeRelayer.Send memoryrequest, uint32nonce, addressrelayProvider)
77
-
public
78
-
payable
79
-
returns (uint64sequence)
80
-
{
76
+
function send(
77
+
IWormholeRelayer.Send memoryrequest,
78
+
IWormholeRelayer.MessageInfo[] memorymessages,
79
+
addressrelayProvider
80
+
) publicpayablereturns (uint64sequence) {
81
81
// call multichainSend with one 'Send' in the requests array
@@ -112,7 +112,7 @@ contract CoreRelayer is CoreRelayerDelivery {
112
112
* 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
113
113
* @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.
114
114
* If receiverValue >= quoteReceiverValue(targetChain, targetAmount, getDefaultRelayProvider()), then at least 'targetAmount' of targetChain currency will be passed into the 'receiveWormholeFunction' as value.
115
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'.
115
+
* @param messages Array of (emitterAddress, sequence, hash) structs identifying each message to be relayed. For each entry in this array, either the (emitterAddress, sequence) pair must be provided, or the hash must be provided.
116
116
*
117
117
* 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.
118
118
*/
@@ -122,13 +122,13 @@ contract CoreRelayer is CoreRelayerDelivery {
@@ -156,7 +156,7 @@ contract CoreRelayer is CoreRelayerDelivery {
156
156
* @param request The Send request containing info about the targetChain, targetAddress, refundAddress, maxTransactionFee, receiverValue, and relayParameters
157
157
* (specifically, the send info that will be used to deliver all of the wormhole messages emitted during the execution of oldTargetAddress's receiveWormholeMessages)
158
158
* 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.
159
-
* @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'.
159
+
* @param messages Array of (emitterAddress, sequence, hash) structs identifying each message to be relayed. For each entry in this array, either the (emitterAddress, sequence) pair must be provided, or the hash must be provided.
160
160
* @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.
161
161
* If request.maxTransactionFee >= quoteGas(request.targetChain, gasLimit, relayProvider),
162
162
* then as long as 'request.targetAddress''s receiveWormholeMessage function uses at most 'gasLimit' units of gas (and doesn't revert), the delivery will succeed
@@ -165,24 +165,27 @@ contract CoreRelayer is CoreRelayerDelivery {
165
165
*
166
166
* This function must be called with a payment of at least request.maxTransactionFee + request.receiverValue + one wormhole message fee.
167
167
*/
168
-
function forward(IWormholeRelayer.Send memoryrequest, uint32nonce, addressrelayProvider) publicpayable {
168
+
function forward(
169
+
IWormholeRelayer.Send memoryrequest,
170
+
IWormholeRelayer.MessageInfo[] memorymessages,
171
+
addressrelayProvider
172
+
) publicpayable {
169
173
// call multichainForward with one 'Send' in the requests array
* @notice The multichainSend function delivers all wormhole messages in the current transaction of nonce 'nonce' to many destinations,
175
179
* with each destination specified in a Send struct, describing the desired targetAddress, targetChain, maxTransactionFee, receiverValue, refundAddress, and relayParameters
176
180
*
177
181
* @param sendContainer The MultichainSend struct, containing the array of Send requests, as well as the desired relayProviderAddress
178
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'
179
182
*
180
183
* 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].
181
184
*
182
185
* @return sequence The sequence number for the emitted wormhole message, which contains encoded delivery instructions meant for the default wormhole relay provider.
183
186
* The relay provider will listen for these messages, and then execute the delivery as described
184
187
*/
185
-
function multichainSend(IWormholeRelayer.MultichainSend memorysendContainer, uint32nonce)
188
+
function multichainSend(IWormholeRelayer.MultichainSend memorysendContainer)
186
189
public
187
190
payable
188
191
returns (uint64sequence)
@@ -193,9 +196,6 @@ contract CoreRelayer is CoreRelayerDelivery {
193
196
if (totalFee >msg.value) {
194
197
revert IWormholeRelayer.MsgValueTooLow();
195
198
}
196
-
if (nonce ==0) {
197
-
revert IWormholeRelayer.NonceIsZero();
198
-
}
199
199
if (sendContainer.requests.length==0) {
200
200
revert IWormholeRelayer.MultichainSendEmpty();
201
201
}
@@ -219,7 +219,7 @@ contract CoreRelayer is CoreRelayerDelivery {
219
219
// Publish a wormhole message indicating to the relay provider (who is watching wormhole messages from this contract)
220
220
// to relay the messages from this transaction (of nonce 'nonce') to the specified chains, each with the calculated amount of gas and receiverValue
@@ -239,19 +239,15 @@ contract CoreRelayer is CoreRelayerDelivery {
239
239
* 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'
240
240
*
241
241
* @param sendContainer The MultichainSend struct, containing the array of Send requests, as well as the desired relayProviderAddress
242
-
* @param nonce The messages to be relayed are all of the emitted wormhole messages in the current transaction that have nonce 'nonce'
243
242
*
244
243
*/
245
-
function multichainForward(IWormholeRelayer.MultichainSend memorysendContainer, uint32nonce) publicpayable {
244
+
function multichainForward(IWormholeRelayer.MultichainSend memorysendContainer) publicpayable {
0 commit comments