The 2 ways to transfer ERC20 Tokens in Solidity

github logo ・1 min read

With ERC20 tokens, there are 2 APIs to transfer tokens:

  • transfer() (simple transfers)
  • transferFrom() (delegated transfer)

For transfer(), there are 3 steps:

  1. Import the ERC20 token
  2. Import the address of the token
  3. Call transfer()

For transfer(), there are 4 steps:

  1. Import the ERC20 token
  2. Import the address of the token
  3. Call approve()
  4. Call transferFrom()

WATCH Whole Solidity tutorial series:

twitter logo DISCUSS
Classic DEV Post from Feb 8

Why you may need a dedicated homelab.

When that good ol' PC won't cut it anymore.

Julien Klepatch profile image
I teach Blockchain developers how to build Ethereum Dapps on https://eattheblocks.com and https://www.youtube.com/channel/UCZM8XQjNOyG2ElPpEUtNasA. Covers Smart Contracts, Solidity, Truffle and Web3.