@@ -256,11 +256,10 @@ contract Manager is
256
256
// call into endpoint contracts to send the message
257
257
for (uint256 i = 0 ; i < numEnabledEndpoints; i++ ) {
258
258
address endpointAddr = enabledEndpoints[i];
259
- uint8 registeredEndpointIndex = endpointInfos[endpointAddr].index;
260
259
// send it to the recipient manager based on the chain
261
260
IEndpoint (endpointAddr).sendMessage {value: priceQuotes[i]}(
262
261
recipientChain,
263
- endpointInstructions[registeredEndpointIndex ],
262
+ endpointInstructions[endpointInfos[endpointAddr].index ],
264
263
managerMessage,
265
264
getSibling (recipientChain)
266
265
);
@@ -536,16 +535,17 @@ contract Manager is
536
535
}
537
536
}
538
537
538
+ // push it on the stack again to avoid a stack too deep error
539
+ uint64 seq = sequence;
540
+
541
+ EndpointStructs.NativeTokenTransfer memory ntt = EndpointStructs.NativeTokenTransfer (
542
+ amount, toWormholeFormat (token), recipient, recipientChain
543
+ );
544
+
539
545
// construct the ManagerMessage payload
540
546
bytes memory encodedManagerPayload = EndpointStructs.encodeManagerMessage (
541
547
EndpointStructs.ManagerMessage (
542
- sequence,
543
- toWormholeFormat (sender),
544
- EndpointStructs.encodeNativeTokenTransfer (
545
- EndpointStructs.NativeTokenTransfer (
546
- amount, toWormholeFormat (token), recipient, recipientChain
547
- )
548
- )
548
+ seq, toWormholeFormat (sender), EndpointStructs.encodeNativeTokenTransfer (ntt)
549
549
)
550
550
);
551
551
@@ -554,7 +554,7 @@ contract Manager is
554
554
recipientChain, priceQuotes, instructions, enabledEndpoints, encodedManagerPayload
555
555
);
556
556
557
- emit TransferSent (recipient, _nttDenormalize (amount), recipientChain, sequence );
557
+ emit TransferSent (recipient, _nttDenormalize (amount), recipientChain, seq );
558
558
559
559
// return the sequence number
560
560
return sequence;
0 commit comments