DEV Community

Julien Klepatch
Julien Klepatch

Posted on

2

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay