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

Function selectExistingSTO

CLI/commands/sto_manager.js:71–92  ·  view source on GitHub ↗
(stoModules, showPaused)

Source from the content-addressed store, hash-verified

69};
70
71function selectExistingSTO(stoModules, showPaused) {
72 let filteredModules = stoModules;
73 if (!showPaused) {
74 filteredModules = stoModules.filter(m => !m.paused);
75 }
76 let options = filteredModules.map(m => `${m.name} at ${m.address}`);
77 let index = readlineSync.keyInSelect(options, 'Select a module: ', { cancel: false });
78 console.log('Selected:', options[index], '\n');
79 let selectedName = filteredModules[index].name;
80 let stoABI;
81 switch (selectedName) {
82 case 'CappedSTO':
83 stoABI = abis.cappedSTO();
84 break;
85 case 'USDTieredSTO':
86 stoABI = abis.usdTieredSTO();
87 break;
88 }
89
90 let stoModule = new web3.eth.Contract(stoABI, filteredModules[index].address);
91 return { name: selectedName, module: stoModule };
92}
93
94async function showSTO(selectedSTO, currentSTO) {
95 switch (selectedSTO) {

Callers 1

executeAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected