File tree Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Original file line number Diff line number Diff line change 11pragma solidity ^ 0.5.0 ;
22
3- import "./interfaces/ISecurityToken.sol " ;
4- import "./interfaces/IOwnable.sol " ;
3+ import "../interfaces/ISecurityToken.sol " ;
4+ import "../interfaces/IOwnable.sol " ;
5+ import "./DataStoreStorage.sol " ;
56
6- contract DataStore {
7+ contract DataStore is DataStoreStorage {
78 ISecurityToken public associatedToken;
89
910 mapping (bytes32 => uint256 ) internal uintData;
Original file line number Diff line number Diff line change 1+ pragma solidity ^ 0.5.0 ;
2+
3+ import "../proxy/DataStoreProxy.sol " ;
4+
5+ contract DataStoreFactory {
6+
7+ address public implementation;
8+
9+ constructor (address _implementation ) public {
10+ require (_implementation != address (0 ), "Address should not be 0x " );
11+ implementation = _implementation;
12+ }
13+
14+ function generateDataStore (address _securityToken ) public returns (address ) {
15+ DataStoreProxy dsProxy = new DataStoreProxy (_securityToken, implementation);
16+ return address (dsProxy);
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ pragma solidity ^ 0.5.0 ;
2+
3+ import "../interfaces/ISecurityToken.sol " ;
4+
5+ contract DataStoreStorage {
6+ ISecurityToken public associatedToken;
7+
8+ mapping (bytes32 => uint256 ) internal uintData;
9+ mapping (bytes32 => bytes32 ) internal bytes32Data;
10+ mapping (bytes32 => address ) internal addressData;
11+ mapping (bytes32 => string ) internal stringData;
12+ mapping (bytes32 => bytes ) internal bytesData;
13+ mapping (bytes32 => bool ) internal boolData;
14+ mapping (bytes32 => uint256 []) internal uintArrayData;
15+ mapping (bytes32 => bytes32 []) internal bytes32ArrayData;
16+ mapping (bytes32 => address []) internal addressArrayData;
17+ mapping (bytes32 => bool []) internal boolArrayData;
18+
19+ uint8 constant DATA_KEY = 10 ;
20+ }
Original file line number Diff line number Diff line change 1+ pragma solidity ^ 0.5.0 ;
2+
3+ import "./OwnedProxy.sol " ;
4+ import "../DataStore/DataStoreStorage.sol " ;
5+
6+ /**
7+ * @title DataStoreProxy Proxy
8+ */
9+ contract DataStoreProxy is DataStoreStorage , OwnedProxy {
10+
11+ /**
12+ * @notice Constructor
13+ * @param _securityToken Address of the security token
14+ * @param _implementation representing the address of the new implementation to be set
15+ */
16+ constructor (
17+ address _securityToken ,
18+ address _implementation
19+ )
20+ public
21+ {
22+ require (_implementation != address (0 ) && _securityToken != address (0 ),
23+ "Address should not be 0x "
24+ );
25+ associatedToken = ISecurityToken (_securityToken);
26+ __implementation = _implementation;
27+ }
28+
29+ }
You can’t perform that action at this time.
0 commit comments