MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / displayModules

Function displayModules

CLI/commands/token_manager.js:84–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82}
83
84async function displayModules() {
85 // Module Details
86 let pmModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.PERMISSION);
87 let tmModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.TRANSFER);
88 let stoModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.STO);
89 let cpModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.DIVIDENDS);
90 let burnModules = allModules.filter(m => m.type == gbl.constants.MODULES_TYPES.BURN);
91
92 // Module Counts
93 let numPM = pmModules.length;
94 let numTM = tmModules.length;
95 let numSTO = stoModules.length;
96 let numCP = cpModules.length;
97 let numBURN = burnModules.length;
98
99 console.log(`
100******************* Module Information ********************
101- Permission Manager: ${(numPM > 0) ? numPM : 'None'}
102- Transfer Manager: ${(numTM > 0) ? numTM : 'None'}
103- STO: ${(numSTO > 0) ? numSTO : 'None'}
104- Checkpoint: ${(numCP > 0) ? numCP : 'None'}
105- Burn: ${(numBURN > 0) ? numBURN : 'None'}
106 `);
107
108 if (numPM) {
109 console.log(`Permission Manager Modules:`);
110 pmModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`));
111 }
112
113 if (numTM) {
114 console.log(`Transfer Manager Modules:`);
115 tmModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`));
116 }
117
118 if (numSTO) {
119 console.log(`STO Modules:`);
120 stoModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`));
121 }
122
123 if (numCP) {
124 console.log(`Checkpoint Modules:`);
125 cpModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`));
126 }
127
128 if (numBURN) {
129 console.log(` Burn Modules:`);
130 burnModules.map(m => console.log(`- ${m.name} is ${(m.archived) ? chalk.yellow('archived') : 'unarchived'} at ${m.address}`));
131 }
132}
133
134async function selectAction() {
135 let options = ['Update token details'/*, 'Change granularity'*/];

Callers 1

executeAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected