Skip to content

Commit 1be587c

Browse files
committed
fix: polymathbase manual merge
2 parents 0c5ef5c + 21cd2e4 commit 1be587c

26 files changed

+172
-132
lines changed

release.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
prerelease: true,
1010
},
1111
],
12-
/**
12+
/*
1313
* In this order the **prepare** step of @semantic-release/npm will run first
1414
* followed by @semantic-release/git:
1515
* - Update the package.json version and create the npm package tarball

src/PolymathBase.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ import {
3131
isPercentageTransferManager,
3232
isVolumeRestrictionTransferManager,
3333
isRestrictedPartialSaleTransferManager,
34+
EtherDividendCheckpoint,
3435
} from '@polymathnetwork/contract-wrappers';
3536
import { range, flatten } from 'lodash';
3637
import P from 'bluebird';
3738
import semver from 'semver';
3839
import { PolymathError } from './PolymathError';
39-
import { ErrorCode, Module, SecurityTokenRole, ShareholderBalance } from './types';
40+
import { ErrorCode, SecurityTokenRole, ShareholderBalance } from './types';
4041
import { ZERO_ADDRESS } from './utils/constants';
4142

4243
interface GetModuleAddressesByNameParams {
@@ -192,6 +193,22 @@ export interface BaseDividend {
192193
shareholders: DividendShareholderStatus[];
193194
}
194195

196+
export type Module =
197+
| GeneralPermissionManager
198+
| GeneralTransferManager
199+
| BlacklistTransferManager
200+
| LockUpTransferManager
201+
| CountTransferManager
202+
| ManualApprovalTransferManager
203+
| PercentageTransferManager
204+
| VolumeRestrictionTransferManager
205+
| RestrictedPartialSaleTransferManager
206+
| CappedSTO
207+
| USDTieredSTO
208+
| ERC20DividendCheckpoint
209+
| EtherDividendCheckpoint
210+
| VestingEscrowWallet;
211+
195212
export class PolymathBase extends PolymathAPI {
196213
public getModuleFactoryAddress = async ({
197214
moduleName,

src/entities/SecurityToken/Documents.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ export class Documents extends SubModule {
7070
let securityTokenInstance;
7171

7272
try {
73-
securityTokenInstance = await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
74-
symbol
75-
);
73+
// prettier-ignore
74+
securityTokenInstance =
75+
await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
76+
symbol
77+
);
7678
} catch (err) {
7779
throw new PolymathError({
7880
code: ErrorCode.FetcherValidationError,
@@ -97,9 +99,11 @@ export class Documents extends SubModule {
9799
let securityTokenInstance;
98100

99101
try {
100-
securityTokenInstance = await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
101-
symbol
102-
);
102+
// prettier-ignore
103+
securityTokenInstance =
104+
await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
105+
symbol
106+
);
103107
} catch (err) {
104108
throw new PolymathError({
105109
code: ErrorCode.FetcherValidationError,

src/entities/SecurityToken/Shareholders.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ export class Shareholders extends SubModule {
227227
let securityTokenInstance;
228228

229229
try {
230-
securityTokenInstance = await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
231-
symbol
232-
);
230+
// prettier-ignore
231+
securityTokenInstance =
232+
await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
233+
symbol
234+
);
233235
} catch (err) {
234236
throw new PolymathError({
235237
code: ErrorCode.FetcherValidationError,
@@ -251,9 +253,11 @@ export class Shareholders extends SubModule {
251253
let securityTokenInstance;
252254

253255
try {
254-
securityTokenInstance = await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
255-
symbol
256-
);
256+
// prettier-ignore
257+
securityTokenInstance =
258+
await contractWrappers.tokenFactory.getSecurityTokenInstanceFromTicker(
259+
symbol
260+
);
257261
} catch (err) {
258262
throw new PolymathError({
259263
code: ErrorCode.FetcherValidationError,

src/procedures/AssignSecurityTokenRole.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class AssignSecurityTokenRole extends Procedure<AssignSecurityTokenRolePr
6666
const exists =
6767
delegates.filter(element => element.toUpperCase() === delegate.toUpperCase()).length > 0;
6868

69-
/**
69+
/*
7070
* In the following block we attempt to:
7171
* - Find whether the delegate address is already present. Otherwise add them
7272
* - Find whether the current delegate permission is equal to the provided one. Otherwise change permissions

src/procedures/AssignStoRole.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class AssignStoRole extends Procedure<AssignStoRoleProcedureArgs> {
4343
const delegates = await permissionModule.getAllDelegates();
4444
const exists = delegates.filter(element => element === delegate).length > 0;
4545

46-
/**
46+
/*
4747
* In the following block we attempt to:
4848
* - Find whether the delegate address is already present. Otherwise add them
4949
* - Find whether the current delegate permission is equal to the provided one. Otherwise change permissions

src/procedures/ControllerRedeem.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ export class ControllerRedeem extends Procedure<ControllerRedeemProcedureArgs> {
3737
const { symbol, amount, from, reason = '', data = '' } = this.args;
3838
const { contractWrappers, currentWallet, factories } = this.context;
3939

40-
/**
40+
/*
4141
* Validation
4242
*/
43-
4443
if (!isValidAddress(from)) {
4544
throw new PolymathError({
4645
code: ErrorCode.InvalidAddress,
@@ -82,7 +81,7 @@ export class ControllerRedeem extends Procedure<ControllerRedeemProcedureArgs> {
8281
});
8382
}
8483

85-
/**
84+
/*
8685
* Transactions
8786
*/
8887
await this.addTransaction(securityToken.controllerRedeem, {

src/procedures/ControllerTransfer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ export class ControllerTransfer extends Procedure<ControllerTransferProcedureArg
4141
const { contractWrappers, currentWallet, factories } = this.context;
4242
const addresses: { [key: string]: string } = { from, to };
4343

44-
/**
44+
/*
4545
* Validation
4646
*/
47-
4847
Object.keys(addresses).forEach(key => {
4948
if (!isValidAddress(addresses[key])) {
5049
throw new PolymathError({
@@ -88,10 +87,9 @@ export class ControllerTransfer extends Procedure<ControllerTransferProcedureArg
8887
});
8988
}
9089

91-
/**
90+
/*
9291
* Transactions
9392
*/
94-
9593
await this.addTransaction(securityToken.controllerTransfer, {
9694
tag: PolyTransactionTag.ControllerTransfer,
9795
resolvers: [createControllerTransferResolver(factories, symbol, from, to)],

src/procedures/DisableController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class DisableController extends Procedure<DisableControllerProcedureArgs>
5151
const requestedSignature =
5252
signature || (await this.addSignatureRequest(securityToken.signDisableControllerAck)({}));
5353

54-
/**
54+
/*
5555
* Transactions
5656
*/
5757
await this.addTransaction(securityToken.disableController, {

src/procedures/FinalizeSto.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ export class FinalizeSto extends Procedure<FinalizeStoProcedureArgs> {
1818
const { stoAddress, stoType, symbol } = this.args;
1919
const { contractWrappers, factories } = this.context;
2020

21-
/**
21+
/*
2222
* Validation
2323
*/
24-
2524
let securityToken;
2625

2726
try {
@@ -115,10 +114,9 @@ export class FinalizeSto extends Procedure<FinalizeStoProcedureArgs> {
115114
});
116115
}
117116

118-
/**
117+
/*
119118
* Transactions
120119
*/
121-
122120
await this.addTransaction(stoModule.finalize, {
123121
tag: PolyTransactionTag.FinalizeSto,
124122
resolvers: [

0 commit comments

Comments
 (0)