Skip to content

Commit bda4124

Browse files
authored
evm: disable via_ir in default build (#187)
1 parent 9c34a84 commit bda4124

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

evm/foundry.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
solc_version = "0.8.19"
33
optimizer = true
44
optimizer_runs = 200
5-
via_ir = true
5+
via_ir = false
66
evm_version = "london"
77
src = "src"
88
out = "out"

evm/src/Manager.sol

+10-10
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,10 @@ contract Manager is
256256
// call into endpoint contracts to send the message
257257
for (uint256 i = 0; i < numEnabledEndpoints; i++) {
258258
address endpointAddr = enabledEndpoints[i];
259-
uint8 registeredEndpointIndex = endpointInfos[endpointAddr].index;
260259
// send it to the recipient manager based on the chain
261260
IEndpoint(endpointAddr).sendMessage{value: priceQuotes[i]}(
262261
recipientChain,
263-
endpointInstructions[registeredEndpointIndex],
262+
endpointInstructions[endpointInfos[endpointAddr].index],
264263
managerMessage,
265264
getSibling(recipientChain)
266265
);
@@ -536,16 +535,17 @@ contract Manager is
536535
}
537536
}
538537

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+
539545
// construct the ManagerMessage payload
540546
bytes memory encodedManagerPayload = EndpointStructs.encodeManagerMessage(
541547
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)
549549
)
550550
);
551551

@@ -554,7 +554,7 @@ contract Manager is
554554
recipientChain, priceQuotes, instructions, enabledEndpoints, encodedManagerPayload
555555
);
556556

557-
emit TransferSent(recipient, _nttDenormalize(amount), recipientChain, sequence);
557+
emit TransferSent(recipient, _nttDenormalize(amount), recipientChain, seq);
558558

559559
// return the sequence number
560560
return sequence;

0 commit comments

Comments
 (0)