Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

A template of a React project that integrates with Polymath protocol via Polymath SDK

Notifications You must be signed in to change notification settings

PolymathNetwork/dapp-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

In our series of reference dapp implementations (such as this and this), we usually conduct a few repetetive bootstrapping steps. Typical steps are:

  • Create a new app using create-react-app.
  • Install dependencies such as ant-design and polymath-sdk.
  • Use React Hooks API to create a simplified Redux data store.
  • Initialize Polymath SDK.
  • Store relevant properties such as Metamask account address and Network ID.
  • Display errors, if any.

By starting a repo from this template, you'd skip all those mundane steps and start solving your business problems right away.

Create a repo from this template

Just click on Use this template button above, then follow the wizard.

Install & Run

  • git clone [newly-created-repo].
  • cd [newly-created-repo-dir]
  • yarn install && yarn start

A browser tab should open and present you with a page like this:

Homepage

(optional) Deploy to Github pages

Static web apps such as this one, could be deployed to numerous different hostd, and usually for free. For simplicity, we have preconfigured this repo to be published to Github pages, as we believe it's the most commonly used static website host. But feel free to use any host you prefer.

Before attempting to publish your app, you need to add or modify homepage property in package.json file. Per create-react-app deployment guide: , the simplest way is to:

Open your package.json and add a homepage field for your project:

"homepage": "https://myusername.github.io/my-app",

How it works

See the wiki section for more information about the structure of this template.

Obtaining Poly tokens

POLY is an ERC20 utility token. It is required to conduct certain paid operations on Polymath network. For example, reserving a token symbol or attaching additional modules requires a predetermined amount of Poly. Obtaining Poly tokens varies by the Ethereum network in use.

  • Kovan: you can obtain Kovan poly, for free, from the deployed PolyFaucet contract. Foruntately, the SDK will obtain Poly on Kovan networks on-the-fly, when it's needed for a certain SDK functionality (eg symbol reservation).
  • Mainnet: you can buy Poly tokens on mainnet using one of these markets.

About

A template of a React project that integrates with Polymath protocol via Polymath SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published