Skip to content

Commit

Permalink
Merge branch 'main' into cleanup-tss-updater-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Sep 30, 2024
2 parents 11cc43e + 1a7773c commit 6d25508
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 12 deletions.
7 changes: 7 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 @@ -214,6 +215,7 @@ contract GatewayZEVM is
{
if (receiver.length == 0) revert ZeroAddress();
if (amount == 0) revert InsufficientZRC20Amount();
if (callOptions.gasLimit == 0) revert InsufficientGasLimit();

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

_transferZETA(amount, PROTOCOL_ADDRESS);
emit Withdrawn(
Expand All @@ -342,6 +345,8 @@ contract GatewayZEVM is
nonReentrant
whenNotPaused
{
if (callOptions.gasLimit == 0) revert InsufficientGasLimit();

_call(receiver, zrc20, message, callOptions, revertOptions);
}

Expand All @@ -362,6 +367,8 @@ contract GatewayZEVM is
nonReentrant
whenNotPaused
{
if (gasLimit == 0) revert InsufficientGasLimit();

_call(receiver, zrc20, message, CallOptions({ gasLimit: gasLimit, isArbitraryCall: true }), revertOptions);
}

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
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,11 @@ Error indicating call method received empty message as argument.
error EmptyMessage();
```

### InsufficientGasLimit
Error indicating an insufficient gas limit.


```solidity
error InsufficientGasLimit();
```

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

Large diffs are not rendered by default.

109 changes: 107 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 6d25508

Please sign in to comment.