Skip to content

Commit

Permalink
fix #166
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed May 21, 2024
1 parent c07308d commit 9b4af25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ORMP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ contract ORMP is ReentrancyGuard, Channel {

/// @dev Dispatch the cross chain message.
function _dispatch(Message memory message, bytes32 msgHash) private returns (bool dispatchResult) {
// where 5000 is the gas required for the operation between the call to gasleft()
uint256 gasAvailable = gasleft() - 5000;
require(gasAvailable - gasAvailable / 64 > message.gasLimit, "!gas");
// Deliver the message to user application contract address.
(dispatchResult,) = message.to.excessivelySafeCall(
message.gasLimit,
Expand Down

0 comments on commit 9b4af25

Please sign in to comment.