README.adoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. * {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.
  9. Additionally there are multiple custom extensions, including:
  10. * {ERC20Permit}: gasless approval of tokens.
  11. * {ERC20Snapshot}: efficient storage of past token balances to be later queried at any point in time.
  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. Finally, there are some utilities to interact with ERC20 contracts in various ways.
  16. * {SafeERC20}: a wrapper around the interface that eliminates the need to handle boolean return values.
  17. * {TokenTimelock}: hold tokens for a beneficiary until a specified time.
  18. The following related EIPs are in draft status and can be found in the drafts directory.
  19. - {IERC20Permit}
  20. - {ERC20Permit}
  21. 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.
  22. == Core
  23. {{IERC20}}
  24. {{ERC20}}
  25. == Extensions
  26. {{ERC20Snapshot}}
  27. {{ERC20Pausable}}
  28. {{ERC20Burnable}}
  29. {{ERC20Capped}}
  30. == Utilities
  31. {{SafeERC20}}
  32. {{TokenTimelock}}