MCPcopy Create free account
hub / github.com/Bot80926/ethers-scripts / sendErc20

Function sendErc20

script-2-transfer-token/index.js:42–48  ·  view source on GitHub ↗
(to, amount, contractAddress)

Source from the content-addressed store, hash-verified

40};
41
42const 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
50const main = async () => {
51 await sendBaseToken('target transfer address', '0.1');

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected