in

How can I send USDC through geth CLI?

How can I send USDC through geth CLI?


I had 100 USDC transferred to a local Ethereum wallet I control (from Binance). It shows up as a valid token when I view it in Etherscan. I normally use geth CLI for all Ethereum transactions, but I’m not sure how to go about sending tokens to a different Ethereum address in this case.

The only suggestion I’ve found so far suggests the below as the method for sending USDC:

geth console

Then create contract wrapper class like this:

var erc20 = web3.eth.contract ([{"constant": false, "inputs": [{"name": "_to", "type": "address"}, {"name": "_value", "type": "uint256"}], "name": "transfer", "outputs": [{"name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}]);

And instantiate it at token smart contract address (The contract address for the received USDC as shown in etherscan.io)

var myToken = erc20.at ("0x<token smart contract address here>");

now unlock your “from” account (the Ethereum wallet that holds the USDC/tokens):

personal.unlockAccount ("0x<from address>");

and finally send your tokens:

myToken.transfer ("0x<to address>", "<amount in basic units>", {from: "0x<from address>"});

The to address is the Ethereum wallet that will be receiving the tokens, the amount in basic units would be 100 (to send all USDC) and the from address would be the same as the unlocked account.

Is the above correct and do I need to have an Eth balance to pay for gas for the contract etc?

Edit: /u/sailing280 trying to scam people here.

https://preview.redd.it/ezzjkfuq7ss71.png?width=379&format=png&auto=webp&s=10cc51044b2257eaa052da9e2ba179dfab7a6910

submitted by /u/buildingapcin2015
http://ethereum-infochain.blogspot.com/2021/10/how-can-i-send-usdc-through-geth-cli.html [comments]

from Ethereum https://www.reddit.com/r/ethereum/comments/q5r7d7/how_can_i_send_usdc_through_geth_cli/



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

What do you think?

Panther and BUMPER Protocol announce partnership to provide seamless DeFi user experience

Leading Social Platform Chingari Continues Exponential Growth, Taps into Solana’s Blockchain With $19M Funding Round

Digital representation of the pet hospital announced by El Salvador President, Nayib Bukele. Image: Gobierno de El Salvador

El Salvador To Use BTC Profits To Set Up A Big Pet Hospital – Cryptovibes.com – Daily Cryptocurrency and FX News