| 40 | }; |
| 41 | |
| 42 | const sendErc20 = async (to, amount, contractAddress) => { |
| 43 | const contract = new ethers.Contract(contractAddress, erc20Abi, wallet); |
| 44 | const tx = await contract.transfer(to, ethers.utils.parseEther(amount).toString(), overrides); // overrides is optional |
| 45 | tx.wait(1); |
| 46 | console.log(chalk.green(`Successfully sent ${amount} ERC20 to ${to}, detail: https://scan-testnet.kcc.network/tx/${tx.hash}`)); |
| 47 | return tx; |
| 48 | }; |
| 49 | |
| 50 | const main = async () => { |
| 51 | await sendBaseToken('target transfer address', '0.1'); |