README.adoc 3.2 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[ERC20 Token Standard].
  5. TIP: For an overview of ERC20 tokens and a walk through on how to create a token contract read our xref:ROOT:erc20.adoc[ERC20 guide].
  6. There a few core contracts that implement the behavior specified in the EIP:
  7. * {IERC20}: the interface all ERC20 implementations should conform to.
  8. * {IERC20Metadata}: the extended ERC20 interface including the <<ERC20-name,`name`>>, <<ERC20-symbol,`symbol`>> and <<ERC20-decimals,`decimals`>> functions.
  9. * {ERC20}: the implementation of the ERC20 interface, including the <<ERC20-name,`name`>>, <<ERC20-symbol,`symbol`>> and <<ERC20-decimals,`decimals`>> optional standard extension to the base interface.
  10. Additionally there are multiple custom extensions, including:
  11. * {ERC20Burnable}: destruction of own tokens.
  12. * {ERC20Capped}: enforcement of a cap to the total supply when minting tokens.
  13. * {ERC20Pausable}: ability to pause token transfers.
  14. * {ERC20Snapshot}: efficient storage of past token balances to be later queried at any point in time.
  15. * {ERC20Permit}: gasless approval of tokens (standardized as ERC2612).
  16. * {ERC20FlashMint}: token level support for flash loans through the minting and burning of ephemeral tokens (standardized as ERC3156).
  17. Finally, there are some utilities to interact with ERC20 contracts in various ways.
  18. * {SafeERC20}: a wrapper around the interface that eliminates the need to handle boolean return values.
  19. * {TokenTimelock}: hold tokens for a beneficiary until a specified time.
  20. The following related EIPs are in draft status.
  21. - {ERC20Permit}
  22. - {ERC20FlashMint}
  23. NOTE: This core set of contracts is designed to be unopinionated, allowing developers to access the internal functions in ERC20 (such as <<ERC20-_mint-address-uint256-,`_mint`>>) and expose them as external functions in the way they prefer. On the other hand, xref:ROOT:erc20.adoc#Presets[ERC20 Presets] (such as {ERC20PresetMinterPauser}) are designed using opinionated patterns to provide developers with ready to use, deployable contracts.
  24. == Core
  25. {{IERC20}}
  26. {{IERC20Metadata}}
  27. {{ERC20}}
  28. == Extensions
  29. {{ERC20Burnable}}
  30. {{ERC20Capped}}
  31. {{ERC20Pausable}}
  32. {{ERC20Snapshot}}
  33. == Draft EIPs
  34. The following EIPs are still in Draft status. Due to their nature as drafts, the details of these contracts may change and we cannot guarantee their xref:ROOT:releases-stability.adoc[stability]. Minor releases of OpenZeppelin Contracts may contain breaking changes for the contracts in this directory, which will be duly announced in the https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CHANGELOG.md[changelog]. The EIPs included here are used by projects in production and this may make them less likely to change significantly.
  35. {{ERC20Permit}}
  36. {{ERC20FlashMint}}
  37. == Presets
  38. These contracts are preconfigured combinations of the above features. They can be used through inheritance or as models to copy and paste their source code.
  39. {{ERC20PresetMinterPauser}}
  40. {{ERC20PresetFixedSupply}}
  41. == Utilities
  42. {{SafeERC20}}
  43. {{TokenTimelock}}