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

Commit 034a17d

Browse files
author
Victor Wiebe
committed
feat: 🎸 fix comments inside of percentageTM
1 parent 00fe0d5 commit 034a17d

File tree

5 files changed

+75
-17
lines changed

5 files changed

+75
-17
lines changed

‎src/contract_wrappers/modules/transfer_manager/blacklist_transfer_manager_wrapper.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,8 @@ export default class BlacklistTransferManagerWrapper extends ModuleWrapper {
683683
* Restrict the blacklist address to transfer tokens
684684
* if the current time is between the timeframe define for the
685685
* blacklist type associated with the from address
686-
* @return Parse transfer result
686+
* @return boolean transfer result
687+
* @return address
687688
*/
688689
public verifyTransfer = async (params: VerifyTransferParams): Promise<VerifyTransfer> => {
689690
assert.isETHAddressHex('from', params.from);

‎src/contract_wrappers/modules/transfer_manager/count_transfer_manager_wrapper.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,9 @@ export default class CountTransferManagerWrapper extends ModuleWrapper {
139139
};
140140

141141
/**
142-
*Used to verify the transfer transaction and prevent a transfer if it passes the allowed amount of token holders
143-
* @dev module.verifyTransfer is called by SecToken.canTransfer and does not receive the updated holderCount therefore
144-
* verifyTransfer has to manually account for pot. tokenholder changes (by mimicking TokenLib.adjustInvestorCount).
145-
* module.executeTransfer is called by SecToken.transfer|issue|others and receives an updated holderCount
146-
* as sectoken calls TokenLib.adjustInvestorCount before executeTransfer.
147-
* @return boolean transfer result
148-
* @return address
142+
* Used to verify the transfer transaction and prevent a transfer if it passes the allowed amount of token holders
143+
* @return boolean transfer result
144+
* @return address
149145
*/
150146
public verifyTransfer = async (params: VerifyTransferParams) => {
151147
assert.isETHAddressHex('from', params.from);

‎src/contract_wrappers/modules/transfer_manager/lock_up_transfer_manager_wrapper.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,9 @@ export default class LockUpTransferManagerWrapper extends ModuleWrapper {
487487
};
488488

489489
/**
490-
* Used to verify the transfer transaction and prevent locked up tokens from being transferred
490+
* Used to verify the transfer transaction and prevent locked up tokens from being transferred
491+
* @return boolean transfer result
492+
* @return address
491493
*/
492494
public verifyTransfer = async (params: VerifyTransferParams): Promise<VerifyTransfer> => {
493495
assert.isETHAddressHex('from', params.from);

‎src/contract_wrappers/modules/transfer_manager/manual_approval_transfer_manager_wrapper.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,8 @@ export default class ManualApprovalTransferManagerWrapper extends ModuleWrapper
313313

314314
/**
315315
* Used to verify the transfer transaction (View)
316-
* Restrict the blacklist address to transfer tokens
317-
* if the current time is between the time frame define for the
318-
* blacklist type associated with the from address
319-
* @return Parse transfer result
316+
* @return boolean transfer result
317+
* @return address
320318
*/
321319
public verifyTransfer = async (params: VerifyTransferParams) => {
322320
assert.isETHAddressHex('from', params.from);

‎src/contract_wrappers/modules/transfer_manager/percentage_transfer_manager_wrapper.ts‎

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,54 @@ interface GetPercentageTransferManagerLogsAsyncParams extends GetLogs {
9494
(params: GetUnpauseLogsAsyncParams): Promise<LogWithDecodedArgs<PercentageTransferManagerUnpauseEventArgs>[]>;
9595
}
9696

97+
/**
98+
* @param investorAddress Address of the investor
99+
*/
97100
interface InvestorAddressParams {
98101
investorAddress: string;
99102
}
100103

104+
/**
105+
* @param from Address of the sender
106+
* @param to Address of the receiver
107+
* @param amount
108+
* @param data
109+
*/
101110
interface VerifyTransferParams {
102111
from: string;
103112
to: string;
104113
amount: BigNumber;
105114
data: string;
106115
}
107116

117+
/**
118+
* @param maxHolderPercentage is the new maximum percentage
119+
*/
108120
interface ChangeHolderPercentageParams extends TxParams {
109121
maxHolderPercentage: BigNumber;
110122
}
111123

124+
/**
125+
* @param investor is the address to whitelist
126+
* @param valid whether or not the address it to be added or removed from the whitelist
127+
*/
112128
interface ModifyWhitelistParams extends TxParams {
113129
investor: string;
114130
valid: boolean;
115131
}
116132

133+
/**
134+
* @param investors Array of the addresses to whitelist
135+
* @param valids Array of boolean value to decide whether or not the address it to be added or removed from the whitelist
136+
*/
117137
interface ModifyWhitelistMultiParams extends TxParams {
118138
investors: string[];
119139
valids: boolean[];
120140
}
121141

142+
/**
143+
* @param allowPrimaryIssuance whether to allow all primary issuance transfers
144+
*/
122145
interface SetAllowPrimaryIssuanceParams extends TxParams {
123146
allowPrimaryIssuance: boolean;
124147
}
@@ -143,36 +166,62 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
143166
this.contract = contract;
144167
}
145168

146-
public allowPrimaryIssuance = async () => {
169+
/**
170+
* Ignore transactions which are part of the primary issuance
171+
* @return boolean allowed
172+
*/
173+
public allowPrimaryIssuance = async (): Promise<boolean> => {
147174
return (await this.contract).allowPrimaryIssuance.callAsync();
148175
};
149176

150-
public maxHolderPercentage = async () => {
177+
/**
178+
* Maximum percentage that any holder can have, multiplied by 10**16
179+
* @return percentage value
180+
*/
181+
public maxHolderPercentage = async (): Promise<BigNumber> => {
151182
const result = await (await this.contract).maxHolderPercentage.callAsync();
152183
return weiToValue(result, PERCENTAGE_DECIMALS);
153184
};
154185

186+
/**
187+
* unpause the module
188+
*/
155189
public unpause = async (params: TxParams) => {
156190
assert.assert(await this.paused(), 'Controller not currently paused');
157191
assert.assert(await this.isCallerTheSecurityTokenOwner(params.txData), 'Sender is not owner');
158192
return (await this.contract).unpause.sendTransactionAsync(params.txData, params.safetyFactor);
159193
};
160194

161-
public paused = async () => {
195+
/**
196+
* check if module is paused
197+
*/
198+
public paused = async (): Promise<boolean> => {
162199
return (await this.contract).paused.callAsync();
163200
};
164201

202+
/**
203+
* pause the module
204+
*/
165205
public pause = async (params: TxParams) => {
166206
assert.assert(!(await this.paused()), 'Controller currently paused');
167207
assert.assert(await this.isCallerTheSecurityTokenOwner(params.txData), 'Sender is not owner');
168208
return (await this.contract).pause.sendTransactionAsync(params.txData, params.safetyFactor);
169209
};
170210

171-
public whitelist = async (params: InvestorAddressParams) => {
211+
/**
212+
* Addresses on this list are always able to send / receive tokens
213+
* @return boolean on whitelist
214+
*/
215+
public whitelist = async (params: InvestorAddressParams): Promise<boolean> => {
172216
assert.isETHAddressHex('investorAddress', params.investorAddress);
173217
return (await this.contract).whitelist.callAsync(params.investorAddress);
174218
};
175219

220+
/**
221+
* Used to verify the transfer transaction (View)
222+
* @return boolean transfer result
223+
* @return address
224+
*/
176225
public verifyTransfer = async (params: VerifyTransferParams) => {
177226
assert.isETHAddressHex('from', params.from);
178227
assert.isETHAddressHex('to', params.to);
@@ -190,6 +239,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
190239
};
191240
};
192241

242+
/**
243+
* sets the maximum percentage that an individual token holder can hold
244+
*/
193245
public changeHolderPercentage = async (params: ChangeHolderPercentageParams) => {
194246
assert.assert(await this.isCallerAllowed(params.txData, Perm.Admin), 'Caller is not allowed');
195247
assert.isPercentage('maxHolderPercentage', params.maxHolderPercentage);
@@ -200,6 +252,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
200252
);
201253
};
202254

255+
/**
256+
* Adds or removes single addresses from the whitelist.
257+
*/
203258
public modifyWhitelist = async (params: ModifyWhitelistParams) => {
204259
assert.assert(await this.isCallerAllowed(params.txData, Perm.Admin), 'Caller is not allowed');
205260
assert.isETHAddressHex('investor', params.investor);
@@ -211,6 +266,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
211266
);
212267
};
213268

269+
/**
270+
* Adds or removes addresses from the whitelist.
271+
*/
214272
public modifyWhitelistMulti = async (params: ModifyWhitelistMultiParams) => {
215273
assert.assert(await this.isCallerAllowed(params.txData, Perm.Admin), 'Caller is not allowed');
216274
assert.assert(
@@ -226,6 +284,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
226284
);
227285
};
228286

287+
/**
288+
* Sets whether or not to consider primary issuance transfers
289+
*/
229290
public setAllowPrimaryIssuance = async (params: SetAllowPrimaryIssuanceParams) => {
230291
assert.assert(await this.isCallerAllowed(params.txData, Perm.Admin), 'Caller is not allowed');
231292
assert.assert(

0 commit comments

Comments
 (0)