Extending NEP-171 Events Standard to include contract metadata `update` events
- lachlanglenOP 6
Summary:
To extend the NEP-171 events standard to include
contract_metadata_updateevent.Motivation:
The existing events standard for NFTs as described in NEP-171 does not include any events to be logged when an NFT contract’s metadata is updated.
This results in situations where, for instance, a contract owner will update the contract’s
base_uriafter it is initially deployed, likely a reference to a dedicated IPFS gateway, but none of the contract consumers (wallets, marketplaces etc) are aware of this change and continue serving the NFT media from less reliable/available gateways. Acontract_metadata_updateevent would alert listeners of any change to contract metadata and enable them to remain up-to-date.Specification
contract_metadata_updateEmitted by NFT contract when any field of
NFTContractMetadatais updated. Includes fields that have been updatedEVENT_JSON:{ "standard": "nep171", "version": "1.1.0", "event": "contract_metadata_update", "data": [{ "metadata": { "base_uri": "..." }}] } - minorityprogrammers 2
I’m for this, want to know if this is more appropriate to put in “standards” section @ori-near
- mattlockyer 1
This makes sense! LGTM!
- nearbuild
can we get to pushing this on github as a PR if its GTG (good to go)
- lachlanglen 1
- minorityprogrammers
Olga replied with adding a dynamic NFT flag Support individual NFT metadata logs / dynamic NFTs · Issue #438 · near/NEPs · GitHub
- lachlanglen
FYI this has been implemented: add contract_metadata_update event by lachlanglen · Pull Request #423 · near/NEPs · GitHub
- till_mb
Related to my post in the token update event standard, let’s keep discussions split for now but hope to do a merged NEP once concerns have been addressed.
I think we should base the event on metadata NEP177, not on core NEP171, as this has obviously a lot more to do with the former. Other than than, it seems to me that the
datafield wouldn’t need to be an array (should only ever update the contract from which the event is emitted). Now for my draft I also removed the{metadata : {...}}nesting, which might actually useful in case non-metadata is updated along with it. Other than that, additional properties might always be present in the extensible metadata type, so it’s not strictly necessary:EVENT_JSON:{ "standard": "nep177", // use corresponding metadata NEP as event basis "version":" 1.0.0", "event": "nft_update_contract", "data": { "base_uri": "..." } // remove nesting and array }Regarding the naming, the currently standardized function
nft_metadatayields contract-level metadata, so it would make sense for me to keep thenft_prefix. I have named this consistently asnft_update_contractw.r.tnft_update_tokenon the token update discussion.