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

Function transferTokens

CLI/commands/faucet.js:95–106  ·  view source on GitHub ↗
(to, amount)

Source from the content-addressed store, hash-verified

93}
94
95async function transferTokens(to, amount) {
96 try {
97 let getTokensAction = polyToken.methods.getTokens(amount, to);
98 await common.sendTransaction(getTokensAction);
99 } catch (err){
100 console.log(err.message);
101 return;
102 }
103 let balance = await polyToken.methods.balanceOf(to).call();
104 let balanceInPoly = new BigNumber(balance).dividedBy(new BigNumber(10).pow(18));
105 console.log(chalk.green(`Congratulations! balance of ${to} address is ${balanceInPoly.toNumber()} POLY`));
106}
107
108module.exports = {
109 executeApp: async function(beneficiary, amount) {

Callers 1

send_polyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected