Skip to content

Commit cff59bf

Browse files
author
Fahd
committed
Merge remote-tracking branch 'origin/develop' into feature/general-permission
2 parents 2188e36 + 2c4546d commit cff59bf

14 files changed

Lines changed: 97 additions & 25 deletions

File tree

100 KB
Loading
29.8 KB
Loading

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
Footer,
1717
EnterPINModal,
1818
StickyTop,
19+
notify,
1920
} from '@polymathnetwork/ui';
2021

2122
import { getMyTokens } from '../actions/ticker';
@@ -42,6 +43,7 @@ type DispatchProps = {|
4243
signIn: () => any,
4344
getMyTokens: () => any,
4445
getNotice: (scope: string) => any,
46+
notify: (title: string, isSuccess: boolean, '', '', isPinned: boolean) => any,
4547
|};
4648

4749
const mapStateToProps = (state: RootState): StateProps => ({
@@ -63,6 +65,7 @@ const mapDispatchToProps: DispatchProps = {
6365
signIn,
6466
getMyTokens,
6567
getNotice,
68+
notify,
6669
};
6770

6871
type Props = {|

packages/polymath-issuer/src/pages/home/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React, { Component } from 'react';
22
import { Link } from 'react-router-dom';
3-
import { PageCentered, Button } from '@polymathnetwork/ui';
3+
import { PageCentered, Button, Toaster, notify } from '@polymathnetwork/ui';
4+
import { connect } from 'react-redux';
45

5-
export default class HomePage extends Component {
6+
class HomePage extends Component {
67
render() {
78
return (
89
<PageCentered title="Polymath" justifyContent="start">
10+
<Toaster />
911
<div className="splash-background-pattern" />
1012
<div className="splash-background" />
1113
<div>
@@ -33,3 +35,5 @@ export default class HomePage extends Component {
3335
);
3436
}
3537
}
38+
39+
export default connect()(HomePage);

packages/polymath-issuer/src/pages/providers/data.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ const providers: Array<ServiceProvider> = [
389389
{
390390
id: 48,
391391
cat: 1,
392-
title: 'IBL',
392+
title: 'International Blockchain Legal LLP',
393393
logo: '/providers/legal/iblpartners.png',
394394
background: '/providers/legal/bg/img-iblpartners.png',
395395
desc:
@@ -634,6 +634,16 @@ const providers: Array<ServiceProvider> = [
634634
wallet balancing and clearing of stablecoin trades. DAVOS operations are designed according to ISO 27001 standard and located \
635635
in a high-security vault in Singapore. ',
636636
},
637+
{
638+
id: 49,
639+
cat: 4,
640+
title: 'Formosa Financial',
641+
logo: '/providers/custody/formosa.png',
642+
background: '/providers/custody/bg/img-formosa.png',
643+
desc:
644+
'Formosa Financial provides an integrated treasury management solution with insured multi-sig custody \
645+
and crypto-to-fiat brokerage services.',
646+
},
637647

638648
// TOKEN SALE PLATFORMS
639649
{

packages/polymath-issuer/src/routes.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// @flow
22
import React from 'react';
3-
import { NotFoundPage, MaintenancePage } from '@polymathnetwork/ui';
3+
import {
4+
NotFoundPage,
5+
MaintenancePage,
6+
ProvidersMaintenancePage,
7+
} from '@polymathnetwork/ui';
48
import { Redirect } from 'react-router-dom';
59

610
import App from './components/App';

packages/polymath-js/src/contracts/SecurityTokenRegistry.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import type {
2424

2525
const NEW_SECURITY_TOKEN_EVENT = 'NewSecurityToken';
2626
const REGISTER_TICKER_EVENT = 'RegisterTicker';
27+
const REFRESHED_SECURITY_TOKEN_EVENT = 'SecurityTokenRefreshed';
2728

2829
class SecurityTokenRegistry extends Contract {
2930
constructor(artifact: any, address: string) {
@@ -190,25 +191,28 @@ class SecurityTokenRegistry extends Contract {
190191
token.owner = await contract.owner();
191192

192193
// get token issuing tx hash
194+
const eventOpts = {
195+
filter: { _securityTokenAddress: token.address },
196+
fromBlock: 0,
197+
toBlock: 'latest',
198+
};
199+
193200
let events = await this._contractWS.getPastEvents(
194201
NEW_SECURITY_TOKEN_EVENT,
195-
{
196-
filter: { _securityTokenAddress: token.address },
197-
fromBlock: 0,
198-
toBlock: 'latest',
199-
}
202+
eventOpts
203+
);
204+
const events3 = await this._contractWS.getPastEvents(
205+
REFRESHED_SECURITY_TOKEN_EVENT,
206+
eventOpts
200207
);
201208
if (semver.eq(this.version, LATEST_PROTOCOL_VERSION)) {
202209
const str2 = new SecurityTokenRegistry(artifact2, this.address);
203210
const events2 = await str2._contractWS.getPastEvents(
204211
NEW_SECURITY_TOKEN_EVENT,
205-
{
206-
filter: { _securityTokenAddress: token.address },
207-
fromBlock: 0,
208-
toBlock: 'latest',
209-
}
212+
eventOpts
210213
);
211-
events = [...events, ...events2];
214+
215+
events = [...events, ...events2, ...events3];
212216
}
213217
token.txHash = events[0].transactionHash;
214218
token.timestamp = await this._getBlockDate(events[0].blockNumber);

packages/polymath-offchain/src/startup/__tests__/setupWeb3.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ const contractMock = jest.fn().mockImplementation(() => {
112112
RegisterTicker: registerTickerListenerMock,
113113
ModuleAdded: moduleAddedListenerMock,
114114
NewSecurityToken: newSecurityTokenListenerMock,
115+
SecurityTokenRefreshed: newSecurityTokenListenerMock,
115116
},
116117
getPastEvents: getPastEventsMock,
117118
methods: {

packages/polymath-offchain/src/startup/setupWeb3.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import logger from 'winston';
1111
import Web3 from 'web3';
1212
import { User } from '../models';
1313
import PolymathRegistryArtifact from '@polymathnetwork/polymath-scripts/fixtures/contracts/PolymathRegistry.json';
14-
import SecurityTokenRegistryArtifact from '@polymathnetwork/polymath-scripts/fixtures/contracts/ISecurityTokenRegistry.json';
14+
import SecurityTokenRegistryArtifact from '@polymathnetwork/polymath-scripts/fixtures/contracts/SecurityTokenRegistry.json';
1515
import SecurityTokenArtifact from '@polymathnetwork/polymath-scripts/fixtures/contracts/ISecurityToken.json';
1616
import CappedSTOArtifact from '@polymathnetwork/polymath-scripts/fixtures/contracts/CappedSTO.json';
1717
import STOModuleFactoryArtifacts from '@polymathnetwork/polymath-scripts/fixtures/contracts/ModuleFactory.json';
@@ -512,6 +512,10 @@ export const addTokenCreateListener = async (networkId: string) => {
512512
newSecurityTokenHandler(contract, networkId, error, result)
513513
);
514514

515+
contract.events.SecurityTokenRefreshed({}, (error, result) =>
516+
newSecurityTokenHandler(contract, networkId, error, result)
517+
);
518+
515519
logger.info(
516520
`[SETUP] Listening for Security Token deployments in ${NETWORKS[
517521
networkId
@@ -526,14 +530,17 @@ export const addTokenCreateListener = async (networkId: string) => {
526530
export const addSTOListeners = async (networkId: string) => {
527531
const contract = await getSTRContract(networkId);
528532
try {
529-
const previousTokenEvents = await contract.getPastEvents(
530-
'NewSecurityToken',
531-
{
532-
fromBlock: 0,
533-
toBlock: 'latest',
534-
}
535-
);
533+
let newSTs = await contract.getPastEvents('NewSecurityToken', {
534+
fromBlock: 0,
535+
toBlock: 'latest',
536+
});
537+
538+
let refreshedSTs = await contract.getPastEvents('SecurityTokenRefreshed', {
539+
fromBlock: 0,
540+
toBlock: 'latest',
541+
});
536542

543+
const previousTokenEvents = [...newSTs, ...refreshedSTs];
537544
for (let event of previousTokenEvents) {
538545
const {
539546
returnValues: { _securityTokenAddress, _ticker },

packages/polymath-offchain/src/utils/emails.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,20 @@ export const sendEmail = async (
4242
from: { email: 'noreply@polymath.network', name: 'Polymath Network' },
4343
replyTo,
4444
to: { email, name },
45-
cc: copyTo,
45+
// @FIXME remon-nashid: requests to SendGrid fail when cc and receiver addresses are the same.
46+
// hardcoding CC email to my email to save the day.
47+
cc: 'remon@polymath.network',
4648
subject,
4749
html: body,
4850
};
4951
if (SENDGRID_API_KEY) {
50-
await sgMail.send(msg);
52+
try {
53+
await sgMail.send(msg);
54+
} catch (error) {
55+
logger.error('SendGrid error:', error.response.body.errors);
56+
// Still throw the error in order to send it to Sentry.
57+
throw error;
58+
}
5159
} else {
5260
logger.warn('Not sending email since SENDGRID_API_KEY is not set.');
5361
logger.warn(JSON.stringify(msg));

0 commit comments

Comments
 (0)