Skip to content

Commit 6c9d5b6

Browse files
authored
improve(SpokePool): deposit with message gas optimization (#603)
In most cases, we can avoid having to do the `extcodesize` call that’s inside `isContract()`. This could save [~2600](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a5-balance-extcodesize-extcodehash) gas per call for non ETH bridges to EOAs
1 parent e99b969 commit 6c9d5b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/SpokePool.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ abstract contract SpokePool is
13721372
}
13731373

13741374
bytes memory updatedMessage = relayExecution.updatedMessage;
1375-
if (recipientToSend.isContract() && updatedMessage.length > 0) {
1375+
if (updatedMessage.length > 0 && recipientToSend.isContract()) {
13761376
AcrossMessageHandler(recipientToSend).handleV3AcrossMessage(
13771377
outputToken,
13781378
amountToSend,

0 commit comments

Comments
 (0)