DEV Community

loading...

The 2 ways to transfer ERC20 Tokens in Solidity

jklepatch profile image Julien Klepatch ・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:

Discussion (0)

Forem Open with the Forem app