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?
1 Answer
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.