(currentCheckpoint)
| 75 | } |
| 76 | |
| 77 | async function exploreAddress(currentCheckpoint) { |
| 78 | let address = readlineSync.question('Enter address to explore: ', { |
| 79 | limit: function (input) { |
| 80 | return web3.utils.isAddress(input); |
| 81 | }, |
| 82 | limitMessage: "Must be a valid address", |
| 83 | }); |
| 84 | let checkpoint = null; |
| 85 | if (currentCheckpoint > 0) { |
| 86 | checkpoint = await selectCheckpoint(false); |
| 87 | } |
| 88 | |
| 89 | let balance = web3.utils.fromWei(await securityToken.methods.balanceOf(address).call()); |
| 90 | let totalSupply = web3.utils.fromWei(await securityToken.methods.totalSupply().call()); |
| 91 | console.log(`Balance of ${address} is: ${balance} ${tokenSymbol}`); |
| 92 | console.log(`TotalSupply is: ${totalSupply} ${tokenSymbol}`); |
| 93 | |
| 94 | if (checkpoint) { |
| 95 | let balanceAt = web3.utils.fromWei(await securityToken.methods.balanceOfAt(address, checkpoint).call()); |
| 96 | let totalSupplyAt = web3.utils.fromWei(await securityToken.methods.totalSupplyAt(checkpoint).call()); |
| 97 | console.log(`Balance of ${address} at checkpoint ${checkpoint}: ${balanceAt} ${tokenSymbol}`); |
| 98 | console.log(`TotalSupply at checkpoint ${checkpoint} is: ${totalSupplyAt} ${tokenSymbol}`); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | async function configExistingModules(dividendModules) { |
| 103 | let options = dividendModules.map(m => `${m.name} at ${m.address}`); |
no test coverage detected