Skip to content

feat: add ERC7572 interface for contracts that expose contract level metadata #5686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fluffy-bananas-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---

`IERC7572`: Add interface to support contract-level metadata.
18 changes: 18 additions & 0 deletions contracts/interfaces/draft-IERC7572.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/draft-IERC7572.sol)

pragma solidity ^0.8.20;

/// @title ERC-7572 Contract Level Metadata
/// @dev Required interface of an ERC-7572 compliant contract, as defined in the
/// https://eips.ethereum.org/EIPS/eip-7572[ERC].
interface IERC7572 {
/// @dev This event should be emitted on updates to the contract metadata
/// to indicate to offchain indexers that they should query the contract
/// for the latest URI.
event ContractURIUpdated();

/// @dev Returns an offchain resource for contract metadata or onchain JSON
/// data string (data:application/json;utf8,{}).
function contractURI() external view returns (string memory);
}