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

Commit 1fec42e

Browse files
author
Victor Wiebe
committed
fix: outstanding naming and method argument naming on examples
1 parent 17d867f commit 1fec42e

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

examples/cappedSTO.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ window.addEventListener('load', async () => {
2626
const TEST = await polymathAPI.tokenFactory.getSecurityTokenInstanceFromAddress(tokenAddress);
2727

2828
const moduleStringName = 'CappedSTO';
29-
const moduleName = ModuleName.cappedSTO;
29+
const moduleName = ModuleName.CappedSTO;
3030

3131
const modules = await polymathAPI.moduleRegistry.getModulesByType({
3232
moduleType: ModuleType.TransferManager,

examples/investInCappedSTO.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ window.addEventListener('load', async () => {
2323
const tokenAddress = await polymathAPI.securityTokenRegistry.getSecurityTokenAddress(ticker);
2424
const TEST = await polymathAPI.tokenFactory.getSecurityTokenInstanceFromAddress(tokenAddress);
2525

26-
const cappedSTOAddress = (await TEST.getModulesByName({ moduleName: ModuleName.cappedSTO }))[0];
26+
const cappedSTOAddress = (await TEST.getModulesByName({ moduleName: ModuleName.CappedSTO }))[0];
2727
const cappedSTO = await polymathAPI.moduleFactory.getModuleInstance({
28-
name: ModuleName.cappedSTO,
28+
name: ModuleName.CappedSTO,
2929
address: cappedSTOAddress,
3030
});
3131

32-
const generalTMAddress = (await TEST.getModulesByName({ moduleName: ModuleName.generalTransferManager }))[0];
32+
const generalTMAddress = (await TEST.getModulesByName({ moduleName: ModuleName.GeneralTransferManager }))[0];
3333
const generalTM = await polymathAPI.moduleFactory.getModuleInstance({
34-
name: ModuleName.generalTransferManager,
34+
name: ModuleName.GeneralTransferManager,
3535
address: generalTMAddress,
3636
});
3737

examples/mintTokenToInvestor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ window.addEventListener('load', async () => {
2323
const tokenAddress = await polymathAPI.securityTokenRegistry.getSecurityTokenAddress(ticker);
2424
const TEST = await polymathAPI.tokenFactory.getSecurityTokenInstanceFromAddress(tokenAddress);
2525
const investorAddress = '<investor address>'.toLowerCase();
26-
const generalTMAddress = (await TEST.getModulesByName({ moduleName: ModuleName.generalTransferManager }))[0];
26+
const generalTMAddress = (await TEST.getModulesByName({ moduleName: ModuleName.GeneralTransferManager }))[0];
2727

2828
const generalTM = await polymathAPI.moduleFactory.getModuleInstance({
2929
name: ModuleName.GeneralTransferManager,

examples/percentageTransferManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ window.addEventListener('load', async () => {
2222
const ticker = 'TEST';
2323
const tickerSecurityTokenInstance = await polymathAPI.tokenFactory.getSecurityTokenInstanceFromTicker(ticker);
2424
const moduleStringName = 'PercentageTransferManager';
25-
const moduleName = ModuleName.percentageTransferManager;
25+
const moduleName = ModuleName.PercentageTransferManager;
2626

2727
// Get permission manager factory address
2828
const modules = await polymathAPI.moduleRegistry.getModulesByType({

examples/usdTieredSTO.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ window.addEventListener('load', async () => {
6262
});
6363

6464
const moduleStringName = 'USDTieredSTO';
65-
const moduleName = ModuleName.usdTieredSTO;
65+
const moduleName = ModuleName.UsdTieredSTO;
6666
const modules = await polymathAPI.moduleRegistry.getModulesByType({
6767
moduleType: ModuleType.STO,
6868
});
@@ -113,17 +113,17 @@ window.addEventListener('load', async () => {
113113
minimumInvestmentUSD: new BigNumber(5),
114114
fundRaiseTypes: [FundRaiseType.ETH, FundRaiseType.POLY],
115115
wallet: '0x3333333333333333333333333333333333333333',
116-
reserveWallet: '0x5555555555555555555555555555555555555555',
116+
treasuryWallet: '0x5555555555555555555555555555555555555555',
117117
usdTokens: ['0x6666666666666666666666666666666666666666', '0x4444444444444444444444444444444444444444'],
118118
},
119119
});
120120
console.log(usdTieredResult);
121121

122122
const usdTieredAddress = (await tickerSecurityTokenInstance.getModulesByName({
123-
moduleName: ModuleName.usdTieredSTO,
123+
moduleName: ModuleName.UsdTieredSTO,
124124
}))[0];
125125
const usdTiered = await polymathAPI.moduleFactory.getModuleInstance({
126-
name: ModuleName.usdTieredSTO,
126+
name: ModuleName.UsdTieredSTO,
127127
address: usdTieredAddress,
128128
});
129129
const buyWithETH = await usdTiered.buyWithETH({ value: new BigNumber(1), beneficiary: myAddress });

examples/volumeRestrictionTransferManager.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { VolumeRestrictionTMEvents } from '@polymathnetwork/abi-wrappers';
44
import ModuleFactoryWrapper from '../src/contract_wrappers/modules/module_factory_wrapper';
55
import { ApiConstructorParams, PolymathAPI } from '../src/PolymathAPI';
66
import { bytes32ToString } from '../src/utils/convert';
7-
import { ModuleName, ModuleType, RestrictionTypes } from '../src';
7+
import { ModuleName, ModuleType, RestrictionType } from '../src';
88

99
// This file acts as a valid sandbox for using a volume restriction transfer manager module on an unlocked node (like ganache)
1010

@@ -67,7 +67,7 @@ window.addEventListener('load', async () => {
6767

6868
// Get sto factory address
6969
const moduleStringName = 'VolumeRestrictionTM';
70-
const moduleName = ModuleName.volumeRestrictionTM;
70+
const moduleName = ModuleName.VolumeRestrictionTM;
7171

7272
const modules = await polymathAPI.moduleRegistry.getModulesByType({
7373
moduleType: ModuleType.TransferManager,
@@ -104,25 +104,25 @@ window.addEventListener('load', async () => {
104104

105105
// Get Count TM address and create count transfer manager
106106
const vrtmAddress = (await tickerSecurityTokenInstance.getModulesByName({
107-
moduleName: ModuleName.volumeRestrictionTM,
107+
moduleName: ModuleName.VolumeRestrictionTM,
108108
}))[0];
109109
const vrtm = await polymathAPI.moduleFactory.getModuleInstance({
110-
name: ModuleName.volumeRestrictionTM,
110+
name: ModuleName.VolumeRestrictionTM,
111111
address: vrtmAddress,
112112
});
113113

114114
// Get General TM Address and allow all transfers so we can test unlocked account transfers
115115
const generalTMAddress = (await tickerSecurityTokenInstance.getModulesByName({
116-
moduleName: ModuleName.generalTransferManager,
116+
moduleName: ModuleName.GeneralTransferManager,
117117
}))[0];
118118
const generalTM = await polymathAPI.moduleFactory.getModuleInstance({
119-
name: ModuleName.generalTransferManager,
119+
name: ModuleName.GeneralTransferManager,
120120
address: generalTMAddress,
121121
});
122122
await generalTM.changeAllowAllTransfers({ allowAllTransfers: true });
123123

124124
// Mint yourself some tokens and make some transfers
125-
await tickerSecurityTokenInstance.mint({ investor: myAddress, value: new BigNumber(1000) });
125+
await tickerSecurityTokenInstance.issue({ investor: myAddress, value: new BigNumber(1000), data: '' });
126126

127127
// VRTM
128128
const delay = 3000;
@@ -149,7 +149,7 @@ window.addEventListener('load', async () => {
149149
startTime: new Date(Date.now().valueOf() + delay),
150150
endTime: new Date(2035, 1),
151151
rollingPeriodInDays: 1,
152-
restrictionType: RestrictionTypes.Fixed,
152+
restrictionType: RestrictionType.Fixed,
153153
allowedTokens: new BigNumber(10),
154154
});
155155
// Transfer
@@ -160,12 +160,12 @@ window.addEventListener('load', async () => {
160160
startTime: new Date(Date.now().valueOf() + delay),
161161
endTime: new Date(2035, 1),
162162
allowedTokens: new BigNumber(50),
163-
restrictionType: RestrictionTypes.Percentage,
163+
restrictionType: RestrictionType.Percentage,
164164
});
165165
await tickerSecurityTokenInstance.transfer({ to: randomBeneficiary2, value: new BigNumber(20) });
166166
// Remove
167167
await vrtm.removeIndividualDailyRestriction({
168-
holder: myAddress,
168+
investor: myAddress,
169169
});
170170

171171
// Add individual restriction
@@ -174,7 +174,7 @@ window.addEventListener('load', async () => {
174174
startTime: new Date(Date.now().valueOf() + delay),
175175
endTime: new Date(2035, 1),
176176
allowedTokens: new BigNumber(20),
177-
restrictionType: RestrictionTypes.Fixed,
177+
restrictionType: RestrictionType.Fixed,
178178
rollingPeriodInDays: 2,
179179
});
180180
// Modify individual restriction
@@ -183,14 +183,14 @@ window.addEventListener('load', async () => {
183183
startTime: new Date(Date.now().valueOf() + delay),
184184
endTime: new Date(2035, 2),
185185
allowedTokens: new BigNumber(25),
186-
restrictionType: RestrictionTypes.Fixed,
186+
restrictionType: RestrictionType.Fixed,
187187
rollingPeriodInDays: 2,
188188
});
189189
// Transfer
190190
await tickerSecurityTokenInstance.transfer({ to: randomBeneficiary1, value: new BigNumber(15) });
191191
// Remove
192192
await vrtm.removeIndividualRestriction({
193-
holder: randomBeneficiary1,
193+
investor: randomBeneficiary1,
194194
});
195195

196196
// Add Individual Daily Restriction Multi
@@ -199,7 +199,7 @@ window.addEventListener('load', async () => {
199199
startTimes: [new Date(Date.now().valueOf() + delay), new Date(Date.now().valueOf() + delay)],
200200
endTimes: [new Date(2035, 1), new Date(2035, 1)],
201201
allowedTokens: [new BigNumber(20), new BigNumber(20)],
202-
restrictionTypes: [RestrictionTypes.Fixed, RestrictionTypes.Fixed],
202+
restrictionTypes: [RestrictionType.Fixed, RestrictionType.Fixed],
203203
});
204204
// Transfers
205205
await tickerSecurityTokenInstance.transfer({ to: randomBeneficiary1, value: new BigNumber(10) });
@@ -210,7 +210,7 @@ window.addEventListener('load', async () => {
210210
startTimes: [new Date(Date.now().valueOf() + delay), new Date(Date.now().valueOf() + delay)],
211211
endTimes: [new Date(2035, 2), new Date(2035, 2)],
212212
allowedTokens: [new BigNumber(30), new BigNumber(30)],
213-
restrictionTypes: [RestrictionTypes.Fixed, RestrictionTypes.Fixed],
213+
restrictionTypes: [RestrictionType.Fixed, RestrictionType.Fixed],
214214
});
215215
// Remove Individual Daily Restriction Multi
216216
await vrtm.removeIndividualDailyRestrictionMulti({ holders: [myAddress, randomBeneficiary2] });
@@ -221,7 +221,7 @@ window.addEventListener('load', async () => {
221221
startTimes: [new Date(Date.now().valueOf() + delay), new Date(Date.now().valueOf() + delay)],
222222
endTimes: [new Date(2035, 1), new Date(2035, 1)],
223223
allowedTokens: [new BigNumber(20), new BigNumber(20)],
224-
restrictionTypes: [RestrictionTypes.Fixed, RestrictionTypes.Fixed],
224+
restrictionTypes: [RestrictionType.Fixed, RestrictionType.Fixed],
225225
rollingPeriodInDays: [2, 3],
226226
});
227227
// Transfers
@@ -233,7 +233,7 @@ window.addEventListener('load', async () => {
233233
startTimes: [new Date(Date.now().valueOf() + delay), new Date(Date.now().valueOf() + delay)],
234234
endTimes: [new Date(2035, 2), new Date(2035, 2)],
235235
allowedTokens: [new BigNumber(30), new BigNumber(30)],
236-
restrictionTypes: [RestrictionTypes.Fixed, RestrictionTypes.Fixed],
236+
restrictionTypes: [RestrictionType.Fixed, RestrictionType.Fixed],
237237
rollingPeriodInDays: [3, 4],
238238
});
239239
// Remove
@@ -244,7 +244,7 @@ window.addEventListener('load', async () => {
244244
startTime: new Date(Date.now().valueOf() + delay),
245245
endTime: new Date(2035, 1),
246246
allowedTokens: new BigNumber(50),
247-
restrictionType: RestrictionTypes.Percentage,
247+
restrictionType: RestrictionType.Percentage,
248248
rollingPeriodInDays: 2,
249249
});
250250
// Transfers
@@ -255,7 +255,7 @@ window.addEventListener('load', async () => {
255255
startTime: new Date(Date.now().valueOf() + delay),
256256
endTime: new Date(2035, 2),
257257
allowedTokens: new BigNumber(45),
258-
restrictionType: RestrictionTypes.Percentage,
258+
restrictionType: RestrictionType.Percentage,
259259
rollingPeriodInDays: 3,
260260
});
261261
// Remove
@@ -266,7 +266,7 @@ window.addEventListener('load', async () => {
266266
startTime: new Date(Date.now().valueOf() + delay),
267267
endTime: new Date(2035, 1),
268268
allowedTokens: new BigNumber(80),
269-
restrictionType: RestrictionTypes.Percentage,
269+
restrictionType: RestrictionType.Percentage,
270270
});
271271
// Transfer
272272
await tickerSecurityTokenInstance.transfer({ to: randomBeneficiary1, value: new BigNumber(4) });
@@ -276,7 +276,7 @@ window.addEventListener('load', async () => {
276276
startTime: new Date(Date.now().valueOf() + delay),
277277
endTime: new Date(2036, 2),
278278
allowedTokens: new BigNumber(85),
279-
restrictionType: RestrictionTypes.Fixed,
279+
restrictionType: RestrictionType.Fixed,
280280
});
281281
// Remove the default daily restriction
282282
await vrtm.removeDefaultDailyRestriction({});

src/contract_wrappers/modules/transfer_manager/volume_restriction_transfer_manager_wrapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ export default class VolumeRestrictionTransferManagerWrapper extends ModuleWrapp
649649
);
650650
};
651651

652-
public removeIndividualRestrictionMulti = async (params: IndividualRestrictionMultiParams) => {
652+
public removeIndividualRestrictionMulti = async (params: RemoveIndividualRestrictionMultiParams) => {
653653
assert.assert(await this.isCallerAllowed(params.txData, Perm.Admin), 'Caller is not allowed');
654654
params.holders.forEach(address => assert.isNonZeroETHAddressHex('holders', address));
655655
await Promise.all(
@@ -681,7 +681,7 @@ export default class VolumeRestrictionTransferManagerWrapper extends ModuleWrapp
681681
);
682682
};
683683

684-
public removeIndividualDailyRestrictionMulti = async (params: IndividualRestrictionMultiParams) => {
684+
public removeIndividualDailyRestrictionMulti = async (params: RemoveIndividualRestrictionMultiParams) => {
685685
assert.assert(await this.isCallerAllowed(params.txData, Perm.Admin), 'Caller is not allowed');
686686
await Promise.all(
687687
params.holders.map(async holder =>

0 commit comments

Comments
 (0)