DEV Community

Julien Klepatch
Julien Klepatch

Posted on

The 2 ways to transfer ERC20 Tokens in Solidity

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:

Top comments (0)