-
Notifications
You must be signed in to change notification settings - Fork 152
Allows explicit token factory version in generateSecurityToken() #568
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
84790ed
allows explicit token factory version in generateSecurityToken()
SatyamSB 13a4e3a
resolve conflicts
SatyamSB ecbe50f
fix tests
SatyamSB ee72372
add some test and mock contract
SatyamSB 923432c
resolve conflicts
SatyamSB dff1be7
bump the version of ST
SatyamSB 12e9391
Merge branch 'dev-3.0.0' into add-protocolVersion
maxsam4 0d564ed
Merge branch 'dev-3.0.0' into add-protocolVersion
maxsam4 14e828a
add the protocolVersion in the event
SatyamSB 039dd3f
Merge branch 'dev-3.0.0' into add-protocolVersion
adamdossa c56fb1d
minor fixes in the STR
SatyamSB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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); | ||
| } | ||
|
|
||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.