polymath-core_v2
v0.3.0
Published
Polymath Network Core Smart Contracts v2
Downloads
3
Maintainers
Readme
Polymath core v2
The polymath core smart contracts provide a system for launching regulatory compliant securities tokens on a decentralized blockchain.
Polymath Core Smart Contracts
Ropsten
- TickerRegistry:
- SecurityTokenRegistry:
- ModuleRegistry:
Setup
The smart contracts are written in Solidity and tested/deployed using Truffle version 4.1.0. The new version of Truffle doesn't require testrpc to be installed separately so you can just do use the following:
# Install Truffle package globally:
$ npm install -g truffle
# Install local node dependencies:
$ npm install
Testing
To test the code simply run:
$ npm run test
Setting up Polymath Network
Deploy ModuleRegistry. ModuleRegistry keeps track of all available modules that add new functionalities to Polymath-based security tokens.
Deploy GeneralTransferManagerFactory. This module allows the use of a general TransferManager for newly issued security tokens. The General Transfer Manager gives STs the ability to have their transfers restricted by using an on-chain whitelist.
Add the GeneralTransferManagerFactory module to ModuleRegistry by calling
ModuleRegistry.registerModule()
.Deploy TickerRegistry. This contract handles the registration of unique token symbols. Issuers first have to claim their token symbol through the TickerRegistry. If it's available they will be able to deploy a ST with the same symbol for a set number of days before the registration expires.
Deploy SecurityTokenRegistry. This contract is responsible for deploying new Security Tokens. STs should always be deployed by using the SecurityTokenRegistry.
Deploying Security Token Offerings (Only Network Admin)
Security Token Offerings (STOs) grant STs the ability to be distributed in an initial offering. Polymath offers a few out-of-the-box STO models for issuers to select from and, as the platform evolves, 3rd party developers will be able to create their own offerings and make them available to the network.
As an example, we've included a CappedSTO and CappedSTOFactory contracts.
In order to create a new STO, developers first have to create an STO Factory contract which will be responsible for instantiating STOs as Issuers select them. Each STO Factory has an STO contract attached to it, which will be instantiated for each Security Token that wants to use that particular STO.
To make an STO available for Issuers, first, deploy the STO Factory and take note of its address. Then, call moduleRegistry.registerModule(STO Factory address);
Once the STO Factory has been registered to the Module Registry, issuers will be able to see it on the Polymath dApp and they will be able to add it as a module of the ST.
Using the CLI ST-20 Generator
The CLI ST-20 Generator is a wizard-like script that will guide you in the creation and deployment of the ST-20 token.
To use it, make sure you are connected to a full-node (or locally to Ganache-cli).
- Edit demo/ST20Generator.js to make sure it's pointing to the correct contract addresses
- On your terminal, run the following command:
node demo/ST20Generator
- Follow the Command-line prompts
Styleguide
The polymath-core repo follows the style guide overviewed here: http://solidity.readthedocs.io/en/develop/style-guide.html