0PricingLogin
Web3 & DApp Development Fundamentals · Lesson

Allowances

Delegated transfers.

Delegated Transfers

Allowances let a token owner authorize another account - the spender - to move tokens on their behalf. This is what enables decentralized exchanges and DeFi protocols to pull your tokens with permission.

The flow is: approve sets a limit, then transferFrom spends within it.

The Allowance Storage

Allowances live in a nested mapping: owner to spender to amount. It records how much each spender may move for each owner.

<code>mapping(address => mapping(address => uint256)) public allowance;</code>

All lessons in this course

  1. The ERC-20 Standard
  2. Implementing a Token
  3. Allowances
  4. Minting and Burning
← Back to Web3 & DApp Development Fundamentals