From d1c024cd5f55a38796c350ea7f86f878b2eb5ce8 Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 14 Jun 2023 17:23:39 +0800 Subject: [PATCH] =?UTF-8?q?nft=20market=20=E6=89=8B=E7=BB=AD=E8=B4=B9?= =?UTF-8?q?=E6=9C=80=E4=BD=8E=E8=B0=83=E6=95=B4=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/market/BENftMarket.sol | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/contracts/market/BENftMarket.sol b/contracts/market/BENftMarket.sol index 54d54d7..7e25285 100644 --- a/contracts/market/BENftMarket.sol +++ b/contracts/market/BENftMarket.sol @@ -75,7 +75,7 @@ contract BENFTMarket is Ownable, ReentrancyGuard, ERC1155Holder, ERC721Holder { uint256 constant ROUND = 1000000; uint256 public transactionFee = (3 * ROUND) / 100; // min transaction fee is: 0.5% - uint256 public constant MIN_TRANSACTION_FEE = (5 * ROUND) / 1000; + uint256 public constant MIN_TRANSACTION_FEE = 0; // max transaction fee is: 10% uint256 public constant MAX_TRANSACTION_FEE = (10 * ROUND) / 100; @@ -159,17 +159,20 @@ contract BENFTMarket is Ownable, ReentrancyGuard, ERC1155Holder, ERC721Holder { orderInfo.owner, _amount ); - - IERC20(orderInfo.currency).safeTransferFrom( - msg.sender, - feeToAddress, - _transactionFee - ); - IERC20(orderInfo.currency).safeTransferFrom( - msg.sender, - taxToAddress, - _transactionTax - ); + if (_transactionFee > 0) { + IERC20(orderInfo.currency).safeTransferFrom( + msg.sender, + feeToAddress, + _transactionFee + ); + } + if (_transactionTax > 0) { + IERC20(orderInfo.currency).safeTransferFrom( + msg.sender, + taxToAddress, + _transactionTax + ); + } if (erc721Supported[orderInfo.nftToken]) { IERC721(orderInfo.nftToken).safeTransferFrom(