Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // script.js
- Web3 = require('web3')
- web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/APIKEY"))
- // Contract details
- const contractABI = require('human-standard-token-abi')
- const contractAddress = "0x039b5649a59967e3e936d7471f9c3700100ee1ab"
- const decimals = 6;
- const value = 0.01 * 10 ** decimals;
- // Destination address
- const toAddress = "0x130FCE6849E094b36816975a1632062BF65642D8";
- web3.eth.accounts.wallet.add("PRIVATEKEY")
- // Transfer
- contract = new web3.eth.Contract(contractABI, contractAddress, {
- from: web3.eth.accounts.wallet[0].address,
- gas: '100000'})
- contract.methods.transfer(toAddress, value).send({}, function(err, txHash) {
- console.log(err, txHash);
- });
Add Comment
Please, Sign In to add comment