From 96551459b60300566534471fce19bc20c99132f4 Mon Sep 17 00:00:00 2001 From: onahprosperity Date: Thu, 12 Sep 2024 16:49:05 +0100 Subject: [PATCH] fix: transfer refund fee to treasury if fee is greater than zero --- contracts/Gateway.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/Gateway.sol b/contracts/Gateway.sol index 88ab722..cf0c217 100644 --- a/contracts/Gateway.sol +++ b/contracts/Gateway.sol @@ -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;