Open CryptoPascal31 opened 6 months ago
If referencing https://eips.ethereum.org/EIPS/eip-7572 then I am in full agreement, this will be a nice quality of life upgrade for collections. I would also recommend projects store this on a service like s3/digital ocean as you may want to update graphics down the road.
The idea behind this PR is to attach meta information to a collection. The metadata is a JSON file referenced by a URI attached to the collection. Once defined, this URI is immutable.
This idea is currently being discussed for Ethereum too: https://eips.ethereum.org/EIPS/eip-7572
Attaching a URI to a collection is still optional. The new version of the collection policy is backward compatible:
The function
(create-collection)
, and event(CREATE-COLLECTION)
keep the same signatures.Two new functions are added:
(create-collection-with-uri)
: idstring
namestring
sizeinteger
creatorstring
creator-guardguard
uristring
: Create a new collection with an URI.(set-uri)
: idstring
uristring
: Add a URI to a previously created collection without URI. Can only be used once.Once the URI is set with one of the two functions, the URI is immutable and can't be changed.
A new event is added:
(COLLECTION-URI)
: uristring
: Emitted when a URI is added to a collection. When(create-collection-with-uri)
is used, both events(CREATE-COLLECTION)
and(COLLECTION-URI)
are emitted.Included the JSON schema based on ERC-7572.
Since the DB schema is updated, the collection policy won't bless the previous one. And a migration transaction (signed by the governance) will be required.