Skip to content

Commit

Permalink
fix: transfer refund fee to treasury if fee is greater than zero
Browse files Browse the repository at this point in the history
  • Loading branch information
OnahProsperity committed Sep 12, 2024
1 parent 36efcdb commit 9655145
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contracts/Gateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ contract Gateway is IGateway, GatewaySettingManager, PausableUpgradeable {
require(!order[_orderId].isRefunded, 'OrderRefunded');
require(order[_orderId].protocolFee >= _fee, 'FeeExceedsProtocolFee');

// transfer refund fee to the treasury
IERC20(order[_orderId].token).transfer(treasuryAddress, _fee);
if (_fee > 0) {
// transfer refund fee to the treasury
IERC20(order[_orderId].token).transfer(treasuryAddress, _fee);
}

// reset state values
order[_orderId].isRefunded = true;
Expand Down

0 comments on commit 9655145

Please sign in to comment.