Skip to content

Commit 22c48b3

Browse files
authored
Merge pull request #538 from PolymathNetwork/migrate-gtm-data
Migrate data of GTM
2 parents 25e8f0e + eff3390 commit 22c48b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+330
-138
lines changed

0

Whitespace-only changes.

CHANGELOG.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
# v3.0.0
5-
6-
[__3.0.0__]
7-
8-
## Changed
9-
* Changed the first three params in Security Token `event ModuleAdded()` to be indexed for search. Params are `unit8[] types`, `bytes32 _name` and `address _moduleFactory`
10-
114
# v3.0.0 - Release Candidate
125

136
[__3.0.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __10-11-18__
147

15-
## Added
8+
## SecurityToken
169
* Added new function `addModuleWithLabel()` which takes an extra param `_label` that used for giving the customize label to the module for display purpose. #428
17-
* Introduce new contract `STRGetter.sol`. It only contains the getter functions of the STR.
18-
19-
## Fixed
10+
* Changed the first three params in Security Token `event ModuleAdded()` to be indexed for search. Params are `unit8[] types`, `bytes32 _name` and `address _moduleFactory`
2011
* Fixed `addModule` function to be backwards compatible and call the new `addModuleWithLabel` function with an empty label.
2112
* Fixed event `ModuleAdded` to also emit `_label`.
2213
* Fixed function `getModule` to also return the respective module label.
14+
15+
## STR
16+
* Introduce new contract `STRGetter.sol`. It only contains the getter functions of the STR.
2317
* Replaced `updatePolyTokenAddress()` function with `updateFromRegistry()` in `SecurityTokenRegistry`.
2418
* Migrate all the getters of `SecurityTokenRegsitry.sol` to `STRGetter.sol` contract.
19+
* Removed `_polyToken` parameter from `initialize` function in `SecurityTokenRegistry`.
2520

26-
## Removed
21+
## GeneralTransferManager
22+
* Add `_isAccredited` variable in the `modifyWhitelist()` function of the GeneralTransferManager.
23+
24+
## Generalize
2725
* Removed `_polyAddress` parameter from constructors of all modules and module factories.
28-
* Removed `_polyToken` parameter from `initialize` function in `SecurityTokenRegistry`.
26+
2927

3028
# v2.1.0 - Release Candidate
3129

contracts/interfaces/IBoot.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ interface IBoot {
66
* @return bytes4 Configure function signature
77
*/
88
function getInitFunction() external pure returns(bytes4);
9+
910
}

contracts/libraries/VersionUtils.sol

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,25 @@ library VersionUtils {
106106
return _unpackVersion;
107107
}
108108

109+
110+
/**
111+
* @notice Used to packed the KYC data
112+
*/
113+
function packKYC(uint64 _a, uint64 _b, uint64 _c, uint8 _d, uint8 _e, uint8 _f) internal pure returns(uint256) {
114+
return (uint256(_a) << 152) | (uint256(_b) << 88) | (uint256(_c) << 24) | (uint256(_d) << 16) | (uint256(_e) << 8) | uint256(_f);
115+
}
116+
117+
/**
118+
* @notice Used to convert packed data into KYC data
119+
* @param _packedVersion Packed data
120+
*/
121+
function unpackKYC(uint256 _packedVersion) internal pure returns(uint64 fromTime, uint64 toTime, uint64 expiryTime, uint8 canBuy, uint8 added, uint8 accredited) {
122+
fromTime = uint64(_packedVersion >> 152);
123+
toTime = uint64(_packedVersion >> 88);
124+
expiryTime = uint64(_packedVersion >> 24);
125+
canBuy = uint8(_packedVersion >> 16);
126+
added = uint8(_packedVersion >> 8);
127+
accredited = uint8(_packedVersion);
128+
}
129+
109130
}

contracts/modules/Checkpoint/DividendCheckpoint.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pragma solidity ^0.5.0;
1010
import "./ICheckpoint.sol";
1111
import "./DividendCheckpointStorage.sol";
1212
import "../Module.sol";
13-
import "../../interfaces/ISecurityToken.sol";
1413
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
1514
import "openzeppelin-solidity/contracts/math/Math.sol";
1615

contracts/modules/Experimental/Burn/TrackedRedemption.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ pragma solidity ^0.5.0;
22

33
import "../../Burn/IBurn.sol";
44
import "../../Module.sol";
5-
import "../../../interfaces/ISecurityToken.sol";
65
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
76

87
/**

contracts/modules/Experimental/Mixed/ScheduledCheckpoint.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ pragma solidity ^0.5.0;
22

33
import "./../../Checkpoint/ICheckpoint.sol";
44
import "../../TransferManager/TransferManager.sol";
5-
import "../../../interfaces/ISecurityToken.sol";
65
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
76

87
/**

contracts/modules/Experimental/TransferManager/KYCTransferManager.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pragma solidity ^0.5.0;
22

33
import "../../TransferManager/TransferManager.sol";
4-
import "../../../interfaces/IDataStore.sol";
54
import "../../../interfaces/ISecurityToken.sol";
65
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
76

contracts/modules/Experimental/TransferManager/SignedTransferManager.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
pragma solidity ^0.5.0;
22

33
import "../../TransferManager/TransferManager.sol";
4-
import "../../../interfaces/IDataStore.sol";
5-
import "../../../interfaces/ISecurityToken.sol";
64
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
75
import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol";
86

contracts/modules/Experimental/Wallet/VestingEscrowWallet.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pragma solidity ^0.5.0;
33
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
44
import "../../../storage/VestingEscrowWalletStorage.sol";
55
import "./IWallet.sol";
6-
import "../../../interfaces/ISecurityToken.sol";
76

87
/**
98
* @title Wallet for core vesting escrow functionality

contracts/modules/Module.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
pragma solidity ^0.5.0;
22

3+
import "./ModuleStorage.sol";
34
import "../interfaces/IModule.sol";
5+
import "../interfaces/IDataStore.sol";
6+
import "../interfaces/ISecurityToken.sol";
47
import "../interfaces/ICheckPermission.sol";
58
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
6-
import "./ModuleStorage.sol";
79
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
810

911
/**
@@ -58,4 +60,8 @@ contract Module is IModule, ModuleStorage {
5860
require(polyToken.transferFrom(securityToken, Ownable(factory).owner(), _amount), "Unable to take fee");
5961
return true;
6062
}
63+
64+
function getDataStore() public view returns(address) {
65+
return ISecurityToken(securityToken).dataStore();
66+
}
6167
}

contracts/modules/PermissionManager/GeneralPermissionManager.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pragma solidity ^0.5.0;
33
import "./IPermissionManager.sol";
44
import "../Module.sol";
55
import "./GeneralPermissionManagerStorage.sol";
6-
import "../../interfaces/ISecurityToken.sol";
76

87
/**
98
* @title Permission Manager module for core permissioning functionality

contracts/modules/STO/CappedSTO.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pragma solidity ^0.5.0;
22

33
import "./STO.sol";
4-
import "../../interfaces/ISecurityToken.sol";
54
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
65
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
76
import "./CappedSTOStorage.sol";

contracts/modules/STO/DummySTO.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pragma solidity ^0.5.0;
22

33
import "./STO.sol";
4-
import "../../interfaces/ISecurityToken.sol";
54
import "./DummySTOStorage.sol";
65

76
/**
@@ -37,7 +36,7 @@ contract DummySTO is DummySTOStorage, STO {
3736
* @notice This function returns the signature of configure function
3837
*/
3938
function getInitFunction() public pure returns(bytes4) {
40-
return bytes4(keccak256("configure(uint256,uint256,uint256,string)"));
39+
return this.configure.selector;
4140
}
4241

4342
/**

contracts/modules/STO/PreSaleSTO.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pragma solidity ^0.5.0;
22

33
import "./STO.sol";
4-
import "../../interfaces/ISecurityToken.sol";
54
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
65
import "./PreSaleSTOStorage.sol";
76

contracts/modules/STO/USDTieredSTO.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pragma solidity ^0.5.0;
22

33
import "./STO.sol";
4-
import "../../interfaces/ISecurityToken.sol";
54
import "../../interfaces/IOracle.sol";
65
import "../../RegistryUpdater.sol";
76
import "../../libraries/DecimalMath.sol";

contracts/modules/TransferManager/CountTransferManager.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ pragma solidity ^0.5.0;
22

33
import "./TransferManager.sol";
44
import "./CountTransferManagerStorage.sol";
5-
import "../../interfaces/ISecurityToken.sol";
65

76
/**
87
* @title Transfer Manager for limiting maximum number of token holders

0 commit comments

Comments
 (0)