Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new NativeExpression((context) => {
process.stdin.pause();
let input = readline.questionFloat('');
console.log();
let value = Obj.create(context, Types.Double);
value.set('value', input);
process.stdin.resume();
return value;
})));
}
break;
case 'Mint tokens':
await mintTokens();
break;
case 'Manage modules':
await listModuleOptions();
break;
case 'Withdraw tokens from contract':
let tokenAddress = readlineSync.question(`Enter the ERC20 token address (POLY ${polyToken.options.address}): `, {
limit: function (input) {
return web3.utils.isAddress(input);
},
limitMessage: "Must be a valid address",
defaultInput: polyToken.options.address
});
let value = readlineSync.questionFloat('Enter the value to withdraw: ', {
limit: function (input) {
return input > 0;
},
limitMessage: "Must be a greater than 0"
});
await withdrawFromContract(tokenAddress, web3.utils.toWei(new web3.utils.BN(value)));
break;
case 'Exit':
process.exit();
break;
}
}
new NativeExpression((context) => {
process.stdin.pause();
let prompt = context.store.get(context.environment.find('prompt'));
let input = readline.questionFloat(prompt.get('value'));
console.log();
let value = Obj.create(context, Types.Double);
value.set('value', input);
process.stdin.resume();
return value;
})));