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>