Skip to content

Commit

Permalink
chore: backport gas limit fix (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito authored Sep 30, 2024
1 parent 2547771 commit 822f4f4
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 14 deletions.
2 changes: 2 additions & 0 deletions v2/contracts/zevm/GatewayZEVM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ contract GatewayZEVM is
{
if (receiver.length == 0) revert ZeroAddress();
if (amount == 0) revert InsufficientZRC20Amount();
if (gasLimit == 0) revert InsufficientGasLimit();

uint256 gasFee = _withdrawZRC20WithGasLimit(amount, zrc20, gasLimit);
emit Withdrawn(
Expand Down Expand Up @@ -257,6 +258,7 @@ contract GatewayZEVM is
{
if (receiver.length == 0) revert ZeroAddress();
if (message.length == 0) revert EmptyMessage();
if (gasLimit == 0) revert InsufficientGasLimit();

(address gasZRC20, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(gasLimit);
if (!IZRC20(gasZRC20).transferFrom(msg.sender, FUNGIBLE_MODULE_ADDRESS, gasFee)) {
Expand Down
3 changes: 3 additions & 0 deletions v2/contracts/zevm/interfaces/IGatewayZEVM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ interface IGatewayZEVMErrors {

/// @notice Error indicating call method received empty message as argument.
error EmptyMessage();

/// @notice Error indicating an insufficient gas limit.
error InsufficientGasLimit();
}

/// @title IGatewayZEVM
Expand Down
4 changes: 2 additions & 2 deletions v2/pkg/gatewayevmzevm.t.sol/gatewayevmzevmtest.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions v2/pkg/gatewayzevm.sol/gatewayzevm.go

Large diffs are not rendered by default.

46 changes: 44 additions & 2 deletions v2/pkg/gatewayzevm.t.sol/gatewayzevminboundtest.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions v2/pkg/gatewayzevm.t.sol/gatewayzevmoutboundtest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/igatewayzevm.sol/igatewayzevm.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/igatewayzevm.sol/igatewayzevmerrors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2/pkg/senderzevm.sol/senderzevm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 822f4f4

Please sign in to comment.