Skip to content

Commit 3306b7a

Browse files
authored
EIP-150: Substract buffer from gas left directly (#133)
1 parent 2e3f9c8 commit 3306b7a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/protocol/taiko_alethia/MessageRelayer.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ contract MessageRelayer is ReentrancyGuardTransient, IMessageRelayer {
9696
} else {
9797
// EIP-150: Only 63/64 of gas can be forwarded to external calls.
9898
// Check against actual forwardable gas with buffer for operations before the call.
99-
uint256 maxForwardableGas = (gasleft() * 63 / 64) - BUFFER;
99+
uint256 maxForwardableGas = (gasleft() - BUFFER) * 63 / 64;
100100
require(gasLimit <= maxForwardableGas, InsufficientGas());
101101
(forwardMessageSuccess,) = to.call{value: valueToSend, gas: gasLimit}(data);
102102
}

0 commit comments

Comments
 (0)