Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version to getSecurityTokenData (referenced directly from token using getVersion) #567

Merged
merged 13 commits into from
Feb 21, 2019
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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`.
* Return SecurityToken version in the `getSecurityTokenData()` function.

## GeneralTransferManager
* `modifyWhitelist()` function renamed to `modifyKYCData()`.
Expand Down
7 changes: 5 additions & 2 deletions contracts/STRGetter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pragma solidity ^0.5.0;

import "./storage/EternalStorage.sol";
import "./interfaces/ISecurityToken.sol";
import "./libraries/Util.sol";
import "./libraries/Encoder.sol";
import "./interfaces/IOwnable.sol";
Expand Down Expand Up @@ -144,13 +145,15 @@ contract STRGetter is EternalStorage {
* @return address is the issuer of the security Token.
* @return string is the details of the security token.
* @return uint256 is the timestamp at which security Token was deployed.
* @return version of the securityToken
*/
function getSecurityTokenData(address _securityToken) external view returns (string memory, address, string memory, uint256) {
function getSecurityTokenData(address _securityToken) external view returns (string memory, address, string memory, uint256, uint8[] memory) {
return (
getStringValue(Encoder.getKey("securityTokens_ticker", _securityToken)),
IOwnable(_securityToken).owner(),
getStringValue(Encoder.getKey("securityTokens_tokenDetails", _securityToken)),
getUintValue(Encoder.getKey("securityTokens_deployedAt", _securityToken))
getUintValue(Encoder.getKey("securityTokens_deployedAt", _securityToken)),
ISecurityToken(_securityToken).getVersion()
);
}

Expand Down
5 changes: 3 additions & 2 deletions contracts/interfaces/ISecurityTokenRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ interface ISecurityTokenRegistry {
* @return string Symbol of the Security Token.
* @return address Address of the issuer of Security Token.
* @return string Details of the Token.
* @return uint256 Timestamp at which Security Token get launched on Polymath platform.
* @return uint256 Timestamp at which Security Token get launched on Polymath platform
* @return version of the securityToken
*/
function getSecurityTokenData(address _securityToken) external view returns(string memory, address, string memory, uint256);
function getSecurityTokenData(address _securityToken) external view returns(string memory, address, string memory, uint256, uint8[] memory);

/**
* @notice Get the current STFactory Address
Expand Down
3 changes: 3 additions & 0 deletions test/n_security_token_registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,9 @@ 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][1], 0);
assert.equal(data[4][2], 0);
});

it("Should get the tickers by owner", async () => {
Expand Down