Skip to content

Commit

Permalink
Issue 126 (#128)
Browse files Browse the repository at this point in the history
* the commission works without a whitelist

* function renaming

* update payFee function
  • Loading branch information
YouStillAlive authored Dec 14, 2022
1 parent a48fa72 commit bda8a93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
5 changes: 1 addition & 4 deletions contracts/LockedCreation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ contract LockedCreation is LockedPoolz {
}

function payFee(address _token, uint256 _amount) internal {
if (
WhiteList_Address != address(0) &&
!(isUserWithoutFee(msg.sender) || isTokenWithoutFee(_token))
) {
if (isTokenWithFee(_token) && isUserPaysFee(msg.sender)) {
PayFee(_amount);
}
}
Expand Down
1 change: 1 addition & 0 deletions contracts/LockedDealModifiers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ contract LockedDealModifiers {
require(_address != address(0x0), "Zero Address is not allowed");
_;
}

modifier isPoolValid(uint256 _PoolId) {
require(_PoolId < Index, "Pool does not exist");
_;
Expand Down
26 changes: 10 additions & 16 deletions contracts/LockedManageable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,13 @@ contract LockedManageable is
isTokenFilterOn = !isTokenFilterOn;
}

function isTokenWithoutFee(address _tokenAddress)
public
view
notZeroAddress(WhiteList_Address)
returns (bool)
{
function isTokenWithFee(address _tokenAddress) public view returns (bool) {
return
IWhiteList(WhiteList_Address).Check(
WhiteList_Address == address(0) ||
!(IWhiteList(WhiteList_Address).Check(
_tokenAddress,
TokenFeeWhiteListId
) > 0;
) > 0);
}

function isTokenWhiteListed(address _tokenAddress)
Expand All @@ -63,15 +59,13 @@ contract LockedManageable is
0;
}

function isUserWithoutFee(address _UserAddress)
public
view
notZeroAddress(WhiteList_Address)
returns (bool)
{
function isUserPaysFee(address _UserAddress) public view returns (bool) {
return
IWhiteList(WhiteList_Address).Check(_UserAddress, UserWhiteListId) >
0;
WhiteList_Address == address(0) ||
!(IWhiteList(WhiteList_Address).Check(
_UserAddress,
UserWhiteListId
) > 0);
}

function setMaxTransactionLimit(uint256 _newLimit) external onlyOwner {
Expand Down

0 comments on commit bda8a93

Please sign in to comment.