You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 6, 2022. It is now read-only.
This is all you need to create new security token using Polymath.js v2.0. It will:
9
+
1. Format data into the blockchain types (e.g. add decimals for token values).
10
+
2. Properly estimate gas via Web3 1.0.
11
+
3. Make dry run to validate inputs before transaction sending.
12
+
4. Notify callbacks with transaction hash and receipt.
13
+
5. Check whether the transaction was mined without errors or not.
14
+
6. Send necessary requests to the `polymath-api`.
15
+
16
+
## Key advantages
17
+
1. Web3 1.0. It means that we don't need truffle-contract package anymore and we can use async-await, websockets for events (there was bug with disconnection from them, but now it's fixed), proper auto gas estimation.
18
+
2. No need to wrap each contract function since v2.0 uses JavaScript Proxy API, which in a simplified manner calls original method if it's not overridden.
19
+
```
20
+
await PolyToken.symbol()
21
+
```
22
+
There is no `symbol` entry within the `PolyToken` class, but string above will return you ticker of the Polymath token.
23
+
This is how it works.
24
+
25
+
No excess wrappers means no excess documentation and tests.
26
+
27
+
## Needs from polymath-core
28
+
1. Versioned npm package (with changelog for each new version) with built-in contracts artifacts, which should contain contracts addresses for each network.
29
+
2. Complete and up-to-date documentation since Polymath.js will inherit it in many ways.
function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}
24
+
25
+
function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function") ? call : self;}
26
+
27
+
function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor: {value: subClass,enumerable: false,writable: true,configurable: true}});if(superClass)Object.setPrototypeOf ? Object.setPrototypeOf(subClass,superClass) : subClass.__proto__=superClass;}// TODO @bshevchenko: will be replaced with artifact from polymath-core_v2 npm package
0 commit comments