README.adoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. = ERC-20
  2. [.readme-notice]
  3. NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/token/erc20
  4. This set of interfaces, contracts, and utilities are all related to the https://eips.ethereum.org/EIPS/eip-20[ERC-20 Token Standard].
  5. TIP: For an overview of ERC-20 tokens and a walk through on how to create a token contract read our xref:ROOT:erc20.adoc[ERC-20 guide].
  6. There are a few core contracts that implement the behavior specified in the ERC-20 standard:
  7. * {IERC20}: the interface all ERC-20 implementations should conform to.
  8. * {IERC20Metadata}: the extended ERC-20 interface including the <<ERC20-name--,`name`>>, <<ERC20-symbol--,`symbol`>> and <<ERC20-decimals--,`decimals`>> functions.
  9. * {ERC20}: the implementation of the ERC-20 interface, including the <<ERC20-name--,`name`>>, <<ERC20-symbol--,`symbol`>> and <<ERC20-decimals--,`decimals`>> optional extensions to the standard interface.
  10. Additionally there are multiple custom extensions, including:
  11. * {ERC20Permit}: gasless approval of tokens (standardized as ERC-2612).
  12. * {ERC20Burnable}: destruction of own tokens.
  13. * {ERC20Capped}: enforcement of a cap to the total supply when minting tokens.
  14. * {ERC20Pausable}: ability to pause token transfers.
  15. * {ERC20FlashMint}: token level support for flash loans through the minting and burning of ephemeral tokens (standardized as ERC-3156).
  16. * {ERC20Votes}: support for voting and vote delegation.
  17. * {ERC20Wrapper}: wrapper to create an ERC-20 backed by another ERC-20, with deposit and withdraw methods. Useful in conjunction with {ERC20Votes}.
  18. * {ERC20TemporaryApproval}: support for approvals lasting for only one transaction, as defined in ERC-7674.
  19. * {ERC1363}: support for calling the target of a transfer or approval, enabling code execution on the receiver within a single transaction.
  20. * {ERC4626}: tokenized vault that manages shares (represented as ERC-20) that are backed by assets (another ERC-20).
  21. Finally, there are some utilities to interact with ERC-20 contracts in various ways:
  22. * {SafeERC20}: a wrapper around the interface that eliminates the need to handle boolean return values.
  23. Other utilities that support ERC-20 assets can be found in the codebase:
  24. * ERC-20 tokens can be timelocked (held for a beneficiary until a specified time) or vested (released following a given schedule) using a {VestingWallet}.
  25. NOTE: This core set of contracts is designed to be unopinionated, allowing developers to access the internal functions in ERC-20 (such as <<ERC20-_mint-address-uint256-,`_mint`>>) and expose them as external functions in the way they prefer.
  26. == Core
  27. {{IERC20}}
  28. {{IERC20Metadata}}
  29. {{ERC20}}
  30. == Extensions
  31. {{IERC20Permit}}
  32. {{ERC20Permit}}
  33. {{ERC20Burnable}}
  34. {{ERC20Capped}}
  35. {{ERC20Pausable}}
  36. {{ERC20Votes}}
  37. {{ERC20Wrapper}}
  38. {{ERC20FlashMint}}
  39. {{ERC20TemporaryApproval}}
  40. {{ERC1363}}
  41. {{ERC4626}}
  42. == Utilities
  43. {{SafeERC20}}
  44. {{ERC1363Utils}}