(dividendIndex, checkpointId)
| 514 | } |
| 515 | |
| 516 | async function pushDividends(dividendIndex, checkpointId) { |
| 517 | let accounts = readlineSync.question('Enter addresses to push dividends to (ex- add1,add2,add3,...) or leave empty to push to all addresses: ', { |
| 518 | limit: function (input) { |
| 519 | return input === '' || (input.split(',').every(a => web3.utils.isAddress(a))); |
| 520 | }, |
| 521 | limitMessage: `All addresses must be valid` |
| 522 | }).split(','); |
| 523 | if (accounts[0] !== '') { |
| 524 | let action = currentDividendsModule.methods.pushDividendPaymentToAddresses(dividendIndex, accounts); |
| 525 | let receipt = await common.sendTransaction(action); |
| 526 | logPushResults(receipt); |
| 527 | } else { |
| 528 | let investorsAtCheckpoint = await securityToken.methods.getInvestorsAt(checkpointId).call(); |
| 529 | console.log(`There are ${investorsAtCheckpoint.length} investors at checkpoint ${checkpointId} `); |
| 530 | let batchSize = readlineSync.questionInt(`How many investors per transaction do you want to push to? `); |
| 531 | for (let i = 0; i < investorsAtCheckpoint.length; i += batchSize) { |
| 532 | let action = currentDividendsModule.methods.pushDividendPayment(dividendIndex, i, batchSize); |
| 533 | let receipt = await common.sendTransaction(action); |
| 534 | logPushResults(receipt); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | async function exploreAccount(dividendIndex, dividendTokenAddress, dividendTokenSymbol) { |
| 540 | let account = readlineSync.question('Enter address to explore: ', { |
no test coverage detected