From 01101d0fe52b523654d58d1fd67b2efa4e883269 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 3 Jul 2019 19:06:44 +0530 Subject: [PATCH] Protocol upgrade fixes (#733) * Update tags, types, lower & upper bounds (#725) * Make useModule backwards compatible * Make deployToken backwards compatible (#726) * Make deployToken backwards compatible * Small fix for scheduledCheckpoint * Updated STR interface * Removed extra event * Fix interface mismatch * cleaning up as per the audit recommendation (#722) --- contracts/ModuleRegistry.sol | 26 ++++++++++++++----- contracts/SecurityTokenRegistry.sol | 26 ++++++++++++++----- contracts/interfaces/IModuleFactory.sol | 8 +++--- contracts/interfaces/IModuleRegistry.sol | 6 +++++ contracts/interfaces/ISTFactory.sol | 8 +++--- .../interfaces/ISecurityTokenRegistry.sol | 5 ++-- contracts/mocks/MockFactory.sol | 2 +- contracts/mocks/MockWrongTypeFactory.sol | 2 +- contracts/mocks/TestSTOFactory.sol | 2 +- .../Voting/PLCR/PLCRVotingCheckpoint.sol | 12 ++++----- .../Mixed/ScheduledCheckpoint.sol | 2 ++ contracts/modules/ModuleFactory.sol | 8 +++--- .../TransferManager/TransferManager.sol | 2 +- contracts/tokens/STFactory.sol | 6 +---- contracts/tokens/SecurityToken.sol | 2 +- test/b_capped_sto.js | 4 +-- test/d_count_transfer_manager.js | 4 +-- test/e_erc20_dividends.js | 4 +-- test/f_ether_dividends.js | 4 +-- test/g_general_permission_manager.js | 4 +-- test/h_general_transfer_manager.js | 8 +++--- test/j_manual_approval_transfer_manager.js | 4 +-- test/k_module_registry.js | 6 ++--- test/l_percentage_transfer_manager.js | 4 +-- test/m_presale_sto.js | 4 +-- test/p_usd_tiered_sto.js | 4 +-- test/v_tracked_redemptions.js | 4 +-- test/w_lockup_transfer_manager.js | 4 +-- test/y_volume_restriction_tm.js | 4 +-- test/z_blacklist_transfer_manager.js | 4 +-- test/z_vesting_escrow_wallet.js | 2 +- test/zc_plcr_voting_checkpoint.js | 4 +-- test/zd_weighted_vote_checkpoint.js | 4 +-- 33 files changed, 109 insertions(+), 84 deletions(-) diff --git a/contracts/ModuleRegistry.sol b/contracts/ModuleRegistry.sol index 92c27b7a3..840e8bd2c 100644 --- a/contracts/ModuleRegistry.sol +++ b/contracts/ModuleRegistry.sol @@ -43,7 +43,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { bytes32 constant POLYMATHREGISTRY = 0x90eeab7c36075577c7cc5ff366e389fefa8a18289b949bab3529ab4471139d4d; //keccak256("polymathRegistry") bytes32 constant FEATURE_REGISTRY = 0xed9ca06607835ad25ecacbcb97f2bc414d4a51ecf391b5ae42f15991227ab146; //keccak256("featureRegistry") bytes32 constant SECURITY_TOKEN_REGISTRY = 0x12ada4f7ee6c2b7b933330be61fefa007a1f497dc8df1b349b48071a958d7a81; //keccak256("securityTokenRegistry") - + /////////////// //// Modifiers /////////////// @@ -118,6 +118,18 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { return IFeatureRegistry(getAddressValue(FEATURE_REGISTRY)).getFeatureStatus("customModulesAllowed"); } + + /** + * @notice Called by a SecurityToken (2.x) to check if the ModuleFactory is verified or appropriate custom module + * @dev ModuleFactory reputation increases by one every time it is deployed(used) by a ST. + * @dev Any module can be added during token creation without being registered if it is defined in the token proxy deployment contract + * @dev The feature switch for custom modules is labelled "customModulesAllowed" + * @param _moduleFactory is the address of the relevant module factory + */ + function useModule(address _moduleFactory) external { + useModule(_moduleFactory, false); + } + /** * @notice Called by a SecurityToken to check if the ModuleFactory is verified or appropriate custom module * @dev ModuleFactory reputation increases by one every time it is deployed(used) by a ST. @@ -126,7 +138,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { * @param _moduleFactory is the address of the relevant module factory * @param _isUpgrade whether or not the function is being called as a result of an upgrade */ - function useModule(address _moduleFactory, bool _isUpgrade) external nonReentrant { + function useModule(address _moduleFactory, bool _isUpgrade) public nonReentrant { if (_customModules()) { require( getBoolValue(Encoder.getKey("verified", _moduleFactory)) || getAddressValue(Encoder.getKey("factoryOwner", _moduleFactory)) @@ -155,8 +167,8 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { */ function isCompatibleModule(address _moduleFactory, address _securityToken) public view returns(bool) { uint8[] memory _latestVersion = ISecurityToken(_securityToken).getVersion(); - uint8[] memory _lowerBound = IModuleFactory(_moduleFactory).lowerSTVersionBounds(); - uint8[] memory _upperBound = IModuleFactory(_moduleFactory).upperSTVersionBounds(); + uint8[] memory _lowerBound = IModuleFactory(_moduleFactory).getLowerSTVersionBounds(); + uint8[] memory _upperBound = IModuleFactory(_moduleFactory).getUpperSTVersionBounds(); bool _isLowerAllowed = VersionUtils.lessThanOrEqual(_lowerBound, _latestVersion); bool _isUpperAllowed = VersionUtils.greaterThanOrEqual(_upperBound, _latestVersion); return (_isLowerAllowed && _isUpperAllowed); @@ -183,7 +195,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { //Enforce type uniqueness uint256 i; uint256 j; - uint8[] memory moduleTypes = moduleFactory.types(); + uint8[] memory moduleTypes = moduleFactory.getTypes(); for (i = 1; i < moduleTypes.length; i++) { for (j = 0; j < i; j++) { require(moduleTypes[i] != moduleTypes[j], "Type mismatch"); @@ -304,14 +316,14 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { uint256 i; uint256 j; for (i = 0; i < _modules.length; i++) { - counter = counter + IModuleFactory(_modules[i]).tags().length; + counter = counter + IModuleFactory(_modules[i]).getTags().length; } bytes32[] memory tags = new bytes32[](counter); address[] memory modules = new address[](counter); bytes32[] memory tempTags; counter = 0; for (i = 0; i < _modules.length; i++) { - tempTags = IModuleFactory(_modules[i]).tags(); + tempTags = IModuleFactory(_modules[i]).getTags(); for (j = 0; j < tempTags.length; j++) { tags[counter] = tempTags[j]; modules[counter] = _modules[i]; diff --git a/contracts/SecurityTokenRegistry.sol b/contracts/SecurityTokenRegistry.sol index 751511a79..222a6e053 100644 --- a/contracts/SecurityTokenRegistry.sol +++ b/contracts/SecurityTokenRegistry.sol @@ -108,7 +108,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { // Emit when ownership of the ticker gets changed event ChangeTickerOwnership(string _ticker, address indexed _oldOwner, address indexed _newOwner); // Emit at the time of launching a new security token of version 3.0+ - event NewSecurityTokenCreated( + event NewSecurityToken( string _ticker, string _name, address indexed _securityTokenAddress, @@ -173,10 +173,14 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { - require(msg.sender == owner(), "Only owner"); + _onlyOwner(); _; } + function _onlyOwner() internal view { + require(msg.sender == owner(), "Only owner"); + } + modifier onlyOwnerOrSelf() { require(msg.sender == owner() || msg.sender == address(this), "Only owner or self"); _; @@ -639,7 +643,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { _ticker, _name, newSecurityTokenAddress, issuer, now, issuer, false, _polyFee ); } else { - emit NewSecurityTokenCreated( + emit NewSecurityToken( _ticker, _name, newSecurityTokenAddress, issuer, now, issuer, false, _usdFee, _polyFee, _protocolVersion ); } @@ -691,6 +695,16 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { internal returns(address newSecurityTokenAddress) { + // In v2.x of STFactory, the final argument to deployToken is the PolymathRegistry. + // In v3.x of STFactory, the final argument to deployToken is the Treasury wallet. + uint8[] memory upperLimit = new uint8[](3); + upperLimit[0] = 2; + upperLimit[1] = 99; + upperLimit[2] = 99; + if (VersionUtils.lessThanOrEqual(VersionUtils.unpack(uint24(_protocolVersion)), upperLimit)) { + _wallet = getAddressValue(POLYMATHREGISTRY); + } + newSecurityTokenAddress = ISTFactory(getAddressValue(Encoder.getKey("protocolVersionST", _protocolVersion))).deployToken( _name, _ticker, @@ -698,8 +712,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { _tokenDetails, _issuer, _divisible, - _wallet, - getAddressValue(POLYMATHREGISTRY) + _wallet ); /*solium-disable-next-line security/no-block-members*/ @@ -739,7 +752,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { set(Encoder.getKey("tickerToSecurityToken", ticker), _securityToken); _modifyTicker(_owner, ticker, registrationTime, expiryTime, true); _storeSecurityTokenData(_securityToken, ticker, _tokenDetails, _deployedAt); - emit NewSecurityTokenCreated( + emit NewSecurityToken( ticker, ISecurityToken(_securityToken).name(), _securityToken, _owner, _deployedAt, msg.sender, true, uint256(0), uint256(0), 0 ); } @@ -951,5 +964,4 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { function owner() public view returns(address) { return getAddressValue(OWNER); } - } diff --git a/contracts/interfaces/IModuleFactory.sol b/contracts/interfaces/IModuleFactory.sol index 48630a500..858874b82 100644 --- a/contracts/interfaces/IModuleFactory.sol +++ b/contracts/interfaces/IModuleFactory.sol @@ -47,12 +47,12 @@ interface IModuleFactory { /** * @notice Type of the Module factory */ - function types() external view returns(uint8[] memory moduleTypes); + function getTypes() external view returns(uint8[] memory moduleTypes); /** * @notice Get the tags related to the module factory */ - function tags() external view returns(bytes32[] memory moduleTags); + function getTags() external view returns(bytes32[] memory moduleTags); /** * @notice Used to change the setup fee @@ -83,13 +83,13 @@ interface IModuleFactory { * @notice Used to get the lower bound * @return Lower bound */ - function lowerSTVersionBounds() external view returns(uint8[] memory lowerBounds); + function getLowerSTVersionBounds() external view returns(uint8[] memory lowerBounds); /** * @notice Used to get the upper bound * @return Upper bound */ - function upperSTVersionBounds() external view returns(uint8[] memory upperBounds); + function getUpperSTVersionBounds() external view returns(uint8[] memory upperBounds); /** * @notice Updates the tags of the ModuleFactory diff --git a/contracts/interfaces/IModuleRegistry.sol b/contracts/interfaces/IModuleRegistry.sol index 44785c074..63129a499 100644 --- a/contracts/interfaces/IModuleRegistry.sol +++ b/contracts/interfaces/IModuleRegistry.sol @@ -27,6 +27,12 @@ interface IModuleRegistry { event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + /** + * @notice Called by a security token (2.x) to notify the registry it is using a module + * @param _moduleFactory is the address of the relevant module factory + */ + function useModule(address _moduleFactory) external; + /** * @notice Called by a security token to notify the registry it is using a module * @param _moduleFactory is the address of the relevant module factory diff --git a/contracts/interfaces/ISTFactory.sol b/contracts/interfaces/ISTFactory.sol index a2b911f9d..66fbb1c6b 100644 --- a/contracts/interfaces/ISTFactory.sol +++ b/contracts/interfaces/ISTFactory.sol @@ -23,7 +23,6 @@ interface ISTFactory { * @param _issuer is the owner of the Security Token * @param _divisible whether the token is divisible or not * @param _treasuryWallet Ethereum address which will holds the STs. - * @param _polymathRegistry is the address of the Polymath Registry contract */ function deployToken( string calldata _name, @@ -32,10 +31,9 @@ interface ISTFactory { string calldata _tokenDetails, address _issuer, bool _divisible, - address _treasuryWallet, - address _polymathRegistry - ) - external + address _treasuryWallet //In v2.x this is the Polymath Registry + ) + external returns(address tokenAddress); /** diff --git a/contracts/interfaces/ISecurityTokenRegistry.sol b/contracts/interfaces/ISecurityTokenRegistry.sol index 225b3c13c..eae9ea019 100644 --- a/contracts/interfaces/ISecurityTokenRegistry.sol +++ b/contracts/interfaces/ISecurityTokenRegistry.sol @@ -24,7 +24,7 @@ interface ISecurityTokenRegistry { // Emit when ownership of the ticker gets changed event ChangeTickerOwnership(string _ticker, address indexed _oldOwner, address indexed _newOwner); // Emit at the time of launching a new security token of version 3.0+ - event NewSecurityTokenCreated( + event NewSecurityToken( string _ticker, string _name, address indexed _securityTokenAddress, @@ -244,8 +244,7 @@ interface ISecurityTokenRegistry { string memory tokenSymbol, address tokenAddress, string memory tokenDetails, - uint256 tokenTime, - uint8[] memory tokenVersion + uint256 tokenTime ); /** diff --git a/contracts/mocks/MockFactory.sol b/contracts/mocks/MockFactory.sol index f989d3b4f..de39c0c2e 100644 --- a/contracts/mocks/MockFactory.sol +++ b/contracts/mocks/MockFactory.sol @@ -29,7 +29,7 @@ contract MockFactory is DummySTOFactory { /** * @notice Type of the Module factory */ - function types() external view returns(uint8[] memory) { + function getTypes() external view returns(uint8[] memory) { if (!typesSwitch) { uint8[] memory res = new uint8[](0); return res; diff --git a/contracts/mocks/MockWrongTypeFactory.sol b/contracts/mocks/MockWrongTypeFactory.sol index 027d8ac14..f8289423f 100644 --- a/contracts/mocks/MockWrongTypeFactory.sol +++ b/contracts/mocks/MockWrongTypeFactory.sol @@ -28,7 +28,7 @@ contract MockWrongTypeFactory is MockBurnFactory { /** * @notice Type of the Module factory */ - function types() external view returns(uint8[] memory) { + function getTypes() external view returns(uint8[] memory) { uint8[] memory res = new uint8[](1); res[0] = 4; return res; diff --git a/contracts/mocks/TestSTOFactory.sol b/contracts/mocks/TestSTOFactory.sol index 57aab7976..d678307c3 100644 --- a/contracts/mocks/TestSTOFactory.sol +++ b/contracts/mocks/TestSTOFactory.sol @@ -28,7 +28,7 @@ contract TestSTOFactory is DummySTOFactory { /** * @notice Gets the tags related to the module factory */ - function tags() external view returns(bytes32[] memory) { + function getTags() external view returns(bytes32[] memory) { bytes32[] memory availableTags = new bytes32[](4); availableTags[0] = "Test"; availableTags[1] = "Non-refundable"; diff --git a/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpoint.sol b/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpoint.sol index cbb02e19f..d17d9cd95 100644 --- a/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpoint.sol +++ b/contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpoint.sol @@ -53,7 +53,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint { withPerm(ADMIN) { uint256 startTime = now; - uint256 checkpointId = ISecurityToken(securityToken).createCheckpoint(); + uint256 checkpointId = securityToken.createCheckpoint(); _createBallotWithCheckpoint(_commitDuration, _revealDuration, _noOfProposals, _quorumPercentage, checkpointId, startTime); } @@ -78,7 +78,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint { withPerm(ADMIN) { // validate the checkpointId, It should be less than or equal to the current checkpointId of the securityToken - require(_checkpointId <= ISecurityToken(securityToken).currentCheckpointId(), "Invalid checkpoint Id"); + require(_checkpointId <= securityToken.currentCheckpointId(), "Invalid checkpoint Id"); _createBallotWithCheckpoint(_commitDuration, _revealDuration, _noOfProposals, _quorumPercentage, _checkpointId, _startTime); } @@ -140,7 +140,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint { require(ballot.investorToProposal[msg.sender].secretVote == bytes32(0), "Already voted"); require(ballot.isActive, "Inactive ballot"); // Get the balance of the voter (i.e `msg.sender`) at the checkpoint on which ballot was created. - uint256 weight = ISecurityToken(securityToken).balanceOfAt(msg.sender, ballot.checkpointId); + uint256 weight = securityToken.balanceOfAt(msg.sender, ballot.checkpointId); require(weight > 0, "Zero weight is not allowed"); // Update the storage value. Assigned `0` as vote option it will be updated when voter reveals its vote. ballot.investorToProposal[msg.sender] = Vote(0, _secretVote); @@ -170,7 +170,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint { "Invalid vote" ); // Get the balance of the voter (i.e `msg.sender`) at the checkpoint on which ballot was created. - uint256 weight = ISecurityToken(securityToken).balanceOfAt(msg.sender, ballot.checkpointId); + uint256 weight = securityToken.balanceOfAt(msg.sender, ballot.checkpointId); bytes32 secretVote = ballot.investorToProposal[msg.sender].secretVote; // update the storage values ballot.proposalToVotes[_choiceOfProposal] = ballot.proposalToVotes[_choiceOfProposal].add(weight); @@ -283,7 +283,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint { uint256 i = 0; uint256 counter = 0; uint256 maxWeight = 0; - uint256 supplyAtCheckpoint = ISecurityToken(securityToken).totalSupplyAt(ballot.checkpointId); + uint256 supplyAtCheckpoint = securityToken.totalSupplyAt(ballot.checkpointId); uint256 quorumWeight = (supplyAtCheckpoint.mul(ballot.quorum)).div(10 ** 18); voteWeighting = new uint256[](ballot.totalProposals); for (i = 0; i < ballot.totalProposals; i++) { @@ -342,7 +342,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint { Ballot memory ballot = ballots[_ballotId]; return ( ballot.quorum, - ISecurityToken(securityToken).totalSupplyAt(ballot.checkpointId), + securityToken.totalSupplyAt(ballot.checkpointId), ballot.checkpointId, ballot.startTime, (uint256(ballot.startTime).add(uint256(ballot.commitDuration))).add(uint256(ballot.revealDuration)), diff --git a/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol b/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol index 78b21c85b..3eeffb49c 100644 --- a/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol +++ b/contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol @@ -57,6 +57,7 @@ contract ScheduledCheckpoint is ICheckpoint, TransferManager { */ function addSchedule(bytes32 _name, uint256 _startTime, uint256 _interval, TimeUnit _timeUnit) external { _onlySecurityTokenOwner(); + require(_name != bytes32(""), "Empty name"); require(_startTime > now, "Start time must be in the future"); require(schedules[_name].name == bytes32(0), "Name already in use"); schedules[_name].name = _name; @@ -75,6 +76,7 @@ contract ScheduledCheckpoint is ICheckpoint, TransferManager { */ function removeSchedule(bytes32 _name) external { _onlySecurityTokenOwner(); + require(_name != bytes32(""), "Empty name"); require(schedules[_name].name == _name, "Name does not exist"); uint256 index = schedules[_name].index; names[index] = names[names.length - 1]; diff --git a/contracts/modules/ModuleFactory.sol b/contracts/modules/ModuleFactory.sol index 7ed4dc24e..260a5d151 100644 --- a/contracts/modules/ModuleFactory.sol +++ b/contracts/modules/ModuleFactory.sol @@ -50,14 +50,14 @@ contract ModuleFactory is IModuleFactory, Ownable { /** * @notice Type of the Module factory */ - function types() external view returns(uint8[] memory) { + function getTypes() external view returns(uint8[] memory) { return typesData; } /** * @notice Get the tags related to the module factory */ - function tags() external view returns(bytes32[] memory) { + function getTags() external view returns(bytes32[] memory) { return tagsData; } @@ -154,7 +154,7 @@ contract ModuleFactory is IModuleFactory, Ownable { * @notice Used to get the lower bound * @return lower bound */ - function lowerSTVersionBounds() external view returns(uint8[] memory) { + function getLowerSTVersionBounds() external view returns(uint8[] memory) { return VersionUtils.unpack(compatibleSTVersionRange["lowerBound"]); } @@ -162,7 +162,7 @@ contract ModuleFactory is IModuleFactory, Ownable { * @notice Used to get the upper bound * @return upper bound */ - function upperSTVersionBounds() external view returns(uint8[] memory) { + function getUpperSTVersionBounds() external view returns(uint8[] memory) { return VersionUtils.unpack(compatibleSTVersionRange["upperBound"]); } diff --git a/contracts/modules/TransferManager/TransferManager.sol b/contracts/modules/TransferManager/TransferManager.sol index 54607cca5..d091669df 100644 --- a/contracts/modules/TransferManager/TransferManager.sol +++ b/contracts/modules/TransferManager/TransferManager.sol @@ -26,7 +26,7 @@ contract TransferManager is ITransferManager, Module { */ function getTokensByPartition(bytes32 _partition, address _tokenHolder, uint256 /*_additionalBalance*/) external view returns(uint256) { if (_partition == UNLOCKED) - return ISecurityToken(securityToken).balanceOf(_tokenHolder); + return securityToken.balanceOf(_tokenHolder); return uint256(0); } diff --git a/contracts/tokens/STFactory.sol b/contracts/tokens/STFactory.sol index 2f01f7e96..22c88af01 100644 --- a/contracts/tokens/STFactory.sol +++ b/contracts/tokens/STFactory.sol @@ -80,8 +80,7 @@ contract STFactory is ISTFactory, Ownable { string calldata _tokenDetails, address _issuer, bool _divisible, - address _treasuryWallet, - address /* _polymathRegistry */ + address _treasuryWallet ) external returns(address) @@ -122,7 +121,6 @@ contract STFactory is ISTFactory, Ownable { address(polymathRegistry) ); // Sets logic contract - emit Log(latestUpgrade); proxy.upgradeTo(logicContracts[latestUpgrade].version, logicContracts[latestUpgrade].logicContract); // Initialises security token contract - needed for functions that can only be called by the // owner of the contract, or are specific to this particular logic contract (e.g. setting version) @@ -132,8 +130,6 @@ contract STFactory is ISTFactory, Ownable { return address(proxy); } - event Log(uint256 _upgrade); - /** * @notice Used to set a new token logic contract * @param _version Version of upgraded module diff --git a/contracts/tokens/SecurityToken.sol b/contracts/tokens/SecurityToken.sol index e4a5ffa7f..a624fb6e1 100644 --- a/contracts/tokens/SecurityToken.sol +++ b/contracts/tokens/SecurityToken.sol @@ -198,7 +198,7 @@ contract SecurityToken is ERC20, ReentrancyGuard, SecurityTokenStorage, IERC1594 //Check that the module factory exists in the ModuleRegistry - will throw otherwise moduleRegistry.useModule(_moduleFactory, false); IModuleFactory moduleFactory = IModuleFactory(_moduleFactory); - uint8[] memory moduleTypes = moduleFactory.types(); + uint8[] memory moduleTypes = moduleFactory.getTypes(); uint256 moduleCost = moduleFactory.setupCostInPoly(); require(moduleCost <= _maxCost, "Invalid cost"); //Approve fee for module diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index bad99d981..512f10fcd 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -917,7 +917,7 @@ contract("CappedSTO", async (accounts) => { it("should get the exact details of the factory", async () => { assert.equal((await I_CappedSTOFactory.setupCost.call()).toString(), cappedSTOSetupCost.toString()); assert.equal((await I_CappedSTOFactory.setupCostInPoly.call()).toString(), cappedSTOSetupCostPOLY.toString()); - assert.equal((await I_CappedSTOFactory.types.call())[0], 3); + assert.equal((await I_CappedSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_CappedSTOFactory.name.call()), "CappedSTO", "Wrong Module added"); assert.equal( await I_CappedSTOFactory.description.call(), @@ -925,7 +925,7 @@ contract("CappedSTO", async (accounts) => { "Wrong Module added" ); assert.equal(await I_CappedSTOFactory.title.call(), "Capped STO", "Wrong Module added"); - let tags = await I_CappedSTOFactory.tags.call(); + let tags = await I_CappedSTOFactory.getTags.call(); assert.equal(web3.utils.hexToString(tags[0]), "Capped"); assert.equal(await I_CappedSTOFactory.version.call(), "3.0.0"); }); diff --git a/test/d_count_transfer_manager.js b/test/d_count_transfer_manager.js index 23c8bd23a..ce75377a6 100644 --- a/test/d_count_transfer_manager.js +++ b/test/d_count_transfer_manager.js @@ -585,7 +585,7 @@ contract("CountTransferManager", async (accounts) => { describe("Test cases for the factory", async () => { it("should get the exact details of the factory", async () => { assert.equal(await I_CountTransferManagerFactory.setupCost.call(), 0); - assert.equal((await I_CountTransferManagerFactory.types.call())[0], 2); + assert.equal((await I_CountTransferManagerFactory.getTypes.call())[0], 2); assert.equal( web3.utils.toAscii(await I_CountTransferManagerFactory.name.call()).replace(/\u0000/g, ""), "CountTransferManager", @@ -600,7 +600,7 @@ contract("CountTransferManager", async (accounts) => { }); it("Should get the tags of the factory", async () => { - let tags = await I_CountTransferManagerFactory.tags.call(); + let tags = await I_CountTransferManagerFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ""), "Count"); }); }); diff --git a/test/e_erc20_dividends.js b/test/e_erc20_dividends.js index d54a52abc..d73c07166 100644 --- a/test/e_erc20_dividends.js +++ b/test/e_erc20_dividends.js @@ -1274,7 +1274,7 @@ contract("ERC20DividendCheckpoint", async (accounts) => { describe("Test cases for the ERC20DividendCheckpointFactory", async () => { it("should get the exact details of the factory", async () => { assert.equal((await I_ERC20DividendCheckpointFactory.setupCost.call()).toNumber(), 0); - assert.equal((await I_ERC20DividendCheckpointFactory.types.call())[0], 4); + assert.equal((await I_ERC20DividendCheckpointFactory.getTypes.call())[0], 4); assert.equal(await I_ERC20DividendCheckpointFactory.version.call(), "3.0.0"); assert.equal( web3.utils.toAscii(await I_ERC20DividendCheckpointFactory.name.call()).replace(/\u0000/g, ""), @@ -1287,7 +1287,7 @@ contract("ERC20DividendCheckpoint", async (accounts) => { "Wrong Module added" ); assert.equal(await I_ERC20DividendCheckpointFactory.title.call(), "ERC20 Dividend Checkpoint", "Wrong Module added"); - let tags = await I_ERC20DividendCheckpointFactory.tags.call(); + let tags = await I_ERC20DividendCheckpointFactory.getTags.call(); assert.equal(tags.length, 3); }); }); diff --git a/test/f_ether_dividends.js b/test/f_ether_dividends.js index 15f71b2c6..374092bd8 100644 --- a/test/f_ether_dividends.js +++ b/test/f_ether_dividends.js @@ -996,7 +996,7 @@ contract("EtherDividendCheckpoint", async (accounts) => { describe("Test cases for the EtherDividendCheckpointFactory", async () => { it("should get the exact details of the factory", async () => { assert.equal((await I_EtherDividendCheckpointFactory.setupCost.call()).toNumber(), 0); - assert.equal((await I_EtherDividendCheckpointFactory.types.call())[0], 4); + assert.equal((await I_EtherDividendCheckpointFactory.getTypes.call())[0], 4); assert.equal(await I_EtherDividendCheckpointFactory.version.call(), "3.0.0"); assert.equal( web3.utils.toAscii(await I_EtherDividendCheckpointFactory.name.call()).replace(/\u0000/g, ""), @@ -1009,7 +1009,7 @@ contract("EtherDividendCheckpoint", async (accounts) => { "Wrong Module added" ); assert.equal(await I_EtherDividendCheckpointFactory.title.call(), "Ether Dividend Checkpoint", "Wrong Module added"); - let tags = await I_EtherDividendCheckpointFactory.tags.call(); + let tags = await I_EtherDividendCheckpointFactory.getTags.call(); assert.equal(tags.length, 3); }); }); diff --git a/test/g_general_permission_manager.js b/test/g_general_permission_manager.js index 95b9edadb..77b2a37b0 100644 --- a/test/g_general_permission_manager.js +++ b/test/g_general_permission_manager.js @@ -474,7 +474,7 @@ contract("GeneralPermissionManager", async (accounts) => { describe("General Permission Manager Factory test cases", async () => { it("should get the exact details of the factory", async () => { assert.equal(await I_GeneralPermissionManagerFactory.setupCost.call(), 0); - assert.equal((await I_GeneralPermissionManagerFactory.types.call())[0], 1); + assert.equal((await I_GeneralPermissionManagerFactory.getTypes.call())[0], 1); assert.equal(await I_GeneralPermissionManagerFactory.version.call(), "3.0.0"); assert.equal( web3.utils.toAscii(await I_GeneralPermissionManagerFactory.name.call()).replace(/\u0000/g, ""), @@ -490,7 +490,7 @@ contract("GeneralPermissionManager", async (accounts) => { }); it("Should get the tags of the factory", async () => { - let tags = await I_GeneralPermissionManagerFactory.tags.call(); + let tags = await I_GeneralPermissionManagerFactory.getTags.call(); assert.equal(web3.utils.toUtf8(tags[0]), "Permission Management"); }); diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index bf5119957..3b156fd97 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -1253,7 +1253,7 @@ contract("GeneralTransferManager", async (accounts) => { describe("General Transfer Manager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { assert.equal(await I_GeneralTransferManagerFactory.setupCost.call(), 0); - assert.equal((await I_GeneralTransferManagerFactory.types.call())[0], 2); + assert.equal((await I_GeneralTransferManagerFactory.getTypes.call())[0], 2); assert.equal( web3.utils.toAscii(await I_GeneralTransferManagerFactory.name.call()).replace(/\u0000/g, ""), "GeneralTransferManager", @@ -1269,7 +1269,7 @@ contract("GeneralTransferManager", async (accounts) => { }); it("Should get the tags of the factory", async () => { - let tags = await I_GeneralTransferManagerFactory.tags.call(); + let tags = await I_GeneralTransferManagerFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ""), "General"); }); }); @@ -1277,7 +1277,7 @@ contract("GeneralTransferManager", async (accounts) => { describe("Dummy STO Factory test cases", async () => { it("should get the exact details of the factory", async () => { assert.equal(await I_DummySTOFactory.setupCost.call(), 0); - assert.equal((await I_DummySTOFactory.types.call())[0], 3); + assert.equal((await I_DummySTOFactory.getTypes.call())[0], 3); assert.equal( web3.utils.toAscii(await I_DummySTOFactory.name.call()).replace(/\u0000/g, ""), "DummySTO", @@ -1288,7 +1288,7 @@ contract("GeneralTransferManager", async (accounts) => { }); it("Should get the tags of the factory", async () => { - let tags = await I_DummySTOFactory.tags.call(); + let tags = await I_DummySTOFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ""), "Dummy"); }); diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index 53bd88dc4..344f30cf3 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -811,7 +811,7 @@ contract("ManualApprovalTransferManager", accounts => { describe("ManualApproval Transfer Manager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { assert.equal(await I_ManualApprovalTransferManagerFactory.setupCost.call(), 0); - assert.equal((await I_ManualApprovalTransferManagerFactory.types.call())[0], 2); + assert.equal((await I_ManualApprovalTransferManagerFactory.getTypes.call())[0], 2); let name = web3.utils.toUtf8(await I_ManualApprovalTransferManagerFactory.name.call()); assert.equal(name, "ManualApprovalTransferManager", "Wrong Module added"); let desc = await I_ManualApprovalTransferManagerFactory.description.call(); @@ -822,7 +822,7 @@ contract("ManualApprovalTransferManager", accounts => { }); it("Should get the tags of the factory", async () => { - let tags = await I_ManualApprovalTransferManagerFactory.tags.call(); + let tags = await I_ManualApprovalTransferManagerFactory.getTags.call(); assert.equal(web3.utils.toUtf8(tags[0]), "Manual Approval"); assert.equal(web3.utils.toUtf8(tags[1]), "Transfer Restriction"); }); diff --git a/test/k_module_registry.js b/test/k_module_registry.js index 5bc4cb70d..1ceda46d5 100644 --- a/test/k_module_registry.js +++ b/test/k_module_registry.js @@ -266,6 +266,7 @@ contract("ModuleRegistry", async (accounts) => { 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), I_CappedSTOLogic.address, I_PolymathRegistry.address, true, { from: account_temp }); + console.log(await I_MRProxied.owner()); catchRevert(I_MRProxied.registerModule(I_CappedSTOFactory3.address, { from: token_owner })); }); @@ -391,7 +392,7 @@ contract("ModuleRegistry", async (accounts) => { // Taking the snapshot the revert the changes from here let id = await takeSnapshot(); await I_TestSTOFactory.changeSTVersionBounds("lowerBound", [3, 1, 0], { from: account_polymath }); - let _lstVersion = await I_TestSTOFactory.lowerSTVersionBounds.call(); + let _lstVersion = await I_TestSTOFactory.getLowerSTVersionBounds.call(); assert.equal(_lstVersion[0], 3); assert.equal(_lstVersion[1], 1); assert.equal(_lstVersion[2], 0); @@ -406,7 +407,7 @@ contract("ModuleRegistry", async (accounts) => { it("Should failed in adding the TestSTOFactory module because not compatible with the current protocol version --upper", async () => { await I_TestSTOFactory.changeSTVersionBounds("upperBound", [0, new BN(0), 1], { from: account_polymath }); - let _ustVersion = await I_TestSTOFactory.upperSTVersionBounds.call(); + let _ustVersion = await I_TestSTOFactory.getUpperSTVersionBounds.call(); assert.equal(_ustVersion[0], 0); assert.equal(_ustVersion[2], 1); await I_STRProxied.setProtocolFactory(I_STFactory.address, 2, new BN(0), 1); @@ -420,7 +421,6 @@ contract("ModuleRegistry", async (accounts) => { assert.equal(tx.logs[1].args._ticker, newSymbol.toUpperCase()); I_SecurityToken2 = await SecurityToken.at(tx.logs[1].args._securityTokenAddress); stGetter = await STGetter.at(I_SecurityToken2.address); - assert.equal(await stGetter.getTreasuryWallet.call(), account_issuer, "Incorrect wallet set") let bytesData = encodeModuleCall( ["uint256", "uint256", "uint256", "string"], [await latestTime(), currentTime.add(new BN(duration.days(1))), cap, "Test STO"] diff --git a/test/l_percentage_transfer_manager.js b/test/l_percentage_transfer_manager.js index 05e1c1e3e..ef3aaca48 100644 --- a/test/l_percentage_transfer_manager.js +++ b/test/l_percentage_transfer_manager.js @@ -423,7 +423,7 @@ contract("PercentageTransferManager", async (accounts) => { describe("Percentage Transfer Manager Factory test cases", async () => { it("Should get the exact details of the factory", async () => { assert.equal(await I_PercentageTransferManagerFactory.setupCost.call(), 0); - assert.equal((await I_PercentageTransferManagerFactory.types.call())[0], 2); + assert.equal((await I_PercentageTransferManagerFactory.getTypes.call())[0], 2); assert.equal( web3.utils.toAscii(await I_PercentageTransferManagerFactory.name.call()).replace(/\u0000/g, ""), "PercentageTransferManager", @@ -439,7 +439,7 @@ contract("PercentageTransferManager", async (accounts) => { }); it("Should get the tags of the factory", async () => { - let tags = await I_PercentageTransferManagerFactory.tags.call(); + let tags = await I_PercentageTransferManagerFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ""), "Percentage"); }); }); diff --git a/test/m_presale_sto.js b/test/m_presale_sto.js index de863d496..f6c4ddbba 100644 --- a/test/m_presale_sto.js +++ b/test/m_presale_sto.js @@ -438,7 +438,7 @@ contract("PreSaleSTO", async (accounts) => { describe("Test cases for the PresaleSTOFactory", async () => { it("should get the exact details of the factory", async () => { assert.equal(await I_PreSaleSTOFactory.setupCost.call(), 0); - assert.equal((await I_PreSaleSTOFactory.types.call())[0], 3); + assert.equal((await I_PreSaleSTOFactory.getTypes.call())[0], 3); assert.equal( web3.utils.toAscii(await I_PreSaleSTOFactory.name.call()).replace(/\u0000/g, ""), "PreSaleSTO", @@ -450,7 +450,7 @@ contract("PreSaleSTO", async (accounts) => { "Wrong Module added" ); assert.equal(await I_PreSaleSTOFactory.title.call(), "PreSale STO", "Wrong Module added"); - let tags = await I_PreSaleSTOFactory.tags.call(); + let tags = await I_PreSaleSTOFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ""), "PreSale"); }); }); diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index ac27f4ba2..d5aefc327 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -4778,7 +4778,7 @@ contract("USDTieredSTO", async (accounts) => { describe("Test cases for the USDTieredSTOFactory", async () => { it("should get the exact details of the factory", async () => { assert.equal((await I_USDTieredSTOFactory.setupCost.call()).toString(), STOSetupCost); - assert.equal((await I_USDTieredSTOFactory.types.call())[0], 3); + assert.equal((await I_USDTieredSTOFactory.getTypes.call())[0], 3); assert.equal(web3.utils.hexToString(await I_USDTieredSTOFactory.name.call()), "USDTieredSTO", "Wrong Module added"); assert.equal( await I_USDTieredSTOFactory.description.call(), @@ -4787,7 +4787,7 @@ contract("USDTieredSTO", async (accounts) => { ); assert.equal(await I_USDTieredSTOFactory.title.call(), "USD Tiered STO", "Wrong Module added"); assert.equal(await I_USDTieredSTOFactory.version.call(), "3.0.0"); - let tags = await I_USDTieredSTOFactory.tags.call(); + let tags = await I_USDTieredSTOFactory.getTags.call(); assert.equal(web3.utils.hexToString(tags[0]), "Tiered"); assert.equal(web3.utils.hexToString(tags[1]), "ETH"); assert.equal(web3.utils.hexToString(tags[2]), "POLY"); diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index 9c2e62040..bb00302e9 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -278,7 +278,7 @@ contract("TrackedRedemption", async (accounts) => { describe("Test cases for the TrackedRedemptionFactory", async () => { it("should get the exact details of the factory", async () => { assert.equal((await I_TrackedRedemptionFactory.setupCost.call()).toNumber(), 0); - assert.equal((await I_TrackedRedemptionFactory.types.call())[0], 5); + assert.equal((await I_TrackedRedemptionFactory.getTypes.call())[0], 5); assert.equal(await I_TrackedRedemptionFactory.version.call(), "3.0.0"); assert.equal( web3.utils.toAscii(await I_TrackedRedemptionFactory.name.call()).replace(/\u0000/g, ""), @@ -287,7 +287,7 @@ contract("TrackedRedemption", async (accounts) => { ); assert.equal(await I_TrackedRedemptionFactory.description.call(), "Track token redemptions", "Wrong Module added"); assert.equal(await I_TrackedRedemptionFactory.title.call(), "Tracked Redemption", "Wrong Module added"); - let tags = await I_TrackedRedemptionFactory.tags.call(); + let tags = await I_TrackedRedemptionFactory.getTags.call(); assert.equal(tags.length, 2); }); }); diff --git a/test/w_lockup_transfer_manager.js b/test/w_lockup_transfer_manager.js index a799206be..4c0b48bf4 100644 --- a/test/w_lockup_transfer_manager.js +++ b/test/w_lockup_transfer_manager.js @@ -998,7 +998,7 @@ contract('LockUpTransferManager', accounts => { it("Should get the exact details of the factory", async() => { assert.equal(await I_LockUpTransferManagerFactory.setupCost.call(),0); - assert.equal((await I_LockUpTransferManagerFactory.types.call())[0],2); + assert.equal((await I_LockUpTransferManagerFactory.getTypes.call())[0],2); assert.equal(web3.utils.toAscii(await I_LockUpTransferManagerFactory.name.call()) .replace(/\u0000/g, ''), "LockUpTransferManager", @@ -1013,7 +1013,7 @@ contract('LockUpTransferManager', accounts => { }); it("Should get the tags of the factory", async() => { - let tags = await I_LockUpTransferManagerFactory.tags.call(); + let tags = await I_LockUpTransferManagerFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ''), "LockUp"); }); }); diff --git a/test/y_volume_restriction_tm.js b/test/y_volume_restriction_tm.js index dac5da999..f02f5f38e 100644 --- a/test/y_volume_restriction_tm.js +++ b/test/y_volume_restriction_tm.js @@ -1960,7 +1960,7 @@ contract('VolumeRestrictionTransferManager', accounts => { it("Should get the exact details of the factory", async() => { assert.equal(await I_VolumeRestrictionTMFactory.setupCost.call(),0); - assert.equal((await I_VolumeRestrictionTMFactory.types.call())[0],2); + assert.equal((await I_VolumeRestrictionTMFactory.getTypes.call())[0],2); assert.equal(web3.utils.toAscii(await I_VolumeRestrictionTMFactory.name.call()) .replace(/\u0000/g, ''), "VolumeRestrictionTM", @@ -1975,7 +1975,7 @@ contract('VolumeRestrictionTransferManager', accounts => { }); it("Should get the tags of the factory", async() => { - let tags = await I_VolumeRestrictionTMFactory.tags.call(); + let tags = await I_VolumeRestrictionTMFactory.getTags.call(); assert.equal(tags.length, 3); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ''), "Rolling Period"); }); diff --git a/test/z_blacklist_transfer_manager.js b/test/z_blacklist_transfer_manager.js index a22472b16..63057fe18 100644 --- a/test/z_blacklist_transfer_manager.js +++ b/test/z_blacklist_transfer_manager.js @@ -1018,7 +1018,7 @@ contract('BlacklistTransferManager', accounts => { describe("Test cases for the factory", async() => { it("Should get the exact details of the factory", async() => { assert.equal(await I_BlacklistTransferManagerFactory.setupCost.call(),0); - assert.equal((await I_BlacklistTransferManagerFactory.types.call())[0],2); + assert.equal((await I_BlacklistTransferManagerFactory.getTypes.call())[0],2); assert.equal(web3.utils.toAscii(await I_BlacklistTransferManagerFactory.name.call()) .replace(/\u0000/g, ''), "BlacklistTransferManager", @@ -1036,7 +1036,7 @@ contract('BlacklistTransferManager', accounts => { }); it("Should get the tags of the factory", async() => { - let tags = await I_BlacklistTransferManagerFactory.tags.call(); + let tags = await I_BlacklistTransferManagerFactory.getTags.call(); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ''),"Blacklist"); }); }); diff --git a/test/z_vesting_escrow_wallet.js b/test/z_vesting_escrow_wallet.js index a93c10845..573963162 100644 --- a/test/z_vesting_escrow_wallet.js +++ b/test/z_vesting_escrow_wallet.js @@ -290,7 +290,7 @@ contract('VestingEscrowWallet', accounts => { }); it("Should get the tags of the factory", async () => { - let tags = await I_VestingEscrowWalletFactory.tags.call(); + let tags = await I_VestingEscrowWalletFactory.getTags.call(); assert.equal(tags.length, 3); assert.equal(web3.utils.toAscii(tags[0]).replace(/\u0000/g, ""), "Vesting"); assert.equal(web3.utils.toAscii(tags[1]).replace(/\u0000/g, ""), "Escrow"); diff --git a/test/zc_plcr_voting_checkpoint.js b/test/zc_plcr_voting_checkpoint.js index cc5753a4e..5e5585715 100644 --- a/test/zc_plcr_voting_checkpoint.js +++ b/test/zc_plcr_voting_checkpoint.js @@ -711,7 +711,7 @@ contract("PLCRVotingCheckpoint", async (accounts) => { describe("\t\t Factory test cases \n", async() => { it("\t\t Should get the exact details of the factory \n", async () => { assert.equal((await I_PLCRVotingCheckpointFactory.setupCost.call()).toNumber(), 0); - assert.equal((await I_PLCRVotingCheckpointFactory.types.call())[0], 4); + assert.equal((await I_PLCRVotingCheckpointFactory.getTypes.call())[0], 4); assert.equal(await I_PLCRVotingCheckpointFactory.version.call(), "3.0.0"); assert.equal( web3.utils.toAscii(await I_PLCRVotingCheckpointFactory.name.call()).replace(/\u0000/g, ""), @@ -724,7 +724,7 @@ contract("PLCRVotingCheckpoint", async (accounts) => { "Wrong Module added" ); assert.equal(await I_PLCRVotingCheckpointFactory.title.call(), "PLCR Voting Checkpoint", "Wrong Module added"); - let tags = await I_PLCRVotingCheckpointFactory.tags.call(); + let tags = await I_PLCRVotingCheckpointFactory.getTags.call(); assert.equal(tags.length, 3); }); }); diff --git a/test/zd_weighted_vote_checkpoint.js b/test/zd_weighted_vote_checkpoint.js index 5cdf4c423..0f32d1f48 100644 --- a/test/zd_weighted_vote_checkpoint.js +++ b/test/zd_weighted_vote_checkpoint.js @@ -503,7 +503,7 @@ contract("WeightedVoteCheckpoint", async (accounts) => { describe("\t\t Factory test cases \n", async() => { it("\t\t Should get the exact details of the factory \n", async () => { assert.equal((await I_WeightedVoteCheckpointFactory.setupCost.call()).toNumber(), 0); - assert.equal((await I_WeightedVoteCheckpointFactory.types.call())[0], 4); + assert.equal((await I_WeightedVoteCheckpointFactory.getTypes.call())[0], 4); assert.equal(await I_WeightedVoteCheckpointFactory.version.call(), "3.0.0"); assert.equal( web3.utils.toAscii(await I_WeightedVoteCheckpointFactory.name.call()).replace(/\u0000/g, ""), @@ -516,7 +516,7 @@ contract("WeightedVoteCheckpoint", async (accounts) => { "Wrong Module added" ); assert.equal(await I_WeightedVoteCheckpointFactory.title.call(), "Weighted Vote Checkpoint", "Wrong Module added"); - let tags = await I_WeightedVoteCheckpointFactory.tags.call(); + let tags = await I_WeightedVoteCheckpointFactory.getTags.call(); assert.equal(tags.length, 3); }); });