CLI/commands/investor_portal.js
async function inputSymbol(symbol) {
    if (typeof symbol === 'undefined') {
        STSymbol = readlineSync.question(chalk.yellow(`Enter the symbol of a registered security token or press 'Enter' to exit: `));
    } else {
        STSymbol = symbol;
    }

    if (STSymbol == "") process.exit();

    STAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(STSymbol).call();
    if (STAddress == "0x0000000000000000000000000000000000000000") {
        console.log(`Token symbol provided is not a registered Security Token. Please enter another symbol.`);
    } else {
        let securityTokenABI = abis.securityToken();
        securityToken = new web3.eth.Contract(securityTokenABI, STAddress);

        await showTokenInfo();

        let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call();
        let generalTransferManagerABI = abis.generalTransferManager();
        generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, gtmModule[0]);

        let stoModules = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES.STO).call();
        if (stoModules.length == 0) {
            console.log(chalk.red(`There is no STO module attached to the ${STSymbol.toUpperCase()} Token. No further actions can be taken.`));
            process.exit(0);
        } else {
            STOAddress = stoModules[0];
            let stoModuleData = await securityToken.methods.getModule(STOAddress).call();
            selectedSTO = web3.utils.toAscii(stoModuleData[0]).replace(/\u0000/g, '');
            let interfaceSTOABI = abis.stoInterface();
            currentSTO = new web3.eth.Contract(interfaceSTOABI, STOAddress);
        }
    }
}
async function inputSymbol(symbol) {
    if (typeof symbol === 'undefined') {
        STSymbol = readlineSync.question(chalk.yellow(`Enter the symbol of a registered security token or press 'Enter' to exit: `));
    } else {
        STSymbol = symbol;
    }

    if (STSymbol == "") process.exit();

    STAddress = await securityTokenRegistry.methods.getSecurityTokenAddress(STSymbol).call();
    if (STAddress == "0x0000000000000000000000000000000000000000") {
        console.log(`Token symbol provided is not a registered Security Token. Please enter another symbol.`);
    } else {
        let securityTokenABI = abis.securityToken();
        securityToken = new web3.eth.Contract(securityTokenABI, STAddress);

        await showTokenInfo();

        let gtmModule = await securityToken.methods.getModulesByName(web3.utils.toHex('GeneralTransferManager')).call();
        let generalTransferManagerABI = abis.generalTransferManager();
        generalTransferManager = new web3.eth.Contract(generalTransferManagerABI, gtmModule[0]);

        let stoModules = await securityToken.methods.getModulesByType(gbl.constants.MODULES_TYPES.STO).call();
        if (stoModules.length == 0) {
            console.log(chalk.red(`There is no STO module attached to the ${STSymbol.toUpperCase()} Token. No further actions can be taken.`));
            process.exit(0);
        } else {
            STOAddress = stoModules[0];
            let stoModuleData = await securityToken.methods.getModule(STOAddress).call();
            selectedSTO = web3.utils.toAscii(stoModuleData[0]).replace(/\u0000/g, '');
            let interfaceSTOABI = abis.stoInterface();
            currentSTO = new web3.eth.Contract(interfaceSTOABI, STOAddress);
        }
    }
}
async function inputSymbol ( symbol ) { if ( typeof symbol === 'undefined' ) { STSymbol = readlineSync . question ( chalk . yellow ( ` ` ) ) ; } else { STSymbol = symbol ; } if ( STSymbol == "" ) process . exit ( ) ; STAddress = await securityTokenRegistry . methods . getSecurityTokenAddress ( STSymbol ) . call ( ) ; if ( STAddress == "0x0000000000000000000000000000000000000000" ) { console . log ( ` ` ) ; } else { let securityTokenABI = abis . securityToken ( ) ; securityToken = new web3 . eth . Contract ( securityTokenABI , STAddress ) ; await showTokenInfo ( ) ; let gtmModule = await securityToken . methods . getModulesByName ( web3 . utils . toHex ( 'GeneralTransferManager' ) ) . call ( ) ; let generalTransferManagerABI = abis . generalTransferManager ( ) ; generalTransferManager = new web3 . eth . Contract ( generalTransferManagerABI , gtmModule [ 0 ] ) ; let stoModules = await securityToken . methods . getModulesByType ( gbl . constants . MODULES_TYPES . STO ) . call ( ) ; if ( stoModules . length == 0 ) { console . log ( chalk . red ( ` ${ STSymbol . toUpperCase ( ) } ` ) ) ; process . exit ( 0 ) ; } else { STOAddress = stoModules [ 0 ] ; let stoModuleData = await securityToken . methods . getModule ( STOAddress ) . call ( ) ; selectedSTO = web3 . utils . toAscii ( stoModuleData [ 0 ] ) . replace ( / \u0000 / g , '' ) ; let interfaceSTOABI = abis . stoInterface ( ) ; currentSTO = new web3 . eth . Contract ( interfaceSTOABI , STOAddress ) ; } } }
Input security token symbol or exit
Input security token symbol or exit