Add ERC20 _setTokenURI (#1618)
* Add _setTokenURI internal. * Rename TokenMetadata to ERC20Metadata. * Add changelog entry for ERC20Metadata. * Fix linter error. * Add breaking change changelog notice.
This commit is contained in:
committed by
Francisco Giordano
parent
1fd993bc01
commit
8dd92fd6ca
@ -7,18 +7,18 @@ import "../../token/ERC20/IERC20.sol";
|
||||
* @dev See https://eips.ethereum.org/EIPS/eip-1046
|
||||
* @dev tokenURI must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047
|
||||
*/
|
||||
contract ERC20TokenMetadata is IERC20 {
|
||||
function tokenURI() external view returns (string memory);
|
||||
}
|
||||
|
||||
contract ERC20WithMetadata is ERC20TokenMetadata {
|
||||
contract ERC20Metadata {
|
||||
string private _tokenURI;
|
||||
|
||||
constructor (string memory tokenURI) public {
|
||||
_tokenURI = tokenURI;
|
||||
constructor (string memory tokenURI_) public {
|
||||
_setTokenURI(tokenURI_);
|
||||
}
|
||||
|
||||
function tokenURI() external view returns (string memory) {
|
||||
return _tokenURI;
|
||||
}
|
||||
|
||||
function _setTokenURI(string memory tokenURI_) internal {
|
||||
_tokenURI = tokenURI_;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user