@@ -94,31 +94,54 @@ interface GetPercentageTransferManagerLogsAsyncParams extends GetLogs {
94
94
( params : GetUnpauseLogsAsyncParams ) : Promise < LogWithDecodedArgs < PercentageTransferManagerUnpauseEventArgs > [ ] > ;
95
95
}
96
96
97
+ /**
98
+ * @param investorAddress Address of the investor
99
+ */
97
100
interface InvestorAddressParams {
98
101
investorAddress : string ;
99
102
}
100
103
104
+ /**
105
+ * @param from Address of the sender
106
+ * @param to Address of the receiver
107
+ * @param amount
108
+ * @param data
109
+ */
101
110
interface VerifyTransferParams {
102
111
from : string ;
103
112
to : string ;
104
113
amount : BigNumber ;
105
114
data : string ;
106
115
}
107
116
117
+ /**
118
+ * @param maxHolderPercentage is the new maximum percentage
119
+ */
108
120
interface ChangeHolderPercentageParams extends TxParams {
109
121
maxHolderPercentage : BigNumber ;
110
122
}
111
123
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
+ */
112
128
interface ModifyWhitelistParams extends TxParams {
113
129
investor : string ;
114
130
valid : boolean ;
115
131
}
116
132
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
+ */
117
137
interface ModifyWhitelistMultiParams extends TxParams {
118
138
investors : string [ ] ;
119
139
valids : boolean [ ] ;
120
140
}
121
141
142
+ /**
143
+ * @param allowPrimaryIssuance whether to allow all primary issuance transfers
144
+ */
122
145
interface SetAllowPrimaryIssuanceParams extends TxParams {
123
146
allowPrimaryIssuance : boolean ;
124
147
}
@@ -143,36 +166,62 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
143
166
this . contract = contract ;
144
167
}
145
168
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 > => {
147
174
return ( await this . contract ) . allowPrimaryIssuance . callAsync ( ) ;
148
175
} ;
149
176
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 > => {
151
182
const result = await ( await this . contract ) . maxHolderPercentage . callAsync ( ) ;
152
183
return weiToValue ( result , PERCENTAGE_DECIMALS ) ;
153
184
} ;
154
185
186
+ /**
187
+ * unpause the module
188
+ */
155
189
public unpause = async ( params : TxParams ) => {
156
190
assert . assert ( await this . paused ( ) , 'Controller not currently paused' ) ;
157
191
assert . assert ( await this . isCallerTheSecurityTokenOwner ( params . txData ) , 'Sender is not owner' ) ;
158
192
return ( await this . contract ) . unpause . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
159
193
} ;
160
194
161
- public paused = async ( ) => {
195
+ /**
196
+ * check if module is paused
197
+ */
198
+ public paused = async ( ) : Promise < boolean > => {
162
199
return ( await this . contract ) . paused . callAsync ( ) ;
163
200
} ;
164
201
202
+ /**
203
+ * pause the module
204
+ */
165
205
public pause = async ( params : TxParams ) => {
166
206
assert . assert ( ! ( await this . paused ( ) ) , 'Controller currently paused' ) ;
167
207
assert . assert ( await this . isCallerTheSecurityTokenOwner ( params . txData ) , 'Sender is not owner' ) ;
168
208
return ( await this . contract ) . pause . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
169
209
} ;
170
210
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 > => {
172
216
assert . isETHAddressHex ( 'investorAddress' , params . investorAddress ) ;
173
217
return ( await this . contract ) . whitelist . callAsync ( params . investorAddress ) ;
174
218
} ;
175
219
220
+ /**
221
+ * Used to verify the transfer transaction (View)
222
+ * @return boolean transfer result
223
+ * @return address
224
+ */
176
225
public verifyTransfer = async ( params : VerifyTransferParams ) => {
177
226
assert . isETHAddressHex ( 'from' , params . from ) ;
178
227
assert . isETHAddressHex ( 'to' , params . to ) ;
@@ -190,6 +239,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
190
239
} ;
191
240
} ;
192
241
242
+ /**
243
+ * sets the maximum percentage that an individual token holder can hold
244
+ */
193
245
public changeHolderPercentage = async ( params : ChangeHolderPercentageParams ) => {
194
246
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
195
247
assert . isPercentage ( 'maxHolderPercentage' , params . maxHolderPercentage ) ;
@@ -200,6 +252,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
200
252
) ;
201
253
} ;
202
254
255
+ /**
256
+ * Adds or removes single addresses from the whitelist.
257
+ */
203
258
public modifyWhitelist = async ( params : ModifyWhitelistParams ) => {
204
259
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
205
260
assert . isETHAddressHex ( 'investor' , params . investor ) ;
@@ -211,6 +266,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
211
266
) ;
212
267
} ;
213
268
269
+ /**
270
+ * Adds or removes addresses from the whitelist.
271
+ */
214
272
public modifyWhitelistMulti = async ( params : ModifyWhitelistMultiParams ) => {
215
273
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
216
274
assert . assert (
@@ -226,6 +284,9 @@ export default class PercentageTransferManagerWrapper extends ModuleWrapper {
226
284
) ;
227
285
} ;
228
286
287
+ /**
288
+ * Sets whether or not to consider primary issuance transfers
289
+ */
229
290
public setAllowPrimaryIssuance = async ( params : SetAllowPrimaryIssuanceParams ) => {
230
291
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
231
292
assert . assert (
0 commit comments