Polymath.js is the main library for interacting with Polymath's smart contracts on the client side. It is written in javascript using flow, babel and eslint. The documentation is automatically generated using documentationjs. Checkout the docs
The best way to use Polymath.js is to download the polymathjs npm module. Go into your project and run npm install polymathjs
. Once you do that, you can check out the docs at https://docs.polymath.network to see decriptions of every single function call in the library.
There is an example client side app located at https://github.com/PolymathNetwork/example-app-polymathjs. It is built with create-react-app, and shows how you would wire up your project in order to use the library to make calls to the ropsten testnet and mainnet polymath core contracts. (Please note, polymathjs will work on the client side only).
The polymath.js library will automatically figure out which network you are on in the browser when you are connected through metamask. If you select mainnet or ropsten, it will connect to the correct contracts, just make sure you have ether to be able to test the function calls.
Currently polymathjs is connected to the v1 launched instances of the polymath core contracts for both ropsten and mainnet. Please see the contract addresses below:
If you want to use testrpc for faster testing with the polymath contracts, you will have to clone this github repo in order to properly migrate the contracts to your testrpc. Once you clone this repo, you can run the following steps to get the contracts migrated to the testrpc:
yarn install
to install the npm modulesyarn testrpc
(keep this terminal running. This command is a custom npm script to set up an easier dev environment, see the package.json for more details on the ganache cli custom npm script)
In a new terminal
yarn compile
to compile the contracts and create truffle artifacts (ensure the testrpc stuff will still work)yarn migrate-testrpc
to migrate the contracts onto your testrpc
Then you can use metamask to connected to localhost:8545. You will have to import the private keys from the testrpc into metamask. if you use yarn testrpc
to start testrpc, then it will use the same 10 private keys everytime, which will be located in the terminal. They will be pre loaded with testrpc ether.
We're always looking for developers to join the polymath network. To do so we encourage developers to contribute by creating Security Token Offering contracts (STO) which can be used by issuers to raise funds. If your contract is used, you can earn POLY fees directly through the contract, and additional bonuses through the Polymath reserve fund.
If you would like to apply directly to our STO contract development team, please send your resume and/or portfolio to careers@polymath.network.
Please also see the contributing file if you want to help with working on the polymathjs library source code!
The polymath-core repo follows the style guide overviewed here: http://solidity.readthedocs.io/en/develop/style-guide.html