ERC-7729 · Draft · ERC · 2023-06-24
ERC-7729: Token with Metadata
An ERC-20 extension adding a metadata() function that returns a URI to JSON with a name, description and image, so fungible tokens can carry NFT-style artwork.
What problem does it solve?
ERC-20 tokens only expose name, symbol and decimals. There is no onchain pointer to a logo, description or other rich information, so wallets and explorers rely on curated token lists or their own databases to show an icon. Memecoins in particular showed that a token's image and story matter to its community.
ERC-7729 borrows the idea from NFTs (ERC-721 tokenURI): the token contract itself returns a URI, and that URI points to a small JSON document.
How it works
A compliant token implements ERC-20 plus one extra view function:
function metadata() external view returns (string memory);
It returns a URI (for example ipfs://... or https://...) to a JSON file following the ERC-7729 metadata schema:
| Field | Meaning |
|---|---|
name |
Identifies the asset the token represents |
description |
Describes the asset |
image |
URI to an image/* resource representing the asset |
That's the whole standard. Existing ERC-20 behaviour is untouched, so the extension is fully backward compatible; tools that don't know about metadata() simply ignore it.
Sample code
A token built on OpenZeppelin's ERC20 with an updatable metadata URI:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IERC7729 is IERC20 {
function metadata() external view returns (string memory);
}
contract MemeToken is ERC20, IERC7729 {
string private _metadata;
constructor(string memory uri) ERC20("Meme", "MEME") {
_metadata = uri;
_mint(msg.sender, 1_000_000e18);
}
function metadata() external view returns (string memory) {
return _metadata;
}
}
The JSON the URI points to:
{
"name": "Meme",
"description": "Community token for the Meme project.",
"image": "ipfs://<cid>/logo.png"
}
Things to know
- Status: Draft. The spec text is short and has small inconsistencies (the interface is named
IERC20Metadatain one place andIERC7729in another), so expect edits. - Don't confuse it with OpenZeppelin's existing
IERC20Metadata, which only coversname/symbol/decimals. - The URI is untrusted input: it may point to phishing or malicious content. Wallets and indexers should validate and sanitize what they fetch.
- If the metadata must not change, store it on content-addressed storage (IPFS/Arweave) and don't add a setter.