README.adoc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 are 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. * {ERC20Votes}: support for voting and vote delegation.
  18. * {ERC20VotesComp}: support for voting and vote delegation (compatible with Compound's token, with uint96 restrictions).
  19. * {ERC20Wrapper}: wrapper to create an ERC20 backed by another ERC20, with deposit and withdraw methods. Useful in conjunction with {ERC20Votes}.
  20. * {ERC4626}: tokenized vault that manages shares (represented as ERC20) that are backed by assets (another ERC20).
  21. Finally, there are some utilities to interact with ERC20 contracts in various ways.
  22. * {SafeERC20}: a wrapper around the interface that eliminates the need to handle boolean return values.
  23. * {TokenTimelock}: hold tokens for a beneficiary until a specified time.
  24. 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.
  25. == Core
  26. {{IERC20}}
  27. {{IERC20Metadata}}
  28. {{ERC20}}
  29. == Extensions
  30. {{ERC20Burnable}}
  31. {{ERC20Capped}}
  32. {{ERC20Pausable}}
  33. {{ERC20Permit}}
  34. {{ERC20Snapshot}}
  35. {{ERC20Votes}}
  36. {{ERC20VotesComp}}
  37. {{ERC20Wrapper}}
  38. {{ERC20FlashMint}}
  39. {{ERC4626}}
  40. == Utilities
  41. {{SafeERC20}}
  42. {{TokenTimelock}}