Polymath is a platform that enables the creation, issuance and trading of financial instruments on the blockchain. It allows participants to easily launch Securities Tokens through Securities Token Offerings (STOs) in a regulatory-compliant manner. We have built the infrastructure to make this happen and here it is for you to disover:
Core Ethereum Smart Contracts for Polymath - The Securities Token Platform.
The Polymath Core smart contracts provide a system for launching regulatory-compliant securities tokens on a decentralized blockchain. This particular repository is the implementation of a system that allows for the creation of ST-20-compatible tokens. This system has a modular design that promotes a variety of pluggable components for various types of issuances, legal requirements, and offering processes.
Setting up Polymath Core
New SecurityTokenRegistry (2.0.1): 0x538136ed73011a766bf0a126a27300c3a7a2e6a6 (fixed bug with getTickersByOwner())
New ModuleRegistry (2.0.1): 0xbc18f144ccf87f2d98e6fa0661799fcdc3170119 (fixed bug with missing transferOwnership function)
New Kovan PolyTokenFaucet: 0xb347b9f5b56b431b2cf4e1d90a5995f7519ca792
|General Transfer Manager Factory:||0x650e9507e983077d6f822472a7dcc37626d55c7f|
|General Permission Manager Factory:||0xbf0bd6305b523ce055baa6dfaa9676d6b9e6090b|
|ERC20 Dividends Checkpoint Factory:||0x4369751df5bcb2f12f1790f525ef212a622b9c60|
|Count Transfer Manager Factory:||0xc7cf0c1ddc85c18672951f9bfeb7163ecc8f0e2f|
|Percentage Transfer Manager Factory:||0xfea5fcb254bcb4ada0f86903ff822d6372325cb1|
|Manual Approval Transfer Manager Factory:||0x9faa79e2ccf0eb49aa6ebde1795ad2e951ce78f8|
Package version requirements for your machine:
- node v8.x.x or v9.x.x
- npm v6.x.x or newer
- Yarn v1.3 or newer
- Homebrew v1.6.7 (for macOS)
- Truffle v4.1.11 (core: 4.1.11)
- Solidity v0.4.24 (solc-js)
- Ganache CLI v6.1.3 (ganache-core: 2.1.2) or newer
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 run the following:
Install Truffle package globally: npm install -g truffle Install local node dependencies: npm install
To Test the code simply run:
$ npm run test
Extending Polymath Core
ModuleRegistrykeeps track of all available modules that add new functionalities to Polymath-based security tokens.
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.
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.
SecurityTokenRegistry. This contract is responsible for deploying new Security Tokens. STs should always be deployed by using the
Deploying Security Token Offerings (Network Admin Only)
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
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.
Note that while anyone can register an STO Factory, only those "approved" by Polymath will be enabled to be attached by the general community. An STO Factory not yet approved by Polymath may only be used by it's author.
For more Info: https://github.com/PolymathNetwork/polymath-core
Working with contracts locally
To deploy contracts run Ganache CLI >= v6.1.0-beta.0 (lower versions does not support WebSockets) and in a separate terminal:
npm run contracts
Turn off MetaMask or any other Web3 provider and start/build application.
To open Truffle Console and play with contracts directly:
npm run tconsole
Read more about Truffle Console: http://truffleframework.com/docs/getting_started/console