()
| 302 | } |
| 303 | |
| 304 | async function generalTransferManager() { |
| 305 | console.log('\n', chalk.blue(`General Transfer Manager at ${currentTransferManager.options.address}`), '\n'); |
| 306 | |
| 307 | // Show current data |
| 308 | let displayIssuanceAddress = await currentTransferManager.methods.issuanceAddress().call(); |
| 309 | let displaySigningAddress = await currentTransferManager.methods.signingAddress().call(); |
| 310 | let displayAllowAllTransfers = await currentTransferManager.methods.allowAllTransfers().call(); |
| 311 | let displayAllowAllWhitelistTransfers = await currentTransferManager.methods.allowAllWhitelistTransfers().call(); |
| 312 | let displayAllowAllWhitelistIssuances = await currentTransferManager.methods.allowAllWhitelistIssuances().call(); |
| 313 | let displayAllowAllBurnTransfers = await currentTransferManager.methods.allowAllBurnTransfers().call(); |
| 314 | let displayDefaults = await currentTransferManager.methods.defaults().call(); |
| 315 | let displayInvestors = await currentTransferManager.methods.getInvestors().call(); |
| 316 | |
| 317 | console.log(`- Issuance address: ${displayIssuanceAddress}`); |
| 318 | console.log(`- Signing address: ${displaySigningAddress}`); |
| 319 | console.log(`- Allow all transfers: ${displayAllowAllTransfers ? `YES` : `NO`}`); |
| 320 | console.log(`- Allow all whitelist transfers: ${displayAllowAllWhitelistTransfers ? `YES` : `NO`}`); |
| 321 | console.log(`- Allow all whitelist issuances: ${displayAllowAllWhitelistIssuances ? `YES` : `NO`}`); |
| 322 | console.log(`- Allow all burn transfers: ${displayAllowAllBurnTransfers ? `YES` : `NO`}`); |
| 323 | console.log(`- Default times:`); |
| 324 | console.log(` - From time: ${displayDefaults.fromTime} (${moment.unix(displayDefaults.fromTime).format('MMMM Do YYYY, HH:mm:ss')})`); |
| 325 | console.log(` - To time: ${displayDefaults.toTime} (${moment.unix(displayDefaults.toTime).format('MMMM Do YYYY, HH:mm:ss')})`); |
| 326 | console.log(`- Investors: ${displayInvestors.length}`); |
| 327 | // ------------------ |
| 328 | |
| 329 | let options = []; |
| 330 | if (displayInvestors.length > 0) { |
| 331 | options.push(`Show investors`, `Show whitelist data`); |
| 332 | } |
| 333 | options.push('Modify whitelist', 'Modify whitelist from CSV', /*'Modify Whitelist Signed',*/ |
| 334 | 'Change the default times used when they are zero', `Change issuance address`, 'Change signing address'); |
| 335 | |
| 336 | if (displayAllowAllTransfers) { |
| 337 | options.push('Disallow all transfers'); |
| 338 | } else { |
| 339 | options.push('Allow all transfers'); |
| 340 | } |
| 341 | if (displayAllowAllWhitelistTransfers) { |
| 342 | options.push('Disallow all whitelist transfers'); |
| 343 | } else { |
| 344 | options.push('Allow all whitelist transfers'); |
| 345 | } |
| 346 | if (displayAllowAllWhitelistIssuances) { |
| 347 | options.push('Disallow all whitelist issuances'); |
| 348 | } else { |
| 349 | options.push('Allow all whitelist issuances'); |
| 350 | } |
| 351 | if (displayAllowAllBurnTransfers) { |
| 352 | options.push('Disallow all burn transfers'); |
| 353 | } else { |
| 354 | options.push('Allow all burn transfers'); |
| 355 | } |
| 356 | |
| 357 | let index = readlineSync.keyInSelect(options, 'What do you want to do?', { cancel: 'RETURN' }); |
| 358 | let optionSelected = index !== -1 ? options[index] : 'RETURN'; |
| 359 | console.log('Selected:', optionSelected, '\n'); |
| 360 | switch (optionSelected) { |
| 361 | case `Show investors`: |
no test coverage detected