From 1e7d7a5be021724ad0386c56fe101a7a9b59561b Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 4 Mar 2021 17:51:14 +0100 Subject: [PATCH] rename to IERC20Extended --- CHANGELOG.md | 2 +- contracts/token/ERC20/ERC20.sol | 5 ++--- .../{extensions/IERC20Metadata.sol => IERC20Extended.sol} | 6 +++--- contracts/token/ERC20/README.adoc | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) rename contracts/token/ERC20/{extensions/IERC20Metadata.sol => IERC20Extended.sol} (75%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 170b0273e21..ba00aef7140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ * Rename `UpgradeableProxy` to `ERC1967Proxy`. ([#2547](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2547)) * `ERC777`: Optimize the gas costs of the constructor. ([#2551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2551)) * `ERC721URIStorage`: Add a new extension that implements the `_setTokenURI` behavior as it was available in 3.4.0. ([#2555](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2555)) - * `IERC20Metadata`: Add a new extended interface that includes the optional `name()`, `symbol()` and `decimals()` functions. ([#2561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2561)) + * `IERC20Extended`: Interface file for the extended ERC20 standard (that includes the optional `name()`, `symbol()` and `decimals()`). ([#2561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2561)) ### How to upgrade from 3.x diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index edb5778bd57..e34b1cbdfc8 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -2,8 +2,7 @@ pragma solidity ^0.8.0; -import "./IERC20.sol"; -import "./extensions/IERC20Metadata.sol"; +import "./IERC20Extended.sol"; import "../../utils/Context.sol"; /** @@ -30,7 +29,7 @@ import "../../utils/Context.sol"; * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ -contract ERC20 is Context, IERC20, IERC20Metadata { +contract ERC20 is Context, IERC20Extended { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; diff --git a/contracts/token/ERC20/extensions/IERC20Metadata.sol b/contracts/token/ERC20/IERC20Extended.sol similarity index 75% rename from contracts/token/ERC20/extensions/IERC20Metadata.sol rename to contracts/token/ERC20/IERC20Extended.sol index 5bc7860695d..a49361b2701 100644 --- a/contracts/token/ERC20/extensions/IERC20Metadata.sol +++ b/contracts/token/ERC20/IERC20Extended.sol @@ -2,12 +2,12 @@ pragma solidity ^0.8.0; -import "../IERC20.sol"; +import "./IERC20.sol"; /** - * @dev Interface for the optional metadata functions from the ERC20 standard. + * @dev Interface of the extended ERC20 standard. */ -interface IERC20Metadata is IERC20 { +interface IERC20Extended is IERC20 { /** * @dev Returns the name of the token. */ diff --git a/contracts/token/ERC20/README.adoc b/contracts/token/ERC20/README.adoc index d63fa3f72d7..19aa74e45d1 100644 --- a/contracts/token/ERC20/README.adoc +++ b/contracts/token/ERC20/README.adoc @@ -10,7 +10,7 @@ TIP: For an overview of ERC20 tokens and a walk through on how to create a token There a few core contracts that implement the behavior specified in the EIP: * {IERC20}: the interface all ERC20 implementations should conform to. -* {IERC20Metadata}: the extended ERC20 interface including the <>, <> and <> functions. +* {IERC20Extended}: the extended ERC20 interface including the <>, <> and <> functions. * {ERC20}: the implementation of the ERC20 interface, including the <>, <> and <> optional standard extension to the base interface. Additionally there are multiple custom extensions, including: