| 93 | } |
| 94 | |
| 95 | async 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 | |
| 108 | module.exports = { |
| 109 | executeApp: async function(beneficiary, amount) { |