From cbf785d4eed5b7572e34cdd0af3288fcc4a3090d Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 12 Jun 2019 13:17:51 +0530 Subject: [PATCH] [3.31] Removed take usage fee (#700) * Removed takeUsageFee * Test fix * tests fixed --- contracts/interfaces/IModule.sol | 5 -- contracts/interfaces/IModuleFactory.sol | 24 ++-------- contracts/mocks/Dummy/DummySTOFactory.sol | 6 +-- contracts/mocks/MockBurnFactory.sol | 4 +- contracts/mocks/MockFactory.sol | 6 +-- contracts/mocks/MockWrongTypeFactory.sol | 4 +- contracts/mocks/TestSTOFactory.sol | 6 +-- .../ERC20/ERC20DividendCheckpointFactory.sol | 6 +-- .../Ether/EtherDividendCheckpointFactory.sol | 6 +-- .../PLCR/PLCRVotingCheckpointFactory.sol | 8 ++-- .../WeightedVoteCheckpointFactory.sol | 6 +-- .../Burn/TrackedRedemptionFactory.sol | 4 +- .../Mixed/ScheduledCheckpointFactory.sol | 6 +-- .../KYCTransferManagerFactory.sol | 3 +- .../SignedTransferManagerFactory.sol | 3 +- contracts/modules/Module.sol | 10 +--- contracts/modules/ModuleFactory.sol | 32 ++----------- .../GeneralPermissionManagerFactory.sol | 6 +-- .../modules/STO/Capped/CappedSTOFactory.sol | 6 +-- .../modules/STO/PreSale/PreSaleSTOFactory.sol | 6 +-- .../STO/USDTiered/USDTieredSTOFactory.sol | 6 +-- .../BTM/BlacklistTransferManagerFactory.sol | 6 +-- .../CTM/CountTransferManagerFactory.sol | 6 +-- .../GTM/GeneralTransferManagerFactory.sol | 6 +-- .../LTM/LockUpTransferManagerFactory.sol | 6 +-- .../ManualApprovalTransferManagerFactory.sol | 6 +-- .../PTM/PercentageTransferManagerFactory.sol | 6 +-- .../VRTM/VolumeRestrictionTMFactory.sol | 6 +-- contracts/modules/UpgradableModuleFactory.sol | 6 +-- .../Wallet/VestingEscrowWalletFactory.sol | 3 +- migrations/2_deploy_contracts.js | 20 ++++---- test/b_capped_sto.js | 3 -- test/d_count_transfer_manager.js | 24 ++-------- test/h_general_transfer_manager.js | 34 +++----------- test/helpers/createInstances.js | 46 +++++++++---------- test/k_module_registry.js | 12 ++--- test/u_module_registry_proxy.js | 4 +- 37 files changed, 107 insertions(+), 250 deletions(-) diff --git a/contracts/interfaces/IModule.sol b/contracts/interfaces/IModule.sol index 3bfc2dcda..3a1716cb0 100644 --- a/contracts/interfaces/IModule.sol +++ b/contracts/interfaces/IModule.sol @@ -14,9 +14,4 @@ interface IModule { */ function getPermissions() external view returns(bytes32[] memory); - /** - * @notice Used to withdraw the fee by the factory owner - */ - function takeUsageFee() external returns(bool); - } diff --git a/contracts/interfaces/IModuleFactory.sol b/contracts/interfaces/IModuleFactory.sol index 040ad8b30..95ec87545 100644 --- a/contracts/interfaces/IModuleFactory.sol +++ b/contracts/interfaces/IModuleFactory.sol @@ -6,7 +6,6 @@ pragma solidity ^0.5.0; interface IModuleFactory { event ChangeSetupCost(uint256 _oldSetupCost, uint256 _newSetupCost); event ChangeCostType(bool _isOldCostInPoly, bool _isNewCostInPoly); - event ChangeUsageCost(uint256 _oldUsageCost, uint256 _newUsageCost); event GenerateModuleFromFactory( address _module, bytes32 indexed _moduleName, @@ -40,11 +39,6 @@ interface IModuleFactory { */ function description() external view returns(string memory); - /** - * @notice Get the setup cost of the module in USD - */ - function usageCost() external returns(uint256); - /** * @notice Get the setup cost of the module in USD */ @@ -67,18 +61,11 @@ interface IModuleFactory { function changeSetupCost(uint256 _newSetupCost) external; /** - * @notice Used to change the usage fee - * @param _newUsageCost New usage fee - */ - function changeUsageCost(uint256 _newUsageCost) external; - - /** - * @notice Used to change the currency and amount of usage and setup cost + * @notice Used to change the currency and amount setup cost * @param _setupCost new setup cost - * @param _usageCost new usage cost - * @param _isCostInPoly new usage cost currency. USD or POLY + * @param _isCostInPoly new setup cost currency. USD or POLY */ - function changeCostsAndType(uint256 _setupCost, uint256 _usageCost, bool _isCostInPoly) external; + function changeCostAndType(uint256 _setupCost, bool _isCostInPoly) external; /** * @notice Function use to change the lower and upper bound of the compatible version st @@ -87,11 +74,6 @@ interface IModuleFactory { */ function changeSTVersionBounds(string calldata _boundType, uint8[] calldata _newVersion) external; - /** - * @notice Get the setup cost of the module in USD - */ - function usageCostInPoly() external returns(uint256); - /** * @notice Get the setup cost of the module */ diff --git a/contracts/mocks/Dummy/DummySTOFactory.sol b/contracts/mocks/Dummy/DummySTOFactory.sol index 235047fbe..2d954197a 100644 --- a/contracts/mocks/Dummy/DummySTOFactory.sol +++ b/contracts/mocks/Dummy/DummySTOFactory.sol @@ -11,20 +11,18 @@ contract DummySTOFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "DummySTO"; title = "Dummy STO"; diff --git a/contracts/mocks/MockBurnFactory.sol b/contracts/mocks/MockBurnFactory.sol index cc86e52e2..5017f55a3 100644 --- a/contracts/mocks/MockBurnFactory.sol +++ b/contracts/mocks/MockBurnFactory.sol @@ -12,17 +12,15 @@ contract MockBurnFactory is TrackedRedemptionFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module * @param _polymathRegistry Address of the Polymath Registry */ constructor( uint256 _setupCost, - uint256 _usageCost, address _polymathRegistry, bool _isFeeInPoly ) public - TrackedRedemptionFactory(_setupCost, _usageCost, _polymathRegistry, _isFeeInPoly) + TrackedRedemptionFactory(_setupCost, _polymathRegistry, _isFeeInPoly) { } diff --git a/contracts/mocks/MockFactory.sol b/contracts/mocks/MockFactory.sol index 3c97c7734..6e79e4e12 100644 --- a/contracts/mocks/MockFactory.sol +++ b/contracts/mocks/MockFactory.sol @@ -12,19 +12,17 @@ contract MockFactory is DummySTOFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath Registry */ constructor( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isFeeInPoly ) public - DummySTOFactory(_setupCost, _usageCost, _logicContract, _polymathRegistry, _isFeeInPoly) + DummySTOFactory(_setupCost, _logicContract, _polymathRegistry, _isFeeInPoly) { } diff --git a/contracts/mocks/MockWrongTypeFactory.sol b/contracts/mocks/MockWrongTypeFactory.sol index 4694e15d7..255e56270 100644 --- a/contracts/mocks/MockWrongTypeFactory.sol +++ b/contracts/mocks/MockWrongTypeFactory.sol @@ -12,17 +12,15 @@ contract MockWrongTypeFactory is MockBurnFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module * @param _polymathRegistry Address of the Polymath Registry */ constructor( uint256 _setupCost, - uint256 _usageCost, address _polymathRegistry, bool _isFeeInPoly ) public - MockBurnFactory(_setupCost, _usageCost, _polymathRegistry, _isFeeInPoly) + MockBurnFactory(_setupCost, _polymathRegistry, _isFeeInPoly) { } diff --git a/contracts/mocks/TestSTOFactory.sol b/contracts/mocks/TestSTOFactory.sol index 0f90bb183..9ce6e79c1 100644 --- a/contracts/mocks/TestSTOFactory.sol +++ b/contracts/mocks/TestSTOFactory.sol @@ -6,19 +6,17 @@ contract TestSTOFactory is DummySTOFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath Registry */ constructor( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isFeeInPoly ) public - DummySTOFactory(_setupCost, _usageCost, _logicContract, _polymathRegistry, _isFeeInPoly) + DummySTOFactory(_setupCost, _logicContract, _polymathRegistry, _isFeeInPoly) { name = "TestSTO"; title = "Test STO"; diff --git a/contracts/modules/Checkpoint/Dividend/ERC20/ERC20DividendCheckpointFactory.sol b/contracts/modules/Checkpoint/Dividend/ERC20/ERC20DividendCheckpointFactory.sol index 9e6d26d34..1f6fe3118 100644 --- a/contracts/modules/Checkpoint/Dividend/ERC20/ERC20DividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/Dividend/ERC20/ERC20DividendCheckpointFactory.sol @@ -11,20 +11,18 @@ contract ERC20DividendCheckpointFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "ERC20DividendCheckpoint"; title = "ERC20 Dividend Checkpoint"; diff --git a/contracts/modules/Checkpoint/Dividend/Ether/EtherDividendCheckpointFactory.sol b/contracts/modules/Checkpoint/Dividend/Ether/EtherDividendCheckpointFactory.sol index 9576ed939..e3be2adc6 100644 --- a/contracts/modules/Checkpoint/Dividend/Ether/EtherDividendCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/Dividend/Ether/EtherDividendCheckpointFactory.sol @@ -11,20 +11,18 @@ contract EtherDividendCheckpointFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "EtherDividendCheckpoint"; title = "Ether Dividend Checkpoint"; diff --git a/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpointFactory.sol b/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpointFactory.sol index 49effca93..4d83a7553 100644 --- a/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpointFactory.sol @@ -11,20 +11,18 @@ contract PLCRVotingCheckpointFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { initialVersion = "3.0.0"; name = "PLCRVotingCheckpoint"; @@ -48,4 +46,4 @@ contract PLCRVotingCheckpointFactory is UpgradableModuleFactory { _initializeModule(plcrVotingCheckpoint, _data); return plcrVotingCheckpoint; } -} \ No newline at end of file +} diff --git a/contracts/modules/Checkpoint/Voting/Transparent/WeightedVoteCheckpointFactory.sol b/contracts/modules/Checkpoint/Voting/Transparent/WeightedVoteCheckpointFactory.sol index 32a6f2d77..3ce14f7e9 100644 --- a/contracts/modules/Checkpoint/Voting/Transparent/WeightedVoteCheckpointFactory.sol +++ b/contracts/modules/Checkpoint/Voting/Transparent/WeightedVoteCheckpointFactory.sol @@ -11,20 +11,18 @@ contract WeightedVoteCheckpointFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { initialVersion = "3.0.0"; name = "WeightedVoteCheckpoint"; diff --git a/contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol b/contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol index db7da70ef..fa27db7c9 100644 --- a/contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol +++ b/contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol @@ -10,17 +10,15 @@ contract TrackedRedemptionFactory is ModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of module - * @param _usageCost Usage cost of module * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor( uint256 _setupCost, - uint256 _usageCost, address _polymathRegistry, bool _isCostInPoly ) - public ModuleFactory(_setupCost, _usageCost, _polymathRegistry, _isCostInPoly) + public ModuleFactory(_setupCost, _polymathRegistry, _isCostInPoly) { initialVersion = "3.0.0"; name = "TrackedRedemption"; diff --git a/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol b/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol index 99ddf7b8e..4c4e1b964 100644 --- a/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol +++ b/contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol @@ -10,17 +10,15 @@ contract ScheduledCheckpointFactory is ModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _polymathRegistry Address of the Polymath registry + * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor( uint256 _setupCost, - uint256 _usageCost, address _polymathRegistry, bool _isCostInPoly ) - public ModuleFactory(_setupCost, _usageCost, _polymathRegistry, _isCostInPoly) + public ModuleFactory(_setupCost, _polymathRegistry, _isCostInPoly) { initialVersion = "3.0.0"; name = "ScheduledCheckpoint"; diff --git a/contracts/modules/Experimental/TransferManager/KYCTransferManagerFactory.sol b/contracts/modules/Experimental/TransferManager/KYCTransferManagerFactory.sol index a0c0912cb..e4ba6fee9 100644 --- a/contracts/modules/Experimental/TransferManager/KYCTransferManagerFactory.sol +++ b/contracts/modules/Experimental/TransferManager/KYCTransferManagerFactory.sol @@ -11,11 +11,10 @@ contract KYCTransferManagerFactory is ModuleFactory { */ constructor( uint256 _setupCost, - uint256 _usageCost, address _polymathRegistry, bool _isCostInPoly ) - public ModuleFactory(_setupCost, _usageCost, _polymathRegistry, _isCostInPoly) + public ModuleFactory(_setupCost, _polymathRegistry, _isCostInPoly) { initialVersion = "3.0.0"; name = "KYCTransferManager"; diff --git a/contracts/modules/Experimental/TransferManager/SignedTransferManagerFactory.sol b/contracts/modules/Experimental/TransferManager/SignedTransferManagerFactory.sol index 74826a9d9..94eb58f31 100644 --- a/contracts/modules/Experimental/TransferManager/SignedTransferManagerFactory.sol +++ b/contracts/modules/Experimental/TransferManager/SignedTransferManagerFactory.sol @@ -13,11 +13,10 @@ contract SignedTransferManagerFactory is ModuleFactory { */ constructor( uint256 _setupCost, - uint256 _usageCost, address _polymathRegistry, bool _isCostInPoly ) - public ModuleFactory(_setupCost, _usageCost, _polymathRegistry, _isCostInPoly) + public ModuleFactory(_setupCost, _polymathRegistry, _isCostInPoly) { initialVersion = "3.0.0"; name = "SignedTransferManager"; diff --git a/contracts/modules/Module.sol b/contracts/modules/Module.sol index b685189ab..39225766f 100644 --- a/contracts/modules/Module.sol +++ b/contracts/modules/Module.sol @@ -61,14 +61,6 @@ contract Module is IModule, ModuleStorage, Pausable { super._unpause(); } - /** - * @notice used to withdraw the fee by the factory owner - */ - function takeUsageFee() public withPerm(ADMIN) returns(bool) { - require(polyToken.transferFrom(securityToken, Ownable(factory).owner(), IModuleFactory(factory).usageCostInPoly()), "Unable to take fee"); - return true; - } - /** * @notice used to return the data store address of securityToken */ @@ -96,5 +88,5 @@ contract Module is IModule, ModuleStorage, Pausable { function reclaimETH() external { _onlySecurityTokenOwner(); msg.sender.transfer(address(this).balance); - } + } } diff --git a/contracts/modules/ModuleFactory.sol b/contracts/modules/ModuleFactory.sol index 208fd9918..2382258fe 100644 --- a/contracts/modules/ModuleFactory.sol +++ b/contracts/modules/ModuleFactory.sol @@ -27,7 +27,6 @@ contract ModuleFactory is IModuleFactory, Ownable { bytes32[] tagsData; bool public isCostInPoly; - uint256 public usageCost; uint256 public setupCost; string constant POLY_ORACLE = "StablePolyUsdOracle"; @@ -42,9 +41,8 @@ contract ModuleFactory is IModuleFactory, Ownable { /** * @notice Constructor */ - constructor(uint256 _setupCost, uint256 _usageCost, address _polymathRegistry, bool _isCostInPoly) public { + constructor(uint256 _setupCost, address _polymathRegistry, bool _isCostInPoly) public { setupCost = _setupCost; - usageCost = _usageCost; polymathRegistry = _polymathRegistry; isCostInPoly = _isCostInPoly; } @@ -80,26 +78,14 @@ contract ModuleFactory is IModuleFactory, Ownable { } /** - * @notice Used to change the fee of the usage cost - * @param _usageCost new usage cost - */ - function changeUsageCost(uint256 _usageCost) public onlyOwner { - emit ChangeUsageCost(usageCost, _usageCost); - usageCost = _usageCost; - } - - /** - * @notice Used to change the currency and amount of usage and setup cost + * @notice Used to change the currency and amount of setup cost * @param _setupCost new setup cost - * @param _usageCost new usage cost - * @param _isCostInPoly new usage cost currency. USD or POLY + * @param _isCostInPoly new setup cost currency. USD or POLY */ - function changeCostsAndType(uint256 _setupCost, uint256 _usageCost, bool _isCostInPoly) public onlyOwner { + function changeCostAndType(uint256 _setupCost, bool _isCostInPoly) public onlyOwner { emit ChangeSetupCost(setupCost, _setupCost); - emit ChangeUsageCost(usageCost, _usageCost); emit ChangeCostType(isCostInPoly, _isCostInPoly); setupCost = _setupCost; - usageCost = _usageCost; isCostInPoly = _isCostInPoly; } @@ -190,16 +176,6 @@ contract ModuleFactory is IModuleFactory, Ownable { return DecimalMath.div(setupCost, polyRate); } - /** - * @notice Get the setup cost of the module - */ - function usageCostInPoly() public returns (uint256) { - if (isCostInPoly) - return usageCost; - uint256 polyRate = IOracle(IPolymathRegistry(polymathRegistry).getAddress(POLY_ORACLE)).getPrice(); - return DecimalMath.div(usageCost, polyRate); - } - /** * @notice Calculates fee in POLY */ diff --git a/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol b/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol index 6a95b2473..8eea6f732 100644 --- a/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol +++ b/contracts/modules/PermissionManager/GeneralPermissionManagerFactory.sol @@ -11,20 +11,18 @@ contract GeneralPermissionManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "GeneralPermissionManager"; title = "General Permission Manager"; diff --git a/contracts/modules/STO/Capped/CappedSTOFactory.sol b/contracts/modules/STO/Capped/CappedSTOFactory.sol index 450fba5df..3048d9379 100644 --- a/contracts/modules/STO/Capped/CappedSTOFactory.sol +++ b/contracts/modules/STO/Capped/CappedSTOFactory.sol @@ -11,20 +11,18 @@ contract CappedSTOFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "CappedSTO"; title = "Capped STO"; diff --git a/contracts/modules/STO/PreSale/PreSaleSTOFactory.sol b/contracts/modules/STO/PreSale/PreSaleSTOFactory.sol index 79bfcee0d..74e2a59de 100644 --- a/contracts/modules/STO/PreSale/PreSaleSTOFactory.sol +++ b/contracts/modules/STO/PreSale/PreSaleSTOFactory.sol @@ -11,20 +11,18 @@ contract PreSaleSTOFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "PreSaleSTO"; title = "PreSale STO"; diff --git a/contracts/modules/STO/USDTiered/USDTieredSTOFactory.sol b/contracts/modules/STO/USDTiered/USDTieredSTOFactory.sol index bb44e8145..7a04301e9 100644 --- a/contracts/modules/STO/USDTiered/USDTieredSTOFactory.sol +++ b/contracts/modules/STO/USDTiered/USDTieredSTOFactory.sol @@ -11,20 +11,18 @@ contract USDTieredSTOFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "USDTieredSTO"; title = "USD Tiered STO"; diff --git a/contracts/modules/TransferManager/BTM/BlacklistTransferManagerFactory.sol b/contracts/modules/TransferManager/BTM/BlacklistTransferManagerFactory.sol index 44e227554..7e6f7a233 100644 --- a/contracts/modules/TransferManager/BTM/BlacklistTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/BTM/BlacklistTransferManagerFactory.sol @@ -11,19 +11,17 @@ contract BlacklistTransferManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) - public UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + public UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "BlacklistTransferManager"; title = "Blacklist Transfer Manager"; diff --git a/contracts/modules/TransferManager/CTM/CountTransferManagerFactory.sol b/contracts/modules/TransferManager/CTM/CountTransferManagerFactory.sol index 397aca56a..b852d1b42 100644 --- a/contracts/modules/TransferManager/CTM/CountTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/CTM/CountTransferManagerFactory.sol @@ -11,20 +11,18 @@ contract CountTransferManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "CountTransferManager"; title = "Count Transfer Manager"; diff --git a/contracts/modules/TransferManager/GTM/GeneralTransferManagerFactory.sol b/contracts/modules/TransferManager/GTM/GeneralTransferManagerFactory.sol index 3d4e15b85..1637f7c7b 100644 --- a/contracts/modules/TransferManager/GTM/GeneralTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/GTM/GeneralTransferManagerFactory.sol @@ -11,20 +11,18 @@ contract GeneralTransferManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "GeneralTransferManager"; title = "General Transfer Manager"; diff --git a/contracts/modules/TransferManager/LTM/LockUpTransferManagerFactory.sol b/contracts/modules/TransferManager/LTM/LockUpTransferManagerFactory.sol index b0ce1b000..6b93e921a 100644 --- a/contracts/modules/TransferManager/LTM/LockUpTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/LTM/LockUpTransferManagerFactory.sol @@ -12,19 +12,17 @@ contract LockUpTransferManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _polymathRegistry Address of the Polymath registry + * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "LockUpTransferManager"; title = "LockUp Transfer Manager"; diff --git a/contracts/modules/TransferManager/MATM/ManualApprovalTransferManagerFactory.sol b/contracts/modules/TransferManager/MATM/ManualApprovalTransferManagerFactory.sol index 0d671a388..dbcfe013b 100644 --- a/contracts/modules/TransferManager/MATM/ManualApprovalTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/MATM/ManualApprovalTransferManagerFactory.sol @@ -11,20 +11,18 @@ contract ManualApprovalTransferManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "ManualApprovalTransferManager"; title = "Manual Approval Transfer Manager"; diff --git a/contracts/modules/TransferManager/PTM/PercentageTransferManagerFactory.sol b/contracts/modules/TransferManager/PTM/PercentageTransferManagerFactory.sol index 4f1ba00cf..d54668a84 100644 --- a/contracts/modules/TransferManager/PTM/PercentageTransferManagerFactory.sol +++ b/contracts/modules/TransferManager/PTM/PercentageTransferManagerFactory.sol @@ -11,20 +11,18 @@ contract PercentageTransferManagerFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "PercentageTransferManager"; title = "Percentage Transfer Manager"; diff --git a/contracts/modules/TransferManager/VRTM/VolumeRestrictionTMFactory.sol b/contracts/modules/TransferManager/VRTM/VolumeRestrictionTMFactory.sol index a9f3c3939..521fc020f 100644 --- a/contracts/modules/TransferManager/VRTM/VolumeRestrictionTMFactory.sol +++ b/contracts/modules/TransferManager/VRTM/VolumeRestrictionTMFactory.sol @@ -11,20 +11,18 @@ contract VolumeRestrictionTMFactory is UpgradableModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "VolumeRestrictionTM"; title = "Volume Restriction Transfer Manager"; diff --git a/contracts/modules/UpgradableModuleFactory.sol b/contracts/modules/UpgradableModuleFactory.sol index 01dab6430..153623f1d 100644 --- a/contracts/modules/UpgradableModuleFactory.sol +++ b/contracts/modules/UpgradableModuleFactory.sol @@ -39,20 +39,18 @@ contract UpgradableModuleFactory is ModuleFactory { /** * @notice Constructor * @param _setupCost Setup cost of the module - * @param _usageCost Usage cost of the module - * @param _logicContract Contract address that contains the logic related to `description` + * @param _logicContract Contract address that contains the logic related to `description` * @param _polymathRegistry Address of the Polymath registry * @param _isCostInPoly true = cost in Poly, false = USD */ constructor( string memory _version, uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) - public ModuleFactory(_setupCost, _usageCost, _polymathRegistry, _isCostInPoly) + public ModuleFactory(_setupCost, _polymathRegistry, _isCostInPoly) { require(_logicContract != address(0), "Invalid address"); logicContracts[latestUpgrade].logicContract = _logicContract; diff --git a/contracts/modules/Wallet/VestingEscrowWalletFactory.sol b/contracts/modules/Wallet/VestingEscrowWalletFactory.sol index 551b11185..3e793b264 100644 --- a/contracts/modules/Wallet/VestingEscrowWalletFactory.sol +++ b/contracts/modules/Wallet/VestingEscrowWalletFactory.sol @@ -13,13 +13,12 @@ contract VestingEscrowWalletFactory is UpgradableModuleFactory { */ constructor ( uint256 _setupCost, - uint256 _usageCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly ) public - UpgradableModuleFactory("3.0.0", _setupCost, _usageCost, _logicContract, _polymathRegistry, _isCostInPoly) + UpgradableModuleFactory("3.0.0", _setupCost, _logicContract, _polymathRegistry, _isCostInPoly) { name = "VestingEscrowWallet"; title = "Vesting Escrow Wallet"; diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index a7821aa43..f9e67cec4 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -314,54 +314,54 @@ module.exports = function(deployer, network, accounts) { .then(() => { // B) Deploy the GeneralTransferManagerFactory Contract (Factory used to generate the GeneralTransferManager contract and this // manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(GeneralTransferManagerFactory, new BN(0), new BN(0), GeneralTransferManagerLogic.address, polymathRegistry.address, { + return deployer.deploy(GeneralTransferManagerFactory, new BN(0), GeneralTransferManagerLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // C) Deploy the GeneralPermissionManagerFactory Contract (Factory used to generate the GeneralPermissionManager contract and // this manager attach with the securityToken contract at the time of deployment) - return deployer.deploy(GeneralPermissionManagerFactory, new BN(0), new BN(0), GeneralPermissionManagerLogic.address, polymathRegistry.address, { + return deployer.deploy(GeneralPermissionManagerFactory, new BN(0), GeneralPermissionManagerLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // D) Deploy the CountTransferManagerFactory Contract (Factory used to generate the CountTransferManager contract use // to track the counts of the investors of the security token) - return deployer.deploy(CountTransferManagerFactory, new BN(0), new BN(0), CountTransferManagerLogic.address, polymathRegistry.address, { + return deployer.deploy(CountTransferManagerFactory, new BN(0), CountTransferManagerLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // D) Deploy the PercentageTransferManagerFactory Contract (Factory used to generate the PercentageTransferManager contract use // to track the percentage of investment the investors could do for a particular security token) - return deployer.deploy(PercentageTransferManagerFactory, new BN(0), new BN(0), PercentageTransferManagerLogic.address, polymathRegistry.address, { + return deployer.deploy(PercentageTransferManagerFactory, new BN(0), PercentageTransferManagerLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // D) Deploy the EtherDividendCheckpointFactory Contract (Factory used to generate the EtherDividendCheckpoint contract use // to provide the functionality of the dividend in terms of ETH) - return deployer.deploy(EtherDividendCheckpointFactory, new BN(0), new BN(0), EtherDividendCheckpointLogic.address, polymathRegistry.address, { + return deployer.deploy(EtherDividendCheckpointFactory, new BN(0), EtherDividendCheckpointLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // D) Deploy the ERC20DividendCheckpointFactory Contract (Factory used to generate the ERC20DividendCheckpoint contract use // to provide the functionality of the dividend in terms of ERC20 token) - return deployer.deploy(ERC20DividendCheckpointFactory, new BN(0), new BN(0), ERC20DividendCheckpointLogic.address, polymathRegistry.address, { + return deployer.deploy(ERC20DividendCheckpointFactory, new BN(0), ERC20DividendCheckpointLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // D) Deploy the VolumeRestrictionTMFactory Contract (Factory used to generate the VolumeRestrictionTM contract use // to provide the functionality of restricting the token volume) - return deployer.deploy(VolumeRestrictionTMFactory, new BN(0), new BN(0), VolumeRestrictionTMLogic.address, polymathRegistry.address, { from: PolymathAccount }); + return deployer.deploy(VolumeRestrictionTMFactory, new BN(0), VolumeRestrictionTMLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // D) Deploy the ManualApprovalTransferManagerFactory Contract (Factory used to generate the ManualApprovalTransferManager contract use // to manual approve the transfer that will overcome the other transfer restrictions) - return deployer.deploy(ManualApprovalTransferManagerFactory, new BN(0), new BN(0), ManualApprovalTransferManagerLogic.address, polymathRegistry.address, { + return deployer.deploy(ManualApprovalTransferManagerFactory, new BN(0), ManualApprovalTransferManagerLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) @@ -517,7 +517,7 @@ module.exports = function(deployer, network, accounts) { }) .then(() => { // M) Deploy the CappedSTOFactory (Use to generate the CappedSTO contract which will used to collect the funds ). - return deployer.deploy(CappedSTOFactory, cappedSTOSetupCost, new BN(0), CappedSTOLogic.address, polymathRegistry.address, { from: PolymathAccount }); + return deployer.deploy(CappedSTOFactory, cappedSTOSetupCost, CappedSTOLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // N) Register the CappedSTOFactory in the ModuleRegistry to make the factory available at the protocol level. @@ -532,7 +532,7 @@ module.exports = function(deployer, network, accounts) { }) .then(() => { // H) Deploy the USDTieredSTOFactory (Use to generate the USDTieredSTOFactory contract which will used to collect the funds ). - return deployer.deploy(USDTieredSTOFactory, usdTieredSTOSetupCost, new BN(0), USDTieredSTOLogic.address, polymathRegistry.address, { from: PolymathAccount }); + return deployer.deploy(USDTieredSTOFactory, usdTieredSTOSetupCost, USDTieredSTOLogic.address, polymathRegistry.address, { from: PolymathAccount }); }) .then(() => { // I) Register the USDTieredSTOFactory in the ModuleRegistry to make the factory available at the protocol level. diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index 3ff38baa9..e90e3d1a1 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -847,7 +847,6 @@ contract("CappedSTO", async (accounts) => { describe("Pricing Test cases for Module Factory", async () => { it("Should return correct price when price is in poly", async () => { let newFactory = await CappedSTOFactory.new( - new BN(1000), new BN(1000), I_CappedSTO_Array_POLY[0].address, I_PolymathRegistry.address, @@ -855,9 +854,7 @@ contract("CappedSTO", async (accounts) => { { from: account_polymath } ); assert.equal((await newFactory.setupCostInPoly.call()).toString(), (new BN(1000)).toString()); - assert.equal((await newFactory.usageCostInPoly.call()).toString(), (new BN(1000)).toString()); assert.equal((await newFactory.setupCost()).toString(), (new BN(1000)).toString()); - assert.equal((await newFactory.usageCost()).toString(), (new BN(1000)).toString()); }); }); diff --git a/test/d_count_transfer_manager.js b/test/d_count_transfer_manager.js index fea69d249..c1c34d1e7 100644 --- a/test/d_count_transfer_manager.js +++ b/test/d_count_transfer_manager.js @@ -555,34 +555,20 @@ contract("CountTransferManager", async (accounts) => { it("Should successfully change the cost type -- fail beacuse of bad owner", async () => { await catchRevert( - I_CountTransferManagerFactory.changeCostsAndType(new BN(web3.utils.toWei("100")), new BN(web3.utils.toWei("500")), true, { from: account_investor3 }) + I_CountTransferManagerFactory.changeCostAndType(new BN(web3.utils.toWei("500")), true, { from: account_investor3 }) ); }); it("Should successfully change the cost type", async () => { let snapId = await takeSnapshot(); - let tx = await I_CountTransferManagerFactory.changeCostsAndType(new BN(web3.utils.toWei("100")), new BN(web3.utils.toWei("500")), true, { from: account_polymath }); - assert.equal(tx.logs[0].args[1].toString(), new BN(web3.utils.toWei("100")).toString(), "wrong setup fee in event"); - assert.equal(tx.logs[1].args[1].toString(), new BN(web3.utils.toWei("500")).toString(), "wrong usage fee in event"); - assert.equal(tx.logs[2].args[1], true, "wrong fee type in event"); - assert.equal((await I_CountTransferManagerFactory.setupCost.call()).toString(), new BN(web3.utils.toWei("100")).toString()); - assert.equal((await I_CountTransferManagerFactory.usageCost.call()).toString(), new BN(web3.utils.toWei("500")).toString()); + let tx = await I_CountTransferManagerFactory.changeCostAndType(new BN(web3.utils.toWei("500")), true, { from: account_polymath }); + assert.equal(tx.logs[0].args[1].toString(), new BN(web3.utils.toWei("500")).toString(), "wrong setup fee in event"); + assert.equal(tx.logs[1].args[1], true, "wrong fee type in event"); + assert.equal((await I_CountTransferManagerFactory.setupCost.call()).toString(), new BN(web3.utils.toWei("500")).toString()); assert.equal((await I_CountTransferManagerFactory.setupCost.call()).toString(), (await I_CountTransferManagerFactory.setupCostInPoly.call()).toString()); - assert.equal((await I_CountTransferManagerFactory.usageCost.call()).toString(), (await I_CountTransferManagerFactory.usageCostInPoly.call()).toString()); await revertToSnapshot(snapId); }); - it("Should successfully change the usage fee -- fail beacuse of bad owner", async () => { - await catchRevert( - I_CountTransferManagerFactory.changeUsageCost(new BN(web3.utils.toWei("500")), { from: account_investor3 }) - ); - }); - - it("Should successfully change the usage fee", async () => { - await I_CountTransferManagerFactory.changeUsageCost(new BN(web3.utils.toWei("800")), { from: account_polymath }); - assert.equal((await I_CountTransferManagerFactory.usageCost.call()).toString(), new BN(web3.utils.toWei("800")).toString()); - }); - }); describe("Test case for the changeSTVersionBounds", async () => { diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index 829108bfc..bf5119957 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -1005,40 +1005,12 @@ contract("GeneralTransferManager", async (accounts) => { assert.equal(web3.utils.toAscii(perm[0]).replace(/\u0000/g, ""), "ADMIN"); }); - it("Should set a usage fee for the GTM", async () => { - // Fail due to wrong owner - await catchRevert(I_GeneralTransferManagerFactory.changeUsageCost(new BN(web3.utils.toWei("1", "ether")), { from: token_owner})); - await I_GeneralTransferManagerFactory.changeUsageCost(new BN(web3.utils.toWei("1", "ether")), { from: account_polymath }); - }); - - it("Should fail to pull fees as no budget set", async () => { - await catchRevert(I_GeneralTransferManager.takeUsageFee( { from: account_polymath })); - }); - it("Should set a budget for the GeneralTransferManager", async () => { await I_SecurityToken.changeModuleBudget(I_GeneralTransferManager.address, new BN(10).pow(new BN(19)), true, { from: token_owner }); - await catchRevert(I_GeneralTransferManager.takeUsageFee({ from: token_owner })); await I_PolyToken.getTokens(new BN(10).pow(new BN(19)), token_owner); await I_PolyToken.transfer(I_SecurityToken.address, new BN(10).pow(new BN(19)), { from: token_owner }); }); - it("Factory owner should pull fees - fails as not permissioned by issuer", async () => { - await catchRevert(I_GeneralTransferManager.takeUsageFee({ from: account_delegate })); - }); - - it("Factory owner should pull fees", async () => { - let log = await I_GeneralPermissionManager.addDelegate(account_delegate, web3.utils.fromAscii("My details"), { from: token_owner }); - assert.equal(log.logs[0].args._delegate, account_delegate); - - await I_GeneralPermissionManager.changePermission(account_delegate, I_GeneralTransferManager.address, web3.utils.fromAscii("ADMIN"), true, { - from: token_owner - }); - let balanceBefore = await I_PolyToken.balanceOf(account_polymath); - await I_GeneralTransferManager.takeUsageFee({ from: account_delegate }); - let balanceAfter = await I_PolyToken.balanceOf(account_polymath); - assert.equal(balanceBefore.add(new BN(web3.utils.toWei("1", "ether"))).toString(), balanceAfter.toString(), "Fee is transferred"); - }); - it("should allow authorized people to modify transfer requirements", async () => { await I_GeneralTransferManager.modifyTransferRequirements(0, false, true, false, false, { from: token_owner }); let transferRestrions = await I_GeneralTransferManager.transferRequirements(0); @@ -1062,6 +1034,12 @@ contract("GeneralTransferManager", async (accounts) => { }); it("Should change the Issuance address", async () => { + let log = await I_GeneralPermissionManager.addDelegate(account_delegate, web3.utils.fromAscii("My details"), { from: token_owner }); + assert.equal(log.logs[0].args._delegate, account_delegate); + + await I_GeneralPermissionManager.changePermission(account_delegate, I_GeneralTransferManager.address, web3.utils.fromAscii("ADMIN"), true, { + from: token_owner + }); let tx = await I_GeneralTransferManager.changeIssuanceAddress(account_investor2, { from: account_delegate }); assert.equal(tx.logs[0].args._issuanceAddress, account_investor2); }); diff --git a/test/helpers/createInstances.js b/test/helpers/createInstances.js index 1687b8b65..69bea5e73 100644 --- a/test/helpers/createInstances.js +++ b/test/helpers/createInstances.js @@ -233,7 +233,7 @@ async function deployGTMLogic(account_polymath) { } async function deployGTM(account_polymath) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(new BN(0), new BN(0), I_GeneralTransferManagerLogic.address, I_PolymathRegistry.address, true, { + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(new BN(0), I_GeneralTransferManagerLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); @@ -319,7 +319,7 @@ async function registerAndVerifyByMR(factoryAdrress, owner, mr) { /// Deploy the TransferManagers export async function deployGTMAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(setupCost, new BN(0), I_GeneralTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(setupCost, I_GeneralTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); @@ -337,7 +337,7 @@ export async function deployGTMAndVerifyed(accountPolymath, MRProxyInstance, set export async function deployVRTMAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_VolumeRestrictionTMLogic = await VolumeRestrictionTM.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_VolumeRestrictionTMFactory = await VolumeRestrictionTMFactory.new(setupCost, new BN(0), I_VolumeRestrictionTMLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_VolumeRestrictionTMFactory = await VolumeRestrictionTMFactory.new(setupCost, I_VolumeRestrictionTMLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_VolumeRestrictionTMFactory.address.valueOf(), @@ -352,7 +352,7 @@ export async function deployVRTMAndVerifyed(accountPolymath, MRProxyInstance, se export async function deployCountTMAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_CountTransferManagerLogic = await CountTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_CountTransferManagerFactory = await CountTransferManagerFactory.new(setupCost, new BN(0), I_CountTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_CountTransferManagerFactory = await CountTransferManagerFactory.new(setupCost, I_CountTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_CountTransferManagerFactory.address.valueOf(), @@ -366,7 +366,7 @@ export async function deployCountTMAndVerifyed(accountPolymath, MRProxyInstance, export async function deployManualApprovalTMAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_ManualApprovalTransferManagerLogic = await ManualApprovalTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_ManualApprovalTransferManagerFactory = await ManualApprovalTransferManagerFactory.new(setupCost, new BN(0), ManualApprovalTransferManager.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_ManualApprovalTransferManagerFactory = await ManualApprovalTransferManagerFactory.new(setupCost, ManualApprovalTransferManager.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_ManualApprovalTransferManagerFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -379,7 +379,7 @@ export async function deployManualApprovalTMAndVerifyed(accountPolymath, MRProxy export async function deployPercentageTMAndVerified(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_PercentageTransferManagerLogic = await PercentageTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_PercentageTransferManagerFactory = await PercentageTransferManagerFactory.new(setupCost, new BN(0), I_PercentageTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_PercentageTransferManagerFactory = await PercentageTransferManagerFactory.new(setupCost, I_PercentageTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_PercentageTransferManagerFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -392,7 +392,7 @@ export async function deployPercentageTMAndVerified(accountPolymath, MRProxyInst export async function deployBlacklistTMAndVerified(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_BlacklistTransferManagerLogic = await BlacklistTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_BlacklistTransferManagerFactory = await BlacklistTransferManagerFactory.new(setupCost, new BN(0), I_BlacklistTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_BlacklistTransferManagerFactory = await BlacklistTransferManagerFactory.new(setupCost, I_BlacklistTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_BlacklistTransferManagerFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -405,7 +405,7 @@ export async function deployBlacklistTMAndVerified(accountPolymath, MRProxyInsta export async function deployLockUpTMAndVerified(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_LockUpTransferManagerLogic = await LockUpTransferManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_LockUpTransferManagerFactory = await LockUpTransferManagerFactory.new(setupCost, new BN(0), I_LockUpTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { + I_LockUpTransferManagerFactory = await LockUpTransferManagerFactory.new(setupCost, I_LockUpTransferManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( @@ -419,7 +419,7 @@ export async function deployLockUpTMAndVerified(accountPolymath, MRProxyInstance } export async function deployScheduleCheckpointAndVerified(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { - I_ScheduledCheckpointFactory = await ScheduledCheckpointFactory.new(setupCost, new BN(0), I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_ScheduledCheckpointFactory = await ScheduledCheckpointFactory.new(setupCost, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_ScheduledCheckpointFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -434,7 +434,7 @@ export async function deployScheduleCheckpointAndVerified(accountPolymath, MRPro export async function deployGPMAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_GeneralPermissionManagerLogic = await GeneralPermissionManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_GeneralPermissionManagerFactory = await GeneralPermissionManagerFactory.new(setupCost, new BN(0), I_GeneralPermissionManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_GeneralPermissionManagerFactory = await GeneralPermissionManagerFactory.new(setupCost, I_GeneralPermissionManagerLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_GeneralPermissionManagerFactory.address.valueOf(), @@ -451,7 +451,7 @@ export async function deployGPMAndVerifyed(accountPolymath, MRProxyInstance, set export async function deployDummySTOAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_DummySTOLogic = await DummySTO.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_DummySTOFactory = await DummySTOFactory.new(setupCost, new BN(0), I_DummySTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_DummySTOFactory = await DummySTOFactory.new(setupCost, I_DummySTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_DummySTOFactory.address.valueOf(), @@ -464,7 +464,7 @@ export async function deployDummySTOAndVerifyed(accountPolymath, MRProxyInstance export async function deployCappedSTOAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_CappedSTOLogic = await CappedSTO.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_CappedSTOFactory = await CappedSTOFactory.new(setupCost, new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_CappedSTOFactory = await CappedSTOFactory.new(setupCost, I_CappedSTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_CappedSTOFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -477,7 +477,7 @@ export async function deployCappedSTOAndVerifyed(accountPolymath, MRProxyInstanc export async function deployPresaleSTOAndVerified(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_PreSaleSTOLogic = await PreSaleSTO.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_PreSaleSTOFactory = await PreSaleSTOFactory.new(setupCost, new BN(0), I_PreSaleSTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_PreSaleSTOFactory = await PreSaleSTOFactory.new(setupCost, I_PreSaleSTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_PreSaleSTOFactory.address.valueOf(), @@ -496,7 +496,7 @@ export async function deployUSDTieredSTOAndVerified(accountPolymath, MRProxyInst { from: accountPolymath } ); - I_USDTieredSTOFactory = await USDTieredSTOFactory.new(setupCost, new BN(0), I_USDTieredSTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_USDTieredSTOFactory = await USDTieredSTOFactory.new(setupCost, I_USDTieredSTOLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_USDTieredSTOFactory.address.valueOf(), @@ -516,7 +516,7 @@ export async function deployERC20DividendAndVerifyed(accountPolymath, MRProxyIns "0x0000000000000000000000000000000000000000", { from: accountPolymath } ); - I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(setupCost, new BN(0), I_ERC20DividendCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { + I_ERC20DividendCheckpointFactory = await ERC20DividendCheckpointFactory.new(setupCost, I_ERC20DividendCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); @@ -535,7 +535,7 @@ export async function deployEtherDividendAndVerifyed(accountPolymath, MRProxyIns "0x0000000000000000000000000000000000000000", { from: accountPolymath } ); - I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(setupCost, new BN(0), I_EtherDividendCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { + I_EtherDividendCheckpointFactory = await EtherDividendCheckpointFactory.new(setupCost, I_EtherDividendCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); @@ -552,7 +552,7 @@ export async function deployEtherDividendAndVerifyed(accountPolymath, MRProxyIns /// Deploy the Burn Module export async function deployRedemptionAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { - I_TrackedRedemptionFactory = await TrackedRedemptionFactory.new(setupCost, new BN(0), I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_TrackedRedemptionFactory = await TrackedRedemptionFactory.new(setupCost, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_TrackedRedemptionFactory.address.valueOf(), @@ -566,7 +566,7 @@ export async function deployRedemptionAndVerifyed(accountPolymath, MRProxyInstan export async function deployVestingEscrowWalletAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_VestingEscrowWalletLogic = await VestingEscrowWallet.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_VestingEscrowWalletFactory = await VestingEscrowWalletFactory.new(setupCost, new BN(0), I_VestingEscrowWalletLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_VestingEscrowWalletFactory = await VestingEscrowWalletFactory.new(setupCost, I_VestingEscrowWalletLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_VestingEscrowWalletFactory.address.valueOf(), @@ -579,7 +579,7 @@ export async function deployVestingEscrowWalletAndVerifyed(accountPolymath, MRPr } export async function deployMockRedemptionAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { - I_MockBurnFactory = await MockBurnFactory.new(setupCost, new BN(0), I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_MockBurnFactory = await MockBurnFactory.new(setupCost, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_MockBurnFactory.address.valueOf(), @@ -592,7 +592,7 @@ export async function deployMockRedemptionAndVerifyed(accountPolymath, MRProxyIn } export async function deployMockWrongTypeRedemptionAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { - I_MockWrongTypeBurnFactory = await MockWrongTypeFactory.new(setupCost, new BN(0), I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_MockWrongTypeBurnFactory = await MockWrongTypeFactory.new(setupCost, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_MockWrongTypeBurnFactory.address.valueOf(), @@ -605,7 +605,7 @@ export async function deployMockWrongTypeRedemptionAndVerifyed(accountPolymath, } export async function deploySignedTMAndVerifyed(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { - I_SignedTransferManagerFactory = await SignedTransferManagerFactory.new(setupCost, new BN(0), I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_SignedTransferManagerFactory = await SignedTransferManagerFactory.new(setupCost, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_SignedTransferManagerFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -620,7 +620,7 @@ export async function deploySignedTMAndVerifyed(accountPolymath, MRProxyInstance export async function deployPLCRVoteCheckpoint(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_PLCRVotingCheckpointLogic = await PLCRVotingCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_PLCRVotingCheckpointFactory = await PLCRVotingCheckpointFactory.new(setupCost, new BN(0), I_PLCRVotingCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_PLCRVotingCheckpointFactory = await PLCRVotingCheckpointFactory.new(setupCost, I_PLCRVotingCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_PLCRVotingCheckpointFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", @@ -634,7 +634,7 @@ export async function deployPLCRVoteCheckpoint(accountPolymath, MRProxyInstance, export async function deployWeightedVoteCheckpoint(accountPolymath, MRProxyInstance, setupCost, feeInPoly = false) { I_WeightedVoteCheckpointLogic = await WeightedVoteCheckpoint.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: accountPolymath }); - I_WeightedVoteCheckpointFactory = await WeightedVoteCheckpointFactory.new(setupCost, new BN(0), I_WeightedVoteCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); + I_WeightedVoteCheckpointFactory = await WeightedVoteCheckpointFactory.new(setupCost, I_WeightedVoteCheckpointLogic.address, I_PolymathRegistry.address, feeInPoly, { from: accountPolymath }); assert.notEqual( I_WeightedVoteCheckpointFactory.address.valueOf(), "0x0000000000000000000000000000000000000000", diff --git a/test/k_module_registry.js b/test/k_module_registry.js index 52eb0e2b9..f1483e358 100644 --- a/test/k_module_registry.js +++ b/test/k_module_registry.js @@ -258,14 +258,14 @@ contract("ModuleRegistry", async (accounts) => { }); it("Should fail in registering the module-- type = 0", async () => { - I_MockFactory = await MockFactory.new(new BN(0), new BN(0), one_address, I_PolymathRegistry.address, true, { from: account_polymath }); + I_MockFactory = await MockFactory.new(new BN(0), one_address, I_PolymathRegistry.address, true, { from: account_polymath }); catchRevert(I_MRProxied.registerModule(I_MockFactory.address, { from: account_polymath })); }); it("Should fail to register the new module because msg.sender is not the owner of the module", async() => { I_CappedSTOLogic = await CappedSTO.new(address_zero, address_zero, { from: account_polymath }); - I_CappedSTOFactory3 = await CappedSTOFactory.new(new BN(0), new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: account_temp }); + I_CappedSTOFactory3 = await CappedSTOFactory.new(new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: account_temp }); catchRevert(I_MRProxied.registerModule(I_CappedSTOFactory3.address, { from: token_owner })); }); @@ -288,7 +288,7 @@ contract("ModuleRegistry", async (accounts) => { }); it("Should successfully verify the module -- false", async () => { - I_CappedSTOFactory1 = await CappedSTOFactory.new(new BN(0), new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); + I_CappedSTOFactory1 = await CappedSTOFactory.new(new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); await I_MRProxied.registerModule(I_CappedSTOFactory1.address, { from: account_polymath }); let tx = await I_MRProxied.unverifyModule(I_CappedSTOFactory1.address, { from: account_polymath }); assert.equal(tx.logs[0].args._moduleFactory, I_CappedSTOFactory1.address, "Failed in verifying the module"); @@ -322,7 +322,7 @@ contract("ModuleRegistry", async (accounts) => { }); it("Should fail to register module because custom modules not allowed", async () => { - I_CappedSTOFactory2 = await CappedSTOFactory.new(new BN(0), new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: token_owner }); + I_CappedSTOFactory2 = await CappedSTOFactory.new(new BN(0), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: token_owner }); assert.notEqual(I_CappedSTOFactory2.address.valueOf(), address_zero, "CappedSTOFactory contract was not deployed"); @@ -370,7 +370,7 @@ contract("ModuleRegistry", async (accounts) => { it("Should successfully add verified module", async () => { I_GeneralPermissionManagerLogic = await GeneralPermissionManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); - I_GeneralPermissionManagerFactory = await GeneralPermissionManagerFactory.new(new BN(0), new BN(0), I_GeneralPermissionManagerLogic.address, I_PolymathRegistry.address, true, { + I_GeneralPermissionManagerFactory = await GeneralPermissionManagerFactory.new(new BN(0), I_GeneralPermissionManagerLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); await I_MRProxied.registerModule(I_GeneralPermissionManagerFactory.address, { from: account_polymath }); @@ -381,7 +381,7 @@ contract("ModuleRegistry", async (accounts) => { it("Should failed in adding the TestSTOFactory module because not compatible with the current protocol version --lower", async () => { let I_TestSTOFactoryLogic = await DummySTO.new(address_zero, address_zero); - I_TestSTOFactory = await TestSTOFactory.new(new BN(0), new BN(0), I_TestSTOFactoryLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); + I_TestSTOFactory = await TestSTOFactory.new(new BN(0), I_TestSTOFactoryLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); await I_MRProxied.registerModule(I_TestSTOFactory.address, { from: account_polymath }); await I_MRProxied.verifyModule(I_TestSTOFactory.address, { from: account_polymath }); // Taking the snapshot the revert the changes from here diff --git a/test/u_module_registry_proxy.js b/test/u_module_registry_proxy.js index e3447bf27..aa52865fe 100644 --- a/test/u_module_registry_proxy.js +++ b/test/u_module_registry_proxy.js @@ -146,7 +146,7 @@ contract("ModuleRegistryProxy", async (accounts) => { { from: account_polymath } ); - I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(new BN(0), new BN(0), I_GeneralTransferManagerLogic.address, I_PolymathRegistry.address, true, { + I_GeneralTransferManagerFactory = await GeneralTransferManagerFactory.new(new BN(0), I_GeneralTransferManagerLogic.address, I_PolymathRegistry.address, true, { from: account_polymath }); @@ -195,7 +195,7 @@ contract("ModuleRegistryProxy", async (accounts) => { describe("Feed some data in storage", async () => { it("Register and verify the new module", async () => { I_GeneralPermissionManagerLogic = await GeneralPermissionManager.new("0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", { from: account_polymath }); - I_GeneralPermissionManagerfactory = await GeneralPermissionManagerFactory.new(new BN(0), new BN(0), I_GeneralPermissionManagerLogic.address, I_PolymathRegistry.address, true, { + I_GeneralPermissionManagerfactory = await GeneralPermissionManagerFactory.new(new BN(0), I_GeneralPermissionManagerLogic.address, I_PolymathRegistry.address, true, { from: account_polymath });