Skip to main content

Sets

A set is a place where a group of objects are created in the Previous Network.

A set itself is an object and consists of two elements: impl and data.

All sets are minted from the Set Registry, which is the collection of all set objects.

As an object, a set also has a kind, which is the kind of all set objects, called Set Archetype.

Creation

The Set Registry is a genesis object, created when the protocol is deployed.

User-defined sets are created when they are registered at the Set Registry.

The following elements of a set must be specified when registering.

Impl

The impl element defines the implementation contract of this set on the universe chain.

  • It is a big-endian encoded uint256.
  • On the Ethereum network, the uint256 is computed as follows:
    • impl = uint256(uint160(address))

Data

The data element is a hash of a JSON material.

  • The JSON data must have "name" and "description" fields, and optionally an "image" field. These fields are used in the kind contract of the Set Archetype object to generate meta assets for the set object.
  • The JSON data can have other fields, which can be used in the kind contract to compute assets for objects from it.
  • The content-type of the data material is application/json.
  • The data material must be added to the Previous chain before its hash can be used.

Update

Sets can be updated to change the data element. The impl element of a set object cannot be modified.

When a set is updated, the revision of the set object itself is increased. All objects already minted from this set will not be affected. If an object's owner chooses to upgrade the object's set to the newer revision, the object's revision is increased, and only then can the new data introduced by the specific revision be applied.