0

I have two ERC20 tokens in my Metamask wallet, say TOKEN_1 and TOKEN_2. How do I send TOKEN_1 programmatically to another wallet?

  • Hey Doug! Great question, especially since this is a common use case. Can you check out this answer and see if it solves your problem?

    https://ethereum.stackexchange.com/questions/23121/how-to-transfer-erc20-tokens-using-web3js

    – thatguyintech Jul 20 '22 at 03:54

1 Answers1

0

For each token, there is a transfer function that allows you to transfer the token from one account to another. I use brownie, and this is what it would look like.

if the contract was maybe transferring some DAI to another address.

tx = dai.transfer(addressOfReceiver,amountInWei,{"from":yourAccount})
tx.wait(1)

You can check the link below if you know a bit about brownie. https://eth-brownie.readthedocs.io/en/stable/core-contracts.html

But otherwise, for each token, there is a transfer function that allows you to transfer a token from one account to another.