diff --git a/CHANGELOG.md b/CHANGELOG.md index f4bea021f..1caec4be2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ All notable changes to this project will be documented in this file. * Replaced `updatePolyTokenAddress()` function with `updateFromRegistry()` in `SecurityTokenRegistry`. * Migrate all the getters of `SecurityTokenRegsitry.sol` to `STRGetter.sol` contract. * Removed `_polyToken` parameter from `initialize` function in `SecurityTokenRegistry`. +* Allows an explicit token factory version to be used during creation of securityToken. +* Rename the `getProtocolVersion()` to `getLatestProtocolVersion()`. * Return SecurityToken version in the `getSecurityTokenData()` function. ## GeneralTransferManager diff --git a/contracts/STRGetter.sol b/contracts/STRGetter.sol index 86a889657..850820696 100644 --- a/contracts/STRGetter.sol +++ b/contracts/STRGetter.sol @@ -222,7 +222,7 @@ contract STRGetter is EternalStorage { /** * @notice Gets Protocol version */ - function getProtocolVersion() public view returns(uint8[] memory) { + function getLatestProtocolVersion() public view returns(uint8[] memory) { return VersionUtils.unpack(uint24(getUintValue(Encoder.getKey("latestVersion")))); } diff --git a/contracts/SecurityTokenRegistry.sol b/contracts/SecurityTokenRegistry.sol index 6d4fe713f..4cff717f0 100644 --- a/contracts/SecurityTokenRegistry.sol +++ b/contracts/SecurityTokenRegistry.sol @@ -104,7 +104,8 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { address _registrant, bool _fromAdmin, uint256 _usdFee, - uint256 _polyFee + uint256 _polyFee, + uint256 _protocolVersion ); // Emit after ticker registration event RegisterTicker( @@ -487,17 +488,26 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { * @param _ticker is the ticker symbol of the security token * @param _tokenDetails is the off-chain details of the token * @param _divisible is whether or not the token is divisible + * @param _protocolVersion Version of securityToken contract + * - `_protocolVersion` is the packed value of uin8[3] array (it will be calculated offchain) + * - if _protocolVersion == 0 then latest version of securityToken will be generated */ function generateSecurityToken( string calldata _name, string calldata _ticker, string calldata _tokenDetails, - bool _divisible + bool _divisible, + uint256 _protocolVersion ) external whenNotPausedOrOwner { + uint256 protocolVersion = _protocolVersion; require(bytes(_name).length > 0 && bytes(_ticker).length > 0, "Bad ticker"); + if (_protocolVersion == 0) { + protocolVersion = getUintValue(Encoder.getKey("latestVersion")); + } + require(protocolVersion != uint256(0), "Invalid version"); string memory ticker = Util.upper(_ticker); bytes32 statusKey = Encoder.getKey("registeredTickers_status", ticker); require(!getBoolValue(statusKey), "Already deployed"); @@ -505,23 +515,37 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { require(_tickerOwner(ticker) == msg.sender, "Not authorised"); /*solium-disable-next-line security/no-block-members*/ require(getUintValue(Encoder.getKey("registeredTickers_expiryDate", ticker)) >= now, "Ticker expired"); - (uint256 _usdFee, uint256 _polyFee) = _takeFee(STLAUNCHFEE); + _deployToken(_name, ticker, _tokenDetails, msg.sender, _divisible, protocolVersion); + } - address newSecurityTokenAddress = ISTFactory(getAddressValue(Encoder.getKey("protocolVersionST", getUintValue(Encoder.getKey("latestVersion"))))).deployToken( + function _deployToken( + string memory _name, + string memory _ticker, + string memory _tokenDetails, + address _issuer, + bool _divisible, + uint256 _protocolVersion + ) + internal + { + (uint256 _usdFee, uint256 _polyFee) = _takeFee(STLAUNCHFEE); + address newSecurityTokenAddress = ISTFactory(getAddressValue(Encoder.getKey("protocolVersionST", _protocolVersion))).deployToken( _name, - ticker, + _ticker, 18, _tokenDetails, - msg.sender, + _issuer, _divisible, getAddressValue(POLYMATHREGISTRY) ); /*solium-disable-next-line security/no-block-members*/ - _storeSecurityTokenData(newSecurityTokenAddress, ticker, _tokenDetails, now); - set(Encoder.getKey("tickerToSecurityToken", ticker), newSecurityTokenAddress); + _storeSecurityTokenData(newSecurityTokenAddress, _ticker, _tokenDetails, now); + set(Encoder.getKey("tickerToSecurityToken", _ticker), newSecurityTokenAddress); /*solium-disable-next-line security/no-block-members*/ - emit NewSecurityToken(ticker, _name, newSecurityTokenAddress, msg.sender, now, msg.sender, false, _usdFee, _polyFee); + emit NewSecurityToken( + _ticker, _name, newSecurityTokenAddress, msg.sender, now, msg.sender, false, _usdFee, _polyFee, _protocolVersion + ); } /** @@ -543,7 +567,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { ) external onlyOwner - { + { require(bytes(_name).length > 0 && bytes(_ticker).length > 0, "Bad data"); require(bytes(_ticker).length <= 10, "Bad ticker"); require(_deployedAt != 0 && _owner != address(0), "Bad data"); @@ -559,7 +583,9 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { set(Encoder.getKey("tickerToSecurityToken", ticker), _securityToken); _modifyTicker(_owner, ticker, _name, registrationTime, expiryTime, true); _storeSecurityTokenData(_securityToken, ticker, _tokenDetails, _deployedAt); - emit NewSecurityToken(ticker, _name, _securityToken, _owner, _deployedAt, msg.sender, true, uint256(0), uint256(0)); + emit NewSecurityToken( + ticker, _name, _securityToken, _owner, _deployedAt, msg.sender, true, uint256(0), uint256(0), 0 + ); } /** diff --git a/contracts/interfaces/ISecurityTokenRegistry.sol b/contracts/interfaces/ISecurityTokenRegistry.sol index ce5486860..13b126f4b 100644 --- a/contracts/interfaces/ISecurityTokenRegistry.sol +++ b/contracts/interfaces/ISecurityTokenRegistry.sol @@ -5,13 +5,22 @@ pragma solidity ^0.5.0; */ interface ISecurityTokenRegistry { /** - * @notice Creates a new Security Token and saves it to the registry - * @param _name Name of the token - * @param _ticker Ticker ticker of the security token - * @param _tokenDetails Off-chain details of the token - * @param _divisible Whether the token is divisible or not - */ - function generateSecurityToken(string calldata _name, string calldata _ticker, string calldata _tokenDetails, bool _divisible) external; + * @notice Deploys an instance of a new Security Token and records it to the registry + * @param _name is the name of the token + * @param _ticker is the ticker symbol of the security token + * @param _tokenDetails is the off-chain details of the token + * @param _divisible is whether or not the token is divisible + * @param _protocolVersion Version of securityToken contract + * - `_protocolVersion` is the packed value of uin8[3] array (it will be calculated offchain) + * - if _protocolVersion == 0 then latest version of securityToken will be generated + */ + function generateSecurityToken( + string calldata _name, + string calldata _ticker, + string calldata _tokenDetails, + bool _divisible, + uint256 _protocolVersion + ) external; /** * @notice Adds a new custom Security Token and saves it to the registry. (Token should follow the ISecurityToken interface) diff --git a/contracts/mocks/STFactoryMock.sol b/contracts/mocks/STFactoryMock.sol new file mode 100644 index 000000000..046811a5b --- /dev/null +++ b/contracts/mocks/STFactoryMock.sol @@ -0,0 +1,52 @@ +pragma solidity ^0.5.0; + +import "./SecurityTokenMock.sol"; +import "../interfaces/ISTFactory.sol"; +import "../datastore/DataStoreFactory.sol"; + +/** + * @title Proxy for deploying SecurityToken instances + */ +contract STFactoryMock is ISTFactory { + address public transferManagerFactory; + address public stDelegate; + DataStoreFactory public dataStoreFactory; + + constructor(address _transferManagerFactory, address _dataStoreFactory, address _stDelegate) public { + transferManagerFactory = _transferManagerFactory; + dataStoreFactory = DataStoreFactory(_dataStoreFactory); + stDelegate = _stDelegate; + } + + /** + * @notice deploys the token and adds default modules like the GeneralTransferManager. + * Future versions of the proxy can attach different modules or pass different parameters. + */ + function deployToken( + string calldata _name, + string calldata _symbol, + uint8 _decimals, + string calldata _tokenDetails, + address _issuer, + bool _divisible, + address _polymathRegistry + ) + external + returns(address) + { + SecurityTokenMock newSecurityToken = new SecurityTokenMock( + _name, + _symbol, + _decimals, + _divisible ? 1 : uint256(10) ** _decimals, + _tokenDetails, + _polymathRegistry, + stDelegate + ); + //NB When dataStore is generated, the security token address is automatically set via the constructor in DataStoreProxy. + newSecurityToken.changeDataStore(dataStoreFactory.generateDataStore(address(newSecurityToken))); + newSecurityToken.addModule(transferManagerFactory, "", 0, 0); + newSecurityToken.transferOwnership(_issuer); + return address(newSecurityToken); + } +} diff --git a/contracts/mocks/SecurityTokenMock.sol b/contracts/mocks/SecurityTokenMock.sol new file mode 100644 index 000000000..3dd60d645 --- /dev/null +++ b/contracts/mocks/SecurityTokenMock.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.5.0; + +import "../tokens/SecurityToken.sol"; + +/** + * @title Security Token contract + * @notice SecurityToken is an ERC1400 token with added capabilities: + * @notice - Implements the ERC1400 Interface + * @notice - Transfers are restricted + * @notice - Modules can be attached to it to control its behaviour + * @notice - ST should not be deployed directly, but rather the SecurityTokenRegistry should be used + * @notice - ST does not inherit from ISecurityToken due to: + * @notice - https://github.com/ethereum/solidity/issues/4847 + */ +contract SecurityTokenMock is SecurityToken { + + /** + * @notice constructor + * @param _name Name of the SecurityToken + * @param _symbol Symbol of the Token + * @param _decimals Decimals for the securityToken + * @param _granularity granular level of the token + * @param _tokenDetails Details of the token that are stored off-chain + * @param _polymathRegistry Contract address of the polymath registry + * @param _delegate Contract address of the delegate + */ + constructor( + string memory _name, + string memory _symbol, + uint8 _decimals, + uint256 _granularity, + string memory _tokenDetails, + address _polymathRegistry, + address _delegate + ) + public + SecurityToken(_name, _symbol, _decimals, _granularity, _tokenDetails, _polymathRegistry,_delegate) + { + securityTokenVersion = SemanticVersion(2, 2, 0); + } + + +} diff --git a/contracts/tokens/SecurityToken.sol b/contracts/tokens/SecurityToken.sol index 4d15eb1d8..99aa375e9 100644 --- a/contracts/tokens/SecurityToken.sol +++ b/contracts/tokens/SecurityToken.sol @@ -16,7 +16,6 @@ import "../interfaces/ITransferManager.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; -import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; /** @@ -144,7 +143,7 @@ contract SecurityToken is ERC20, ERC20Detailed, Ownable, ReentrancyGuard, Securi delegate = _delegate; tokenDetails = _tokenDetails; granularity = _granularity; - securityTokenVersion = SemanticVersion(2, 0, 0); + securityTokenVersion = SemanticVersion(3, 0, 0); } /** diff --git a/test/b_capped_sto.js b/test/b_capped_sto.js index c2ca35e4d..faaae9fa6 100644 --- a/test/b_capped_sto.js +++ b/test/b_capped_sto.js @@ -174,7 +174,7 @@ contract("CappedSTO", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); @@ -622,7 +622,7 @@ contract("CappedSTO", async (accounts) => { it("POLY: Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(P_name, P_symbol, P_tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(P_name, P_symbol, P_tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, P_symbol, "SecurityToken doesn't get deployed"); diff --git a/test/c_checkpoints.js b/test/c_checkpoints.js index 6b3229c69..168e1e8e3 100644 --- a/test/c_checkpoints.js +++ b/test/c_checkpoints.js @@ -126,7 +126,7 @@ contract("Checkpoints", async function(accounts) { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/d_count_transfer_manager.js b/test/d_count_transfer_manager.js index a1d62ee1b..df51e6f53 100644 --- a/test/d_count_transfer_manager.js +++ b/test/d_count_transfer_manager.js @@ -143,7 +143,7 @@ contract("CountTransferManager", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); @@ -363,7 +363,7 @@ contract("CountTransferManager", async (accounts) => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx2 = await I_STRProxied.generateSecurityToken(name, symbol2, tokenDetails, false, { from: token_owner }); + let tx2 = await I_STRProxied.generateSecurityToken(name, symbol2, tokenDetails, false, 0, { from: token_owner }); I_SecurityToken2 = await SecurityToken.at(tx2.logs[2].args._securityTokenAddress); stGetter2 = await STGetter.at(I_SecurityToken2.address); diff --git a/test/e_erc20_dividends.js b/test/e_erc20_dividends.js index 9cd2d235e..7d2926df5 100644 --- a/test/e_erc20_dividends.js +++ b/test/e_erc20_dividends.js @@ -151,7 +151,7 @@ contract("ERC20DividendCheckpoint", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/f_ether_dividends.js b/test/f_ether_dividends.js index 440d91c86..06db4d8e0 100644 --- a/test/f_ether_dividends.js +++ b/test/f_ether_dividends.js @@ -144,7 +144,7 @@ contract("EtherDividendCheckpoint", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/g_general_permission_manager.js b/test/g_general_permission_manager.js index d13e3e1c2..f67b4bb65 100644 --- a/test/g_general_permission_manager.js +++ b/test/g_general_permission_manager.js @@ -142,7 +142,7 @@ contract("GeneralPermissionManager", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); @@ -329,7 +329,7 @@ contract("GeneralPermissionManager", async (accounts) => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); let _blockNo = latestBlock(); - let tx2 = await I_STRProxied.generateSecurityToken(name, "DEL", tokenDetails, false, { from: token_owner }); + let tx2 = await I_STRProxied.generateSecurityToken(name, "DEL", tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx2.logs[2].args._ticker, "DEL", "SecurityToken doesn't get deployed"); diff --git a/test/h_general_transfer_manager.js b/test/h_general_transfer_manager.js index 5bb16d702..4c0f49dad 100644 --- a/test/h_general_transfer_manager.js +++ b/test/h_general_transfer_manager.js @@ -172,7 +172,7 @@ contract("GeneralTransferManager", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/i_Issuance.js b/test/i_Issuance.js index 87c91ca72..c9bee9254 100644 --- a/test/i_Issuance.js +++ b/test/i_Issuance.js @@ -155,7 +155,7 @@ contract("Issuance", async (accounts) => { it("POLYMATH: Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: account_polymath }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: account_polymath }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: account_polymath }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); diff --git a/test/j_manual_approval_transfer_manager.js b/test/j_manual_approval_transfer_manager.js index dcf32707e..765c958c3 100644 --- a/test/j_manual_approval_transfer_manager.js +++ b/test/j_manual_approval_transfer_manager.js @@ -152,7 +152,7 @@ contract("ManualApprovalTransferManager", accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/k_module_registry.js b/test/k_module_registry.js index d4f9a2120..82ff1cda1 100644 --- a/test/k_module_registry.js +++ b/test/k_module_registry.js @@ -303,7 +303,7 @@ contract("ModuleRegistry", async (accounts) => { await I_PolyToken.getTokens(new BN(web3.utils.toWei("2000")), account_issuer); await I_PolyToken.approve(I_STRProxied.address, new BN(web3.utils.toWei("2000")), { from: account_issuer }); await I_STRProxied.registerTicker(account_issuer, symbol, name, { from: account_issuer }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, true, { from: account_issuer }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, true, 0, { from: account_issuer }); assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase()); I_SecurityToken = await SecurityToken.at(tx.logs[2].args._securityTokenAddress); }); @@ -405,7 +405,7 @@ contract("ModuleRegistry", async (accounts) => { await I_PolyToken.getTokens(new BN(web3.utils.toWei("2000")), account_issuer); await I_PolyToken.approve(I_STRProxied.address, new BN(web3.utils.toWei("2000")), { from: account_issuer }); await I_STRProxied.registerTicker(account_issuer, newSymbol, name, { from: account_issuer }); - let tx = await I_STRProxied.generateSecurityToken(name, newSymbol, tokenDetails, true, { from: account_issuer }); + let tx = await I_STRProxied.generateSecurityToken(name, newSymbol, tokenDetails, true, 0, { from: account_issuer }); assert.equal(tx.logs[2].args._ticker, newSymbol.toUpperCase()); I_SecurityToken2 = await SecurityToken.at(tx.logs[2].args._securityTokenAddress); diff --git a/test/l_percentage_transfer_manager.js b/test/l_percentage_transfer_manager.js index b10308232..52dd36399 100644 --- a/test/l_percentage_transfer_manager.js +++ b/test/l_percentage_transfer_manager.js @@ -166,7 +166,7 @@ contract("PercentageTransferManager", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/m_presale_sto.js b/test/m_presale_sto.js index 810d69ad1..e4473730c 100644 --- a/test/m_presale_sto.js +++ b/test/m_presale_sto.js @@ -141,8 +141,8 @@ contract("PreSaleSTO", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); diff --git a/test/n_security_token_registry.js b/test/n_security_token_registry.js index b208eaeea..b6fcbc4ce 100644 --- a/test/n_security_token_registry.js +++ b/test/n_security_token_registry.js @@ -11,11 +11,13 @@ const SecurityTokenRegistryProxy = artifacts.require("./SecurityTokenRegistryPro const SecurityTokenRegistry = artifacts.require("./SecurityTokenRegistry.sol"); const SecurityTokenRegistryMock = artifacts.require("./SecurityTokenRegistryMock.sol"); const STFactory = artifacts.require("./STFactory.sol"); +const STFactoryV2 = artifacts.require("./STFactoryMock.sol"); const STRGetter = artifacts.require('./STRGetter.sol'); const STGetter = artifacts.require("./STGetter.sol"); const DataStoreLogic = artifacts.require('./DataStore.sol'); const DataStoreFactory = artifacts.require('./DataStoreFactory.sol'); - +const TokenLib = artifacts.require('./TokenLib.sol'); +const SecurityTokenMock = artifacts.require('./SecurityTokenMock.sol'); const Web3 = require("web3"); let BN = Web3.utils.BN; @@ -67,6 +69,7 @@ contract("SecurityTokenRegistry", async (accounts) => { let I_USDOracle; let I_POLYOracle; let I_StablePOLYOracle; + let I_TokenLib; // SecurityToken Details (Launched ST on the behalf of the issuer) const name = "Demo Token"; @@ -100,6 +103,11 @@ contract("SecurityTokenRegistry", async (accounts) => { let currentTime; + function _pack(_major, _minor, _patch) { + let packedVersion =(parseInt(_major) << 16) | (parseInt(_minor) << 8) | parseInt(_patch); + return packedVersion; + } + before(async () => { currentTime = new BN(await latestTime()); account_polymath = accounts[0]; @@ -528,7 +536,7 @@ contract("SecurityTokenRegistry", async (accounts) => { await I_PolyToken.approve(I_STRProxied.address, new BN(0), { from: token_owner }); await catchRevert( - I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }), "tx revert -> POLY allowance not provided for registration fee" ); }); @@ -538,7 +546,7 @@ contract("SecurityTokenRegistry", async (accounts) => { await I_PolyToken.approve(I_STRProxied.address, initRegFeePOLY, { from: token_owner }); await catchRevert( - I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }), "tx revert -> Registration is paused" ); }); @@ -547,28 +555,35 @@ contract("SecurityTokenRegistry", async (accounts) => { await I_STRProxied.unpause({ from: account_polymath }); await catchRevert( - I_STRProxied.generateSecurityToken(name, "0x0", tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken(name, "0x0", tokenDetails, false, 0, { from: token_owner }), "tx revert -> Zero ticker length is not allowed" ); }); it("Should fail to generate the securityToken -- Because name length is 0", async () => { await catchRevert( - I_STRProxied.generateSecurityToken("", symbol, tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken("", symbol, tokenDetails, false, 0, { from: token_owner }), + "tx revert -> 0 name length is not allowed" + ); + }); + + it("Should fail to generate the securityToken -- Because version is not valid", async () => { + await catchRevert( + I_STRProxied.generateSecurityToken("", symbol, tokenDetails, false, 12356, { from: token_owner }), "tx revert -> 0 name length is not allowed" ); }); it("Should fail to generate the securityToken -- Because msg.sender is not the rightful owner of the ticker", async () => { await catchRevert( - I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: account_temp }), + I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: account_temp }), "tx revert -> Because msg.sender is not the rightful owner of the ticker" ); }); it("Should generate the new security token with the same symbol as registered above", async () => { - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); @@ -584,7 +599,7 @@ contract("SecurityTokenRegistry", async (accounts) => { it("Should fail to generate the SecurityToken when token is already deployed with the same symbol", async () => { await catchRevert( - I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }), "tx revert -> Because ticker is already in use" ); }); @@ -595,7 +610,7 @@ contract("SecurityTokenRegistry", async (accounts) => { let tx = await I_STRProxied.registerTicker(token_owner, "CCC", name, { from: token_owner }); await increaseTime(duration.days(65)); await catchRevert( - I_STRProxied.generateSecurityToken(name, "CCC", tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken(name, "CCC", tokenDetails, false, 0, { from: token_owner }), "tx revert -> Because ticker is expired" ); await revertToSnapshot(snap_Id); @@ -606,7 +621,7 @@ contract("SecurityTokenRegistry", async (accounts) => { await I_STRProxied.changeSecurityLaunchFee(0, { from: account_polymath }); await I_PolyToken.approve(I_STRProxied.address, new BN(web3.utils.toWei("2000")), { from: token_owner }); let tx = await I_STRProxied.registerTicker(token_owner, "CCC", name, { from: token_owner }); - await I_STRProxied.generateSecurityToken(name, "CCC", tokenDetails, false, { from: token_owner }), + await I_STRProxied.generateSecurityToken(name, "CCC", tokenDetails, false, 0, { from: token_owner }), await revertToSnapshot(snap_Id); }); @@ -615,7 +630,7 @@ contract("SecurityTokenRegistry", async (accounts) => { await I_PolyToken.getTokens(web3.utils.toWei("2000"), account_temp); await I_PolyToken.approve(I_STRProxied.address, web3.utils.toWei("2000"), { from: account_temp }); await I_STRProxied.registerTicker(account_temp, "TMP", name, { from: account_temp }); - let tx = await I_STRProxied.generateSecurityToken(name, "TMP", tokenDetails, false, { from: account_temp }); + let tx = await I_STRProxied.generateSecurityToken(name, "TMP", tokenDetails, false, 0, { from: account_temp }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, "TMP", "SecurityToken doesn't get deployed"); @@ -641,18 +656,19 @@ contract("SecurityTokenRegistry", async (accounts) => { I_STGetter = await STGetter.new(); let I_DataStoreLogic = await DataStoreLogic.new({ from: account_polymath }); let I_DataStoreFactory = await DataStoreFactory.new(I_DataStoreLogic.address, { from: account_polymath }); - - I_STFactory002 = await STFactory.new(I_GeneralTransferManagerFactory.address, I_DataStoreFactory.address, I_STGetter.address, { from: account_polymath }); + I_TokenLib = await TokenLib.new(); + await STFactoryV2.link(TokenLib); + await SecurityTokenMock.link(TokenLib); + I_STFactory002 = await STFactoryV2.new(I_GeneralTransferManagerFactory.address, I_DataStoreFactory.address, I_STGetter.address, { from: account_polymath }); assert.notEqual( I_STFactory002.address.valueOf(), address_zero, "STFactory002 contract was not deployed" ); - await I_STRProxied.setProtocolVersion(I_STFactory002.address, new BN(2), new BN(2), new BN(0), { from: account_polymath }); - let _protocol = await I_Getter.getProtocolVersion.call(); + let _protocol = await I_Getter.getLatestProtocolVersion.call(); assert.equal(_protocol[0], 2); - assert.equal(_protocol[1], 2); + assert.equal(_protocol[1], 0); assert.equal(_protocol[2], 0); }); @@ -663,15 +679,38 @@ contract("SecurityTokenRegistry", async (accounts) => { assert.equal(tx.logs[0].args._ticker, symbol2, `Symbol should be ${symbol2}`); }); - it("Should generate the new security token with version 2", async () => { - await I_PolyToken.approve(I_STRProxied.address, initRegFeePOLY, { from: token_owner }); + it("Should change the protocol version", async() => { + await I_STRProxied.setProtocolVersion(I_STFactory002.address, new BN(2), new BN(2), new BN(0), { from: account_polymath }); + let _protocol = await I_Getter.getLatestProtocolVersion.call(); + assert.equal(_protocol[0], 2); + assert.equal(_protocol[1], 2); + assert.equal(_protocol[2], 0); + await I_STRProxied.setProtocolVersion(I_STFactory.address, new BN(3), new BN(0), new BN(0), { from: account_polymath}); + _protocol = await I_Getter.getLatestProtocolVersion.call(); + assert.equal(_protocol[0], 3); + assert.equal(_protocol[1], 0); + assert.equal(_protocol[2], 0); + }); - let tx = await I_STRProxied.generateSecurityToken(name2, symbol2, tokenDetails, false, { from: token_owner }); + it("Should fail to generate the securityToken because of invalid version", async() => { + await I_PolyToken.approve(I_STRProxied.address, initRegFeePOLY, { from: token_owner }); + await catchRevert( + I_STRProxied.generateSecurityToken(name2, symbol2, tokenDetails, false, _pack(1,2,0), { from: token_owner }) + ); + }) + it("Should generate the new security token with version 2", async () => { + let tx = await I_STRProxied.generateSecurityToken(name2, symbol2, tokenDetails, false, _pack(2,2,0), { from: token_owner }); + // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol2, "SecurityToken doesn't get deployed"); - I_SecurityToken002 = await SecurityToken.at(tx.logs[2].args._securityTokenAddress); + I_SecurityToken002 = await SecurityTokenMock.at(tx.logs[2].args._securityTokenAddress); + let stGetterV2 = await STGetter.at(I_SecurityToken002.address); + let stVersion = await stGetterV2.getVersion.call(); + assert.equal(stVersion[0], 2); + assert.equal(stVersion[1], 2); + assert.equal(stVersion[2], 0); const log = (await I_SecurityToken002.getPastEvents('ModuleAdded'))[0]; // Verify that GeneralTransferManager module get added successfully or not assert.equal(log.args._types[0].toNumber(), transferManagerKey); @@ -1033,14 +1072,14 @@ contract("SecurityTokenRegistry", async (accounts) => { it("Should fail to launch the securityToken with the old launch fee", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFeePOLY, { from: token_owner }); await catchRevert( - I_STRProxied.generateSecurityToken("Polymath", "POLY", tokenDetails, false, { from: token_owner }), + I_STRProxied.generateSecurityToken("Polymath", "POLY", tokenDetails, false, 0, { from: token_owner }), "tx revert -> failed because of old launch fee" ); }); it("Should launch the the securityToken", async () => { await I_PolyToken.approve(I_STRProxied.address, new BN(web3.utils.toWei("2000")), { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken("Polymath", "POLY", tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken("Polymath", "POLY", tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, "POLY", "SecurityToken doesn't get deployed"); @@ -1080,7 +1119,7 @@ contract("SecurityTokenRegistry", async (accounts) => { let data = await I_Getter.getSecurityTokenData.call(I_SecurityToken.address); assert.equal(data[0], symbol); assert.equal(data[1], token_owner); - assert.equal(data[4][0], 2); + assert.equal(data[4][0], 3); assert.equal(data[4][1], 0); assert.equal(data[4][2], 0); }); @@ -1244,7 +1283,7 @@ contract("SecurityTokenRegistry", async (accounts) => { it("Should successfully change the protocolVersion -- fail in second attempt because of invalid version", async () => { let snap_Id = await takeSnapshot(); - await I_STRProxied.setProtocolVersion(accounts[8], 2, 3, 1, { from: account_polymath }); + await I_STRProxied.setProtocolVersion(accounts[8], 3, 1, 1, { from: account_polymath }); await catchRevert(I_STRProxied.setProtocolVersion(accounts[8], 1, 3, 1, { from: account_polymath })); await revertToSnapshot(snap_Id); }); diff --git a/test/o_security_token.js b/test/o_security_token.js index b758d0b10..bdfd080f0 100644 --- a/test/o_security_token.js +++ b/test/o_security_token.js @@ -186,7 +186,7 @@ contract("SecurityToken", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); diff --git a/test/p_usd_tiered_sto.js b/test/p_usd_tiered_sto.js index 09c98ab62..94f15e717 100644 --- a/test/p_usd_tiered_sto.js +++ b/test/p_usd_tiered_sto.js @@ -286,7 +286,7 @@ contract("USDTieredSTO", async (accounts) => { await I_PolyToken.getTokens(REGFEE, ISSUER); await I_PolyToken.approve(I_STRProxied.address, REGFEE, { from: ISSUER }); - let tx = await I_STRProxied.generateSecurityToken(NAME, SYMBOL, TOKENDETAILS, true, { from: ISSUER }); + let tx = await I_STRProxied.generateSecurityToken(NAME, SYMBOL, TOKENDETAILS, true, 0, { from: ISSUER }); assert.equal(tx.logs[2].args._ticker, SYMBOL, "SecurityToken doesn't get deployed"); I_SecurityToken = await SecurityToken.at(tx.logs[2].args._securityTokenAddress); diff --git a/test/q_usd_tiered_sto_sim.js b/test/q_usd_tiered_sto_sim.js index 1bed3ccb7..92540fccc 100644 --- a/test/q_usd_tiered_sto_sim.js +++ b/test/q_usd_tiered_sto_sim.js @@ -261,7 +261,7 @@ contract("USDTieredSTO Sim", async (accounts) => { await I_PolyToken.getTokens(REGFEE, ISSUER); await I_PolyToken.approve(I_STRProxied.address, REGFEE, { from: ISSUER }); - let tx = await I_STRProxied.generateSecurityToken(NAME, SYMBOL, TOKENDETAILS, true, { from: ISSUER }); + let tx = await I_STRProxied.generateSecurityToken(NAME, SYMBOL, TOKENDETAILS, true, 0, { from: ISSUER }); assert.equal(tx.logs[2].args._ticker, SYMBOL, "SecurityToken doesn't get deployed"); I_SecurityToken = await SecurityToken.at(tx.logs[2].args._securityTokenAddress); diff --git a/test/r_concurrent_STO.js b/test/r_concurrent_STO.js index c8bf6c781..967d474ed 100644 --- a/test/r_concurrent_STO.js +++ b/test/r_concurrent_STO.js @@ -148,7 +148,7 @@ contract("Concurrent STO", async (accounts) => { await I_PolyToken.getTokens(initRegFee, account_issuer); await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: account_issuer }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: account_issuer }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: account_issuer }); assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); I_SecurityToken = await SecurityToken.at(tx.logs[2].args._securityTokenAddress); diff --git a/test/t_security_token_registry_proxy.js b/test/t_security_token_registry_proxy.js index bae86e140..00c32e1b3 100644 --- a/test/t_security_token_registry_proxy.js +++ b/test/t_security_token_registry_proxy.js @@ -162,7 +162,7 @@ contract("SecurityTokenRegistryProxy", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFeePOLY, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed"); diff --git a/test/v_tracked_redemptions.js b/test/v_tracked_redemptions.js index d6e5e4509..3bde79d21 100644 --- a/test/v_tracked_redemptions.js +++ b/test/v_tracked_redemptions.js @@ -140,7 +140,7 @@ contract("TrackedRedemption", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/w_lockup_transfer_manager.js b/test/w_lockup_transfer_manager.js index 121945880..b15e2c470 100644 --- a/test/w_lockup_transfer_manager.js +++ b/test/w_lockup_transfer_manager.js @@ -140,7 +140,7 @@ contract('LockUpTransferManager', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); let _blockNo = latestBlock(); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); @@ -172,7 +172,7 @@ contract('LockUpTransferManager', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); let _blockNo = latestBlock(); - let tx = await I_STRProxied.generateSecurityToken(name2, symbol2, tokenDetails, true, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name2, symbol2, tokenDetails, true, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol2.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/x_scheduled_checkpoints.js b/test/x_scheduled_checkpoints.js index 8d6bc4a31..ef527280c 100644 --- a/test/x_scheduled_checkpoints.js +++ b/test/x_scheduled_checkpoints.js @@ -134,7 +134,7 @@ contract("ScheduledCheckpoint", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/y_volume_restriction_tm.js b/test/y_volume_restriction_tm.js index 2ddd828f3..c8e7d8353 100644 --- a/test/y_volume_restriction_tm.js +++ b/test/y_volume_restriction_tm.js @@ -194,7 +194,7 @@ contract('VolumeRestrictionTransferManager', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, true, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, true, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/z_blacklist_transfer_manager.js b/test/z_blacklist_transfer_manager.js index fa0230626..8563bd278 100644 --- a/test/z_blacklist_transfer_manager.js +++ b/test/z_blacklist_transfer_manager.js @@ -151,7 +151,7 @@ contract('BlacklistTransferManager', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner}); let _blockNo = latestBlock(); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/z_fuzz_test_adding_removing_modules_ST.js b/test/z_fuzz_test_adding_removing_modules_ST.js index a3d0875e6..88cceb3eb 100644 --- a/test/z_fuzz_test_adding_removing_modules_ST.js +++ b/test/z_fuzz_test_adding_removing_modules_ST.js @@ -192,7 +192,7 @@ contract('GeneralPermissionManager', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); let _blockNo = latestBlock(); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/z_fuzzer_volumn_restriction_transfer_manager.js b/test/z_fuzzer_volumn_restriction_transfer_manager.js index 007a09849..faf1dfd7a 100644 --- a/test/z_fuzzer_volumn_restriction_transfer_manager.js +++ b/test/z_fuzzer_volumn_restriction_transfer_manager.js @@ -180,7 +180,7 @@ contract('VolumeRestrictionTransferManager', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, true, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, true, 0, { from: token_owner }); console.log(tx.logs); // Verify the successful generation of the security token diff --git a/test/z_general_permission_manager_fuzzer.js b/test/z_general_permission_manager_fuzzer.js index c6a8ff98a..3640c613f 100644 --- a/test/z_general_permission_manager_fuzzer.js +++ b/test/z_general_permission_manager_fuzzer.js @@ -187,7 +187,7 @@ contract("GeneralPermissionManager Fuzz", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/z_vesting_escrow_wallet.js b/test/z_vesting_escrow_wallet.js index d720240d6..1040ffb77 100644 --- a/test/z_vesting_escrow_wallet.js +++ b/test/z_vesting_escrow_wallet.js @@ -146,7 +146,7 @@ contract('VestingEscrowWallet', accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/za_datastore.js b/test/za_datastore.js index b1cb2ed83..2ee7035b9 100644 --- a/test/za_datastore.js +++ b/test/za_datastore.js @@ -97,7 +97,7 @@ contract("Data store", async (accounts) => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed"); diff --git a/test/zb_signed_transfer_manager.js b/test/zb_signed_transfer_manager.js index 6ba0ba266..69b8e4027 100644 --- a/test/zb_signed_transfer_manager.js +++ b/test/zb_signed_transfer_manager.js @@ -137,7 +137,7 @@ contract("SignedTransferManager", accounts => { it("Should generate the new security token with the same symbol as registered above", async () => { await I_PolyToken.approve(I_STRProxied.address, initRegFee, { from: token_owner }); - let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, { from: token_owner }); + let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, 0, { from: token_owner }); // Verify the successful generation of the security token assert.equal(tx.logs[2].args._ticker, symbol.toUpperCase(), "SecurityToken doesn't get deployed");