Skip to content

Commit 4da5a87

Browse files
authored
Merge pull request #681 from PolymathNetwork/release
v2.4
2 parents 80c9d5e + 83427b3 commit 4da5a87

File tree

35 files changed

+260
-69
lines changed

35 files changed

+260
-69
lines changed

config/contractDocs.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const config = {
168168
SecurityToken: {
169169
description: stripIndent`
170170
The security token smart contract. It defines the behavior of the
171-
Security Tokens created through Polymath.
171+
Security Tokens configured through Polymath.
172172
173173
Only the token's owner and the attached STO module (if there is one) can
174174
mint tokens.
@@ -180,9 +180,9 @@ const config = {
180180
Keeps track of all the Security Tokens that exist in the network.
181181
Keeps record of the tickers reserved by users.
182182
183-
Through this contract Security Tokens can be created and Tickers can be registered.
183+
Through this contract Security Tokens can be configured and Tickers can be registered.
184184
It requires an allowance (of at least the registration fee) to be set to be able
185-
to create a Security Token
185+
to configure a Security Token
186186
`,
187187
methods: SecurityTokenRegistryMethods,
188188
},

packages/new-polymath-sdk/src/browserUtils.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface Ethereum extends HttpProvider {
1414
networkVersion: string;
1515
_metamask?: {
1616
isApproved: () => Promise<boolean>;
17+
isUnlocked: () => Promise<boolean>;
1718
};
1819
enable(): Promise<any>;
1920
}
@@ -117,14 +118,10 @@ export async function getCurrentAddress() {
117118
const support = getBrowserSupport();
118119

119120
if (isModern(win)) {
120-
// Special check for Metamask to know if it is locked or not
121121
if (win.ethereum._metamask) {
122-
const isApproved = await win.ethereum._metamask.isApproved();
123-
if (isApproved) {
124-
accounts = await web3.eth.getAccounts();
125-
if (!accounts.length) {
126-
throw new PolymathError({ code: ErrorCodes.WalletIsLocked });
127-
}
122+
const isUnlocked = await win.ethereum._metamask.isUnlocked();
123+
if (!isUnlocked) {
124+
throw new PolymathError({ code: ErrorCodes.WalletIsLocked });
128125
}
129126
}
130127
await enableWallet();
306 KB
Loading
3.54 KB
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { SecurityTokenRegistry } from '@polymathnetwork/js';
2+
3+
export const TICKER_LIST = 'account/TICKER_LIST';
4+
export const getTickerList = tickers => ({
5+
type: TICKER_LIST,
6+
tickers,
7+
});
8+
9+
export const fetchTickerList = () => async (
10+
dispatch: Function,
11+
getState: GetState
12+
) => {
13+
const str = await SecurityTokenRegistry.create();
14+
const walletAddress = getState().session.wallet.address;
15+
const newTokens = await str.getTickersByOwner(walletAddress);
16+
dispatch(getTickerList(newTokens));
17+
};

packages/polymath-issuer/src/actions/sto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const fetch = () => async (dispatch: Function, getState: GetState) => {
121121
try {
122122
const { token } = getState().token;
123123

124-
// No token created yet
124+
// No token configured yet
125125
if (!token || !token.contract) {
126126
dispatch(ui.fetched());
127127
return;

packages/polymath-issuer/src/actions/token.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ export const issue = (values: Object) => async (
209209
ui.confirm(
210210
<div>
211211
<p>
212-
Completion of your token creation will require{' '}
212+
Completion of your token configuration will require{' '}
213213
{limitInvestors ? 'three' : !isApproved ? 'two' : 'one'} wallet
214214
transaction(s).
215215
</p>
216216
{!isApproved ? (
217217
<div>
218218
<p>
219219
• The first transaction will be used to prepare for the payment of
220-
the token creation cost of:
220+
the token configuration cost of:
221221
</p>
222222
<div className="bx--details poly-cost">{feeView} POLY</div>
223223
</div>
@@ -226,8 +226,8 @@ export const issue = (values: Object) => async (
226226
)}
227227
<p>
228228
{!isApproved ? 'The second' : 'This'} transaction will be used to
229-
pay for the token creation cost (POLY + mining fee) to complete the
230-
creation of your token.
229+
pay for the token configuration cost (POLY + mining fee) to complete
230+
the configuration of your token.
231231
</p>
232232
{limitInvestors && (
233233
<p>
@@ -239,19 +239,19 @@ export const issue = (values: Object) => async (
239239
)}
240240
<p>
241241
Please hit &laquo;CONFIRM&raquo; when you are ready to proceed. Once
242-
you hit &laquo;CONFIRM&raquo;, your security token will be created on
243-
the blockchain.
242+
you hit &laquo;CONFIRM&raquo;, your security token will be configured
243+
on the blockchain.
244244
<br />
245-
If you do not wish to pay the token creation fee or wish to review
246-
your information, simply select &laquo;CANCEL&raquo;.
245+
If you do not wish to pay the token configuration fee or wish to
246+
review your information, simply select &laquo;CANCEL&raquo;.
247247
</p>
248248
</div>,
249249
async () => {
250250
// $FlowFixMe
251251
if (getState().pui.account.balance.lt(fee)) {
252252
dispatch(
253253
ui.faucet(
254-
`The creation of a security token has a fixed cost of ${feeView} POLY.`
254+
`The configuration of a security token has a fixed cost of ${feeView} POLY.`
255255
)
256256
);
257257
return;
@@ -263,7 +263,7 @@ export const issue = (values: Object) => async (
263263
// );
264264

265265
//Skip approve transaction if transfer is already allowed
266-
let title = ['Creating Security Token'];
266+
let title = ['Configuring Security Token'];
267267

268268
if (!isApproved) {
269269
title.unshift('Approving POLY Spend');
@@ -303,11 +303,11 @@ export const issue = (values: Object) => async (
303303
`/dashboard/${ticker}`,
304304
undefined,
305305
false,
306-
ticker.toUpperCase() + ' Token Creation'
306+
ticker.toUpperCase() + ' Token Configuration'
307307
)
308308
);
309309
},
310-
`Before you Proceed with Your ${ticker.toUpperCase()} Token Creation`,
310+
`Before you Proceed with Your ${ticker.toUpperCase()} Token Configuration`,
311311
undefined,
312312
'pui-large-confirm-modal'
313313
)

packages/polymath-issuer/src/components/MigrateTokenPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ class MigrateTokenPage extends Component<{| handleClick: Function |}> {
231231
<p>
232232
The cost of this migration is the gas fee required to complete
233233
the simple 2-step process to migrate your tokens from v1.3.0 to
234-
v2.0.0. The cost of creating the security token will be borne by
235-
Polymath.
234+
v2.0.0. The cost of configuring the security token will be borne
235+
by Polymath.
236236
</p>
237237
</AccordionItem>
238238
<AccordionItem title="What benefits would I get by moving to v2.0.0?">
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React, { Component } from 'react';
2+
import { PageCentered, Button, Toaster, notify } from '@polymathnetwork/ui';
3+
import { Link } from 'react-router-dom';
4+
5+
export default class TickerCard extends Component {
6+
render() {
7+
const { ticker } = this.props;
8+
return (
9+
<div className="token-symbol-wrapper">
10+
<div className="pui-page-box">
11+
<h3>Configure New Security Token</h3>
12+
<div style={{ height: '140px' }} />
13+
<br />
14+
<Link to="/ticker">
15+
<Button kind="secondary" className="export-tokens-list-btn">
16+
Get Started
17+
</Button>
18+
</Link>
19+
</div>
20+
</div>
21+
);
22+
}
23+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React, { Component } from 'react';
2+
import { PageCentered, Button, Toaster, notify } from '@polymathnetwork/ui';
3+
import { Link } from 'react-router-dom';
4+
5+
export default class TickerCard extends Component {
6+
render() {
7+
const { ticker } = this.props;
8+
return (
9+
<div className="token-symbol-wrapper">
10+
<div className="pui-page-box">
11+
<div className="ticker-field">
12+
<div className="bx--form-item">
13+
<label htmlFor="ticker" className="bx--label">
14+
Token Symbol
15+
</label>
16+
<input
17+
type="text"
18+
name="ticker"
19+
value={ticker}
20+
id="ticker"
21+
readOnly
22+
className="bx--text-input bx--text__input"
23+
/>
24+
</div>
25+
</div>
26+
<br />
27+
<Link to={`/dashboard/${ticker}`}>
28+
<Button kind="secondary" className="export-tokens-list-btn">
29+
Open Dashboard
30+
</Button>
31+
</Link>
32+
</div>
33+
</div>
34+
);
35+
}
36+
}

0 commit comments

Comments
 (0)