README.adoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * designation of addresses that can pause token transfers for all users ({ERC20Pausable}).
  11. * efficient storage of past token balances to be later queried at any point in time ({ERC20Snapshot}).
  12. * destruction of own tokens ({ERC20Burnable}).
  13. * enforcement of a cap to the total supply when minting tokens ({ERC20Capped}).
  14. Finally, there are some utilities to interact with ERC20 contracts in various ways.
  15. * {SafeERC20} is a wrapper around the interface that eliminates the need to handle boolean return values.
  16. * {TokenTimelock} can hold tokens for a beneficiary until a specified time.
  17. 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.
  18. == Core
  19. {{IERC20}}
  20. {{ERC20}}
  21. == Extensions
  22. {{ERC20Snapshot}}
  23. {{ERC20Pausable}}
  24. {{ERC20Burnable}}
  25. {{ERC20Capped}}
  26. == Utilities
  27. {{SafeERC20}}
  28. {{TokenTimelock}}