feat: add ERC7572 interface for contracts that expose contract level metadata
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)
🦋 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
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?
Also happy to add erc20/721/1155 extensions that implement this if that would be desirable
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 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.
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?
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.
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.
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)