openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

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

Open coffeexcoin opened this issue 8 months ago • 5 comments

This PR introduces the interface for draft ERC-7572 to the set of interfaces in the package.

This interface is useful for contracts (particularly tokens) that wish to expose a set of metadata for the contract including icon, banner image, description, external url, etc.

PR Checklist

  • [x] Tests (No tests are necessary as this is purely an interface spec)
  • [x] Documentation (Natspec documentation is applied to the added interface)
  • [x] Changeset entry (run npx changeset add)

coffeexcoin avatar May 14 '25 03:05 coffeexcoin

🦋 Changeset detected

Latest commit: dc731cd027c800927c063045ece334e6fd4e620b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 14 '25 03:05 changeset-bot[bot]

Hi @coffeexcoin,

If I remember correctly, this interface was discussed in the context of #5394. I think we would need to use the interface in 6909 if we approve this PR

Happy to make those changes - what would be the preferred method, just make 6909ContentURI implement this interface?

coffeexcoin avatar May 24 '25 15:05 coffeexcoin

Also happy to add erc20/721/1155 extensions that implement this if that would be desirable

coffeexcoin avatar May 24 '25 15:05 coffeexcoin

I'd keep it only for 6909 for now. Other standards like ERC721 and ERC1155 define their own metadata functions. Probably that's why we decided not to include this interface in the first place

cc @arr00

ernestognw avatar May 24 '25 15:05 ernestognw

@ernestognw do you think it's ok to add an event to an interface defined in an ERC? ERC6909 doesn't define the ContractURIUpdated event. I think it should (maybe we should open a PR), but we shouldn't add it unilaterally.

arr00 avatar May 26 '25 02:05 arr00

Hey @arr00 @Amxx @ernestognw I seem to have some conflicting guidance here - can you provide some clarity on which direction you would like me to go in with regards to changes to ERC-6909?

coffeexcoin avatar Jul 09 '25 21:07 coffeexcoin

Hey @arr00 @Amxx @ernestognw I seem to have some conflicting guidance here - can you provide some clarity on which direction you would like me to go in with regards to changes to ERC-6909?

Given that contractURI() is specified by ERC6909 but ContractURIUpdated() is not, I don't think there is any role for ERC7572 to play here.

arr00 avatar Jul 09 '25 22:07 arr00

Note: if we do this change, then type(IERC6909ContentURI).interfaceId will change, as it will no longer include contractURI() in its computation.

ERC165 is not part of ERC6909 specification, but I still this this should be considered.

Amxx avatar Jul 24 '25 12:07 Amxx

Given that ERC-6909 does NOT mention ERC-7572 ... and that ERC-7572 does NOT mention ERC-7572 either ... I think we shouldn't do this change.

Closing this PR. If there are new elements, we can reopen it, or continue this discussion in an issue (following our guidelines)

Amxx avatar Jul 24 '25 12:07 Amxx