diff --git a/CHANGELOG.md b/CHANGELOG.md index 1caec4be2..78ee535ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. * `modifyWhitelist()` function renamed to `modifyKYCData()`. * Added functions to modify and get flags * `canBuyFromSto` is now `canNotBuyFromSto` and it is the flag `1` +* GTM logic reworked. Now, instead of flags like allowAllTransfers, there is a matrix of transfer requirements that must be fulfilled based on type of transfer. ## Generalize * Removed `_polyAddress` parameter from constructors of all modules and module factories. diff --git a/contracts/modules/TransferManager/GTM/GeneralTransferManager.sol b/contracts/modules/TransferManager/GTM/GeneralTransferManager.sol index 155f7034a..af845c67c 100644 --- a/contracts/modules/TransferManager/GTM/GeneralTransferManager.sol +++ b/contracts/modules/TransferManager/GTM/GeneralTransferManager.sol @@ -16,14 +16,7 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, TransferManage // Emit when Issuance address get changed event ChangeIssuanceAddress(address _issuanceAddress); - // Emit when there is change in the flag variable called allowAllTransfers - event AllowAllTransfers(bool _allowAllTransfers); - // Emit when there is change in the flag variable called allowAllWhitelistTransfers - event AllowAllWhitelistTransfers(bool _allowAllWhitelistTransfers); - // Emit when there is change in the flag variable called allowAllWhitelistIssuances - event AllowAllWhitelistIssuances(bool _allowAllWhitelistIssuances); - // Emit when there is change in the flag variable called allowAllBurnTransfers - event AllowAllBurnTransfers(bool _allowAllBurnTransfers); + // Emit when investor details get modified related to their whitelisting event ChangeDefaults(uint64 _defaultFromTime, uint64 _defaultToTime); @@ -46,6 +39,14 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, TransferManage bool _value ); + event ModifyTransferRequirements( + uint256 indexed _transferType, + bool _fromValidKYC, + bool _toValidKYC, + bool _fromRestricted, + bool _toRestricted + ); + /** * @notice Constructor * @param _securityToken Address of the security token @@ -84,50 +85,6 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, TransferManage emit ChangeIssuanceAddress(_issuanceAddress); } - /** - * @notice Used to change the flag - true - It refers there are no transfer restrictions, for any addresses - false - It refers transfers are restricted for all addresses. - * @param _allowAllTransfers flag value - */ - function changeAllowAllTransfers(bool _allowAllTransfers) public withPerm(ADMIN) { - allowAllTransfers = _allowAllTransfers; - emit AllowAllTransfers(_allowAllTransfers); - } - - /** - * @notice Used to change the flag - true - It refers that time lock is ignored for transfers (address must still be on whitelist) - false - It refers transfers are restricted for all addresses. - * @param _allowAllWhitelistTransfers flag value - */ - function changeAllowAllWhitelistTransfers(bool _allowAllWhitelistTransfers) public withPerm(ADMIN) { - allowAllWhitelistTransfers = _allowAllWhitelistTransfers; - emit AllowAllWhitelistTransfers(_allowAllWhitelistTransfers); - } - - /** - * @notice Used to change the flag - true - It refers that time lock is ignored for issuances (address must still be on whitelist) - false - It refers transfers are restricted for all addresses. - * @param _allowAllWhitelistIssuances flag value - */ - function changeAllowAllWhitelistIssuances(bool _allowAllWhitelistIssuances) public withPerm(ADMIN) { - allowAllWhitelistIssuances = _allowAllWhitelistIssuances; - emit AllowAllWhitelistIssuances(_allowAllWhitelistIssuances); - } - - /** - * @notice Used to change the flag - true - It allow to burn the tokens - false - It deactivate the burning mechanism. - * @param _allowAllBurnTransfers flag value - */ - function changeAllowAllBurnTransfers(bool _allowAllBurnTransfers) public withPerm(ADMIN) { - allowAllBurnTransfers = _allowAllBurnTransfers; - emit AllowAllBurnTransfers(_allowAllBurnTransfers); - } - /** * @notice Default implementation of verifyTransfer used by SecurityToken * If the transfer request comes from the STO, it only checks that the investor is in the whitelist @@ -150,67 +107,134 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, TransferManage /** * @notice Default implementation of verifyTransfer used by SecurityToken - * If the transfer request comes from the STO, it only checks that the investor is in the whitelist - * If the transfer request comes from a token holder, it checks that: - * a) Both are on the whitelist - * b) Seller's sale lockup period is over - * c) Buyer's purchase lockup is over * @param _from Address of the sender * @param _to Address of the receiver */ function verifyTransfer( address _from, address _to, - uint256, /*_amount*/ + uint256 /*_amount*/, bytes memory /* _data */ ) public view returns(Result, bytes32) { - Result success; if (!paused) { + TransferRequirements memory txReq; uint64 fromTime; uint64 fromExpiry; uint64 toExpiry; uint64 toTime; - if (allowAllTransfers) { - //All transfers allowed, regardless of whitelist - return (Result.VALID, getAddressBytes32()); - } - if (allowAllBurnTransfers && (_to == address(0))) { - return (Result.VALID, getAddressBytes32()); + + if (_from == issuanceAddress) { + txReq = transferRequirements[1]; //Issuance + } else if (_to == address(0)) { + txReq = transferRequirements[2]; //Redemption + } else { + txReq = transferRequirements[0]; //General Transfer } (fromTime, fromExpiry, toTime, toExpiry) = _getValuesForTransfer(_from, _to); - if (allowAllWhitelistTransfers) { - //Anyone on the whitelist can transfer, regardless of time - success = (_validExpiry(toExpiry) && _validExpiry(fromExpiry)) ? Result.VALID : Result.NA; - return (success, success == Result.VALID ? getAddressBytes32() : bytes32(0)); + if ((txReq.fromValidKYC && !_validExpiry(fromExpiry)) || (txReq.toValidKYC && !_validExpiry(toExpiry))) { + return (Result.NA, bytes32(0)); } - // Using the local variables to avoid the stack too deep error + (fromTime, toTime) = _adjustTimes(fromTime, toTime); - if (_from == issuanceAddress) { - // if allowAllWhitelistIssuances is true, so time stamp ignored - if (allowAllWhitelistIssuances) { - success = _validExpiry(toExpiry) ? Result.VALID : Result.NA; - return (success, success == Result.VALID ? getAddressBytes32() : bytes32(0)); - } else { - success = (_validExpiry(toExpiry) && _validLockTime(toTime)) ? Result.VALID : Result.NA; - return (success, success == Result.VALID ? getAddressBytes32() : bytes32(0)); - } + + if ((txReq.fromRestricted && !_validLockTime(fromTime)) || (txReq.toRestricted && !_validLockTime(toTime))) { + return (Result.NA, bytes32(0)); } - //Anyone on the whitelist can transfer provided the blocknumber is large enough - /*solium-disable-next-line security/no-block-members*/ - success = (_validExpiry(fromExpiry) && _validLockTime(fromTime) && _validExpiry(toExpiry) && - _validLockTime(toTime)) ? Result.VALID : Result.NA; /*solium-disable-line security/no-block-members*/ - return (success, success == Result.VALID ? getAddressBytes32() : bytes32(0)); + return (Result.VALID, getAddressBytes32()); } return (Result.NA, bytes32(0)); } + /** + * @notice Modifies the successful checks required for a transfer to be deemed valid. + * @param _transferType Type of transfer (0 = General, 1 = Issuance, 2 = Redemption) + * @param _fromValidKYC Defines if KYC is required for the sender + * @param _toValidKYC Defines if KYC is required for the receiver + * @param _fromRestricted Defines if transfer time restriction is checked for the sender + * @param _toRestricted Defines if transfer time restriction is checked for the receiver + */ + function modifyTransferRequirements( + uint256 _transferType, + bool _fromValidKYC, + bool _toValidKYC, + bool _fromRestricted, + bool _toRestricted + ) public withPerm(ADMIN) { + _modifyTransferRequirements( + _transferType, + _fromValidKYC, + _toValidKYC, + _fromRestricted, + _toRestricted + ); + } + + /** + * @notice Modifies the successful checks required for transfers. + * @param _transferTypes Types of transfer (0 = General, 1 = Issuance, 2 = Redemption) + * @param _fromValidKYC Defines if KYC is required for the sender + * @param _toValidKYC Defines if KYC is required for the receiver + * @param _fromRestricted Defines if transfer time restriction is checked for the sender + * @param _toRestricted Defines if transfer time restriction is checked for the receiver + */ + function modifyTransferRequirementsMulti( + uint256[] memory _transferTypes, + bool[] memory _fromValidKYC, + bool[] memory _toValidKYC, + bool[] memory _fromRestricted, + bool[] memory _toRestricted + ) public withPerm(ADMIN) { + require( + _transferTypes.length == _fromValidKYC.length && + _fromValidKYC.length == _toValidKYC.length && + _toValidKYC.length == _fromRestricted.length && + _fromRestricted.length == _toRestricted.length, + "Mismatched input lengths" + ); + + for (uint256 i = 0; i < _transferTypes.length; i++) { + _modifyTransferRequirements( + _transferTypes[i], + _fromValidKYC[i], + _toValidKYC[i], + _fromRestricted[i], + _toRestricted[i] + ); + } + } + + function _modifyTransferRequirements( + uint256 _transferType, + bool _fromValidKYC, + bool _toValidKYC, + bool _fromRestricted, + bool _toRestricted + ) internal { + require(_transferType < 3, "Invalid TransferType"); + transferRequirements[_transferType] = + TransferRequirements( + _fromValidKYC, + _toValidKYC, + _fromRestricted, + _toRestricted + ); + + emit ModifyTransferRequirements( + _transferType, + _fromValidKYC, + _toValidKYC, + _fromRestricted, + _toRestricted + ); + } + /** * @notice Add or remove KYC info of an investor. @@ -380,31 +404,31 @@ contract GeneralTransferManager is GeneralTransferManagerStorage, TransferManage * @notice Internal function used to check whether the KYC of investor is valid * @param _expiryTime Expiry time of the investor */ - function _validExpiry(uint64 _expiryTime) internal view returns(bool) { - return (_expiryTime >= uint64(now)); /*solium-disable-line security/no-block-members*/ + function _validExpiry(uint64 _expiryTime) internal view returns(bool valid) { + if (_expiryTime >= uint64(now)) /*solium-disable-line security/no-block-members*/ + valid = true; } /** * @notice Internal function used to check whether the lock time of investor is valid * @param _lockTime Lock time of the investor */ - function _validLockTime(uint64 _lockTime) internal view returns(bool) { - return (_lockTime <= uint64(now)); /*solium-disable-line security/no-block-members*/ + function _validLockTime(uint64 _lockTime) internal view returns(bool valid) { + if (_lockTime <= uint64(now)) /*solium-disable-line security/no-block-members*/ + valid = true; } /** * @notice Internal function to adjust times using default values */ function _adjustTimes(uint64 _fromTime, uint64 _toTime) internal view returns(uint64, uint64) { - uint64 adjustedFromTime = _fromTime; - uint64 adjustedToTime = _toTime; if (_fromTime == 0) { - adjustedFromTime = defaults.fromTime; + _fromTime = defaults.fromTime; } if (_toTime == 0) { - adjustedToTime = defaults.toTime; + _toTime = defaults.toTime; } - return (adjustedFromTime, adjustedToTime); + return (_fromTime, _toTime); } function _getKey(bytes32 _key1, address _key2) internal pure returns(bytes32) { diff --git a/contracts/modules/TransferManager/GTM/GeneralTransferManagerProxy.sol b/contracts/modules/TransferManager/GTM/GeneralTransferManagerProxy.sol index 5d7674acf..417c63766 100644 --- a/contracts/modules/TransferManager/GTM/GeneralTransferManagerProxy.sol +++ b/contracts/modules/TransferManager/GTM/GeneralTransferManagerProxy.sol @@ -26,6 +26,9 @@ contract GeneralTransferManagerProxy is GeneralTransferManagerStorage, ModuleSto { require(_implementation != address(0), "Implementation address should not be 0x"); _upgradeTo(_version, _implementation); + transferRequirements[0] = TransferRequirements(true, true, true, true); + transferRequirements[1] = TransferRequirements(false, true, false, false); + transferRequirements[2] = TransferRequirements(true, false, false, false); } } diff --git a/contracts/modules/TransferManager/GTM/GeneralTransferManagerStorage.sol b/contracts/modules/TransferManager/GTM/GeneralTransferManagerStorage.sol index f764b5032..26aebfd33 100644 --- a/contracts/modules/TransferManager/GTM/GeneralTransferManagerStorage.sol +++ b/contracts/modules/TransferManager/GTM/GeneralTransferManagerStorage.sol @@ -13,15 +13,6 @@ contract GeneralTransferManagerStorage { //Address from which issuances come address public issuanceAddress; - // //from and to timestamps that an investor can send / receive tokens respectively - // // Now Stored in DataStore - // struct TimeRestriction { - // uint64 fromTime; - // uint64 toTime; - // uint64 expiryTime; - // uint8 added; - // } - // Allows all TimeRestrictions to be offset struct Defaults { uint64 fromTime; @@ -34,13 +25,13 @@ contract GeneralTransferManagerStorage { // Map of used nonces by customer mapping(address => mapping(uint256 => bool)) public nonceMap; - //If true, there are no transfer restrictions, for any addresses - bool public allowAllTransfers = false; - //If true, time lock is ignored for transfers (address must still be on whitelist) - bool public allowAllWhitelistTransfers = false; - //If true, time lock is ignored for issuances (address must still be on whitelist) - bool public allowAllWhitelistIssuances = true; - //If true, time lock is ignored for burn transactions - bool public allowAllBurnTransfers = false; + struct TransferRequirements { + bool fromValidKYC; + bool toValidKYC; + bool fromRestricted; + bool toRestricted; + } + mapping(uint256 => TransferRequirements) public transferRequirements; + // General = 0, Issuance = 1, Redemption = 2 } diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index 4c0f49dad..6a2633026 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -365,6 +365,38 @@ contract("GeneralTransferManager", async (accounts) => { ); I_GeneralPermissionManager = await GeneralPermissionManager.at(tx.logs[2].args._module); }); + + it("should have transfer requirements initialized", async () => { + let transferRestrions = await I_GeneralTransferManager.transferRequirements(0); + assert.equal(transferRestrions[0], true); + assert.equal(transferRestrions[1], true); + assert.equal(transferRestrions[2], true); + assert.equal(transferRestrions[3], true); + transferRestrions = await I_GeneralTransferManager.transferRequirements(1); + assert.equal(transferRestrions[0], false); + assert.equal(transferRestrions[1], true); + assert.equal(transferRestrions[2], false); + assert.equal(transferRestrions[3], false); + transferRestrions = await I_GeneralTransferManager.transferRequirements(2); + assert.equal(transferRestrions[0], true); + assert.equal(transferRestrions[1], false); + assert.equal(transferRestrions[2], false); + assert.equal(transferRestrions[3], false); + }); + + it("should not allow unauthorized people to change transfer requirements", async () => { + await catchRevert( + I_GeneralTransferManager.modifyTransferRequirementsMulti( + [0, 1, 2], + [true, false, true], + [true, true, false], + [false, false, false], + [false, false, false], + { from: account_investor1 } + ) + ); + await catchRevert(I_GeneralTransferManager.modifyTransferRequirements(0, false, false, false, false, { from: account_investor1 })); + }); }); describe("Buy tokens using on-chain whitelist", async () => { @@ -782,13 +814,15 @@ contract("GeneralTransferManager", async (accounts) => { assert.equal(balanceBefore.add(new BN(web3.utils.toWei("4", "ether"))).toString(), balanceAfter.toString(), "Fee is transferred"); }); - it("Should change the white list transfer variable", async () => { - let tx = await I_GeneralTransferManager.changeAllowAllWhitelistIssuances(true, { from: token_owner }); - assert.isTrue(tx.logs[0].args._allowAllWhitelistIssuances); - }); - it("should failed in trasfering the tokens", async () => { - let tx = await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(true, { from: token_owner }); + await I_GeneralTransferManager.modifyTransferRequirementsMulti( + [0, 1, 2], + [true, false, true], + [true, true, false], + [false, false, false], + [false, false, false], + { from: token_owner } + ); await I_GeneralTransferManager.pause({ from: token_owner }); await catchRevert(I_SecurityToken.transfer(account_investor1, new BN(web3.utils.toWei("2", "ether")), { from: account_investor2 })); }); diff --git a/test/o_security_token.js b/test/o_security_token.js index bdfd080f0..2dfd9f705 100644 --- a/test/o_security_token.js +++ b/test/o_security_token.js @@ -211,7 +211,7 @@ contract("SecurityToken", async (accounts) => { let toTime = new BN(currentTime.add(new BN(duration.days(100)))); let expiryTime = new BN(toTime.add(new BN(duration.days(100)))); - let tx = await I_GeneralTransferManager.modifyKYCData(account_affiliate1, currentTime, toTime, expiryTime, { + let tx = await I_GeneralTransferManager.modifyKYCData(account_affiliate1, currentTime, currentTime, expiryTime, { from: token_owner, gas: 6000000 }); @@ -230,7 +230,7 @@ contract("SecurityToken", async (accounts) => { let toTime = new BN(currentTime.add(new BN(duration.days(100)))); let expiryTime = new BN(toTime.add(new BN(duration.days(100)))); - let tx = await I_GeneralTransferManager.modifyKYCData(account_affiliate2, currentTime, toTime, expiryTime, { + let tx = await I_GeneralTransferManager.modifyKYCData(account_affiliate2, currentTime, currentTime, expiryTime, { from: token_owner, gas: 6000000 }); @@ -575,7 +575,7 @@ contract("SecurityToken", async (accounts) => { // Add the Investor in to the whitelist fromTime = await latestTime(); - toTime = fromTime + duration.days(100); + toTime = fromTime; expiryTime = toTime + duration.days(100); let tx = await I_GeneralTransferManager.modifyKYCData(account_investor1, fromTime, toTime, expiryTime, { @@ -628,10 +628,23 @@ contract("SecurityToken", async (accounts) => { }); }); - it("Should activate the bool allowAllTransfer", async () => { + it("Should activate allow All Transfer", async () => { ID_snap = await takeSnapshot(); - let tx = await I_GeneralTransferManager.changeAllowAllTransfers(true, { from: account_delegate }); - assert.isTrue(tx.logs[0].args._allowAllTransfers, "AllowTransfer variable is not successfully updated"); + await I_GeneralTransferManager.modifyTransferRequirementsMulti( + [0, 1, 2], + [false, false, false], + [false, false, false], + [false, false, false], + [false, false, false], + { from: account_delegate } + ); + for (let i = 0; i < 3; i++) { + let transferRestrions = await I_GeneralTransferManager.transferRequirements(i); + assert.equal(transferRestrions[0], false); + assert.equal(transferRestrions[1], false); + assert.equal(transferRestrions[2], false); + assert.equal(transferRestrions[3], false); + } }); it("Should fail to send tokens with the wrong granularity", async () => { @@ -682,15 +695,21 @@ contract("SecurityToken", async (accounts) => { await revertToSnapshot(ID_snap); }); - it("Should bool allowAllTransfer value is false", async () => { - assert.isFalse(await I_GeneralTransferManager.allowAllTransfers.call(), "reverting of snapshot doesn't works properly"); - }); - - it("Should change the bool allowAllWhitelistTransfers to true", async () => { + it("Should activate allow All Whitelist Transfers", async () => { ID_snap = await takeSnapshot(); - let tx = await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(true, { from: account_delegate }); - - assert.isTrue(tx.logs[0].args._allowAllWhitelistTransfers, "allowAllWhitelistTransfers variable is not successfully updated"); + await I_GeneralTransferManager.modifyTransferRequirementsMulti( + [0, 1, 2], + [true, false, true], + [true, true, false], + [false, false, false], + [false, false, false], + { from: account_delegate } + ); + let transferRestrions = await I_GeneralTransferManager.transferRequirements(0); + assert.equal(transferRestrions[0], true); + assert.equal(transferRestrions[1], true); + assert.equal(transferRestrions[2], false); + assert.equal(transferRestrions[3], false); }); it("Should transfer from whitelist investor1 to whitelist investor 2", async () => { @@ -849,9 +868,6 @@ contract("SecurityToken", async (accounts) => { }); it("Should fail in trasfering the tokens from one user to another", async () => { - await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(true, { from: token_owner }); - console.log(await I_SecurityToken.balanceOf(account_investor1)); - await catchRevert(I_SecurityToken.transfer(account_investor1, new BN(web3.utils.toWei("1", "ether")), { from: account_temp })); }); @@ -913,7 +929,14 @@ contract("SecurityToken", async (accounts) => { }); it("Should force burn the tokens - value too high", async () => { - await I_GeneralTransferManager.changeAllowAllBurnTransfers(true, { from: token_owner }); + await I_GeneralTransferManager.modifyTransferRequirementsMulti( + [0, 1, 2], + [true, false, false], + [true, true, false], + [true, false, false], + [true, false, false], + { from: account_delegate } + ); let currentBalance = await I_SecurityToken.balanceOf(account_temp); await catchRevert( I_SecurityToken.controllerRedeem(account_temp, currentBalance + new BN(web3.utils.toWei("500", "ether")), "0x0", "0x0", { @@ -922,7 +945,6 @@ contract("SecurityToken", async (accounts) => { ); }); it("Should force burn the tokens - wrong caller", async () => { - await I_GeneralTransferManager.changeAllowAllBurnTransfers(true, { from: token_owner }); let currentBalance = await I_SecurityToken.balanceOf(account_temp); let investors = await stGetter.getInvestors.call(); for (let i = 0; i < investors.length; i++) { @@ -1022,7 +1044,7 @@ contract("SecurityToken", async (accounts) => { tx = await I_GeneralTransferManager.modifyKYCData( I_MockRedemptionManager.address, currentTime, - currentTime.add(new BN(duration.seconds(2))), + currentTime, currentTime.add(new BN(duration.days(50))), { from: account_delegate, @@ -1033,13 +1055,10 @@ contract("SecurityToken", async (accounts) => { }); it("Should successfully burn tokens", async () => { - await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(false, { from: token_owner }); // Minting some tokens await I_SecurityToken.issue(account_investor1, new BN(web3.utils.toWei("1000")), "0x0", { from: token_owner }); // Provide approval to trnafer the tokens to Module await I_SecurityToken.approve(I_MockRedemptionManager.address, new BN(web3.utils.toWei("500")), { from: account_investor1 }); - // Allow all whitelist transfer - await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(true, { from: token_owner }); // Transfer the tokens to module (Burn) await I_MockRedemptionManager.transferToRedeem(new BN(web3.utils.toWei("500")), { from: account_investor1 }); // Redeem tokens @@ -1063,8 +1082,8 @@ contract("SecurityToken", async (accounts) => { currentTime = new BN(await latestTime()); tx = await I_GeneralTransferManager.modifyKYCData( I_MockRedemptionManager.address, - currentTime, - currentTime.add(new BN(duration.seconds(2))), + 1, + 1, currentTime.add(new BN(duration.days(50))), { from: account_delegate, diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index 3bde79d21..561d12537 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -244,7 +244,14 @@ contract("TrackedRedemption", async (accounts) => { }); it("Redeem some tokens - fail insufficient allowance", async () => { - await I_GeneralTransferManager.changeAllowAllBurnTransfers(true, { from: token_owner }); + await I_GeneralTransferManager.modifyTransferRequirementsMulti( + [0, 1, 2], + [true, false, false], + [true, true, false], + [false, false, false], + [false, false, false], + { from: token_owner } + ); await catchRevert(I_TrackedRedemption.redeemTokens(new BN(web3.utils.toWei("1", "ether")), { from: account_investor1 })); }); diff --git a/test/z_general_permission_manager_fuzzer.js b/test/z_general_permission_manager_fuzzer.js index 3640c613f..11fa1a8b6 100644 --- a/test/z_general_permission_manager_fuzzer.js +++ b/test/z_general_permission_manager_fuzzer.js @@ -286,10 +286,6 @@ contract("GeneralPermissionManager Fuzz", async (accounts) => { from: token_owner }); - let currentAllowAllTransferStats = await I_GeneralTransferManager.allowAllTransfers(); - let currentAllowAllWhitelistTransfersStats = await I_GeneralTransferManager.allowAllWhitelistTransfers(); - let currentAllowAllWhitelistIssuancesStats = await I_GeneralTransferManager.allowAllWhitelistIssuances(); - let currentAllowAllBurnTransfersStats = await I_GeneralTransferManager.allowAllBurnTransfers(); console.log("2"); // let userPerm = await I_GeneralPermissionManager.checkPermission(accounts[j], I_GeneralTransferManager.address, 'FLAGS'); if (randomPerms === "ADMIN") { @@ -297,22 +293,6 @@ contract("GeneralPermissionManager Fuzz", async (accounts) => { await I_GeneralTransferManager.changeIssuanceAddress(accounts[j], { from: accounts[j] }); assert.equal(await I_GeneralTransferManager.issuanceAddress(), accounts[j]); - await I_GeneralTransferManager.changeAllowAllTransfers(!currentAllowAllTransferStats, { from: accounts[j] }); - assert.equal(await I_GeneralTransferManager.allowAllTransfers(), !currentAllowAllTransferStats); - - await I_GeneralTransferManager.changeAllowAllWhitelistTransfers(!currentAllowAllWhitelistTransfersStats, { - from: accounts[j] - }); - assert.equal(await I_GeneralTransferManager.allowAllWhitelistTransfers(), !currentAllowAllWhitelistTransfersStats); - - await I_GeneralTransferManager.changeAllowAllWhitelistIssuances(!currentAllowAllWhitelistIssuancesStats, { - from: accounts[j] - }); - assert.equal(await I_GeneralTransferManager.allowAllWhitelistIssuances(), !currentAllowAllWhitelistIssuancesStats); - - await I_GeneralTransferManager.changeAllowAllBurnTransfers(!currentAllowAllBurnTransfersStats, { from: accounts[j] }); - assert.equal(await I_GeneralTransferManager.allowAllBurnTransfers(), !currentAllowAllBurnTransfersStats); - console.log( "Test number " + i + @@ -324,22 +304,6 @@ contract("GeneralPermissionManager Fuzz", async (accounts) => { ); } else { await catchRevert(I_GeneralTransferManager.changeIssuanceAddress(accounts[j], { from: accounts[j] })); - await catchRevert( - I_GeneralTransferManager.changeAllowAllTransfers(!currentAllowAllTransferStats, { from: accounts[j] }) - ); - await catchRevert( - I_GeneralTransferManager.changeAllowAllWhitelistTransfers(!currentAllowAllWhitelistTransfersStats, { - from: accounts[j] - }) - ); - await catchRevert( - I_GeneralTransferManager.changeAllowAllWhitelistIssuances(!currentAllowAllWhitelistIssuancesStats, { - from: accounts[j] - }) - ); - await catchRevert( - I_GeneralTransferManager.changeAllowAllBurnTransfers(!currentAllowAllBurnTransfersStats, { from: accounts[j] }) - ); console.log( "Test number " + i +