---
eip: 7572
label: ERC-7572
title: Contract-level metadata via `contractURI()`
status: Draft
type: Standards Track
category: ERC
created: 2023-12-06
official: https://eips.ethereum.org/EIPS/eip-7572
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7572.md
canonical: https://eips.huatuo.xyz/eip-7572/
lang: en
tldr: "Standardises the long-used contractURI() function and a ContractURIUpdated event so dapps and indexers can show a contract's name, description, images and links from one JSON document."
tags: [metadata, nft, marketplaces, json]
---

# ERC-7572: Contract-level metadata via `contractURI()`

> Specifying and updating contract-level metadata

**TL;DR:** Standardises the long-used contractURI() function and a ContractURIUpdated event so dapps and indexers can show a contract's name, description, images and links from one JSON document.

## What problem does it solve?

Token-level metadata already has a home: `tokenURI` for [ERC-721](/eip-721/) and `uri` for [ERC-1155](/eip-1155/). But a collection or token contract as a whole also needs a profile: a display name, description, logo, banner and website. Marketplaces have read a `contractURI()` function for years, yet there was no ERC defining it, and no reliable way to tell indexers that the data had changed.

ERC-7572 writes down the de facto function, a JSON schema for what it returns, and an event to signal updates.

## How it works

The contract implements:

```solidity
interface IERC7572 {
    function contractURI() external view returns (string memory);
    event ContractURIUpdated();
}
```

- `contractURI()` returns either a link to an off-chain document (`ipfs://`, `https://`, ...) or inline JSON as a `data:application/json;utf8,{...}` string.
- The JSON must be an object with at least `name`. Optional fields: `symbol`, `description`, `image` (profile picture), `banner_image`, `featured_image`, `external_link`, and `collaborators` (addresses allowed to edit the contract's info on dapps).
- Emit `ContractURIUpdated()` whenever the metadata changes so indexers know to refetch.
- If the contract also has `name()` or `symbol()`, the values in `contractURI` are recommended to take precedence, which lets creators rename a collection without redeploying.

How the URI is set is up to the contract; a simple owner-only setter is typical.

## Sample code

A collection with updatable contract metadata:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MyCollection is ERC721, Ownable {
    event ContractURIUpdated();

    string private _contractURI;

    constructor(string memory uri_) ERC721("My Collection", "MYC") Ownable(msg.sender) {
        _contractURI = uri_;
    }

    function contractURI() external view returns (string memory) {
        return _contractURI;
    }

    function setContractURI(string calldata newURI) external onlyOwner {
        _contractURI = newURI;
        emit ContractURIUpdated();
    }
}
```

The JSON it points to:

```json
{
  "name": "My Collection",
  "symbol": "MYC",
  "description": "Hand-drawn landscapes, one per day.",
  "image": "ipfs://<cid>/logo.png",
  "banner_image": "ipfs://<cid>/banner.png",
  "external_link": "https://example.com",
  "collaborators": []
}
```

## Things to know

- **Status: Draft**, even though many marketplaces already read `contractURI()`. Details of the schema could still change.
- Addresses listed in `collaborators` may be given admin-level editing rights on dapps that honour this standard; only list addresses you trust.
- The function is not limited to NFTs; any contract (including fungible tokens) can expose it.
- Future ERCs may extend the schema with more fields.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7572
