Inherits: IERC165

Minimal interface for set contracts

Functions

upgrade

Upgrade an object to a new kind or set revision

function upgrade(uint64 id, uint32 kindRev0, uint32 setRev0) external returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Object ID
kindRev0uint32New kind revision (0 = no change)
setRev0uint32New set revision (0 = no change)

Returns

NameTypeDescription
odDescriptorDescriptor after upgrade

touch

Touch an object to increment revision without content change

function touch(uint64 id) external returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Object ID

Returns

NameTypeDescription
odDescriptorDescriptor after touch

transfer

Transfer ownership of an object

function transfer(uint64 id, address to) external;

Parameters

NameTypeDescription
iduint64Object ID
toaddressAddress of the new owner

uri

Get URI template for metadata

Client should replace {id} and {rev} placeholders

function uri() external view returns (string memory uri_);

Returns

NameTypeDescription
uri_stringURI template string

owner

Get current owner of an object

function owner(uint64 id) external view returns (address owner_);

Parameters

NameTypeDescription
iduint64Object ID

Returns

NameTypeDescription
owner_addressCurrent owner address

revision

Resolve and validate a revision number

function revision(uint64 id, uint32 rev0) external view returns (uint32 rev);

Parameters

NameTypeDescription
iduint64Object ID
rev0uint32Revision to check (0 = latest)

Returns

NameTypeDescription
revuint32Valid revision (0 if invalid)

descriptor

Get descriptor at a specific revision

function descriptor(uint64 id, uint32 rev0) external view returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Object ID
rev0uint32Revision number (0 = latest)

Returns

NameTypeDescription
odDescriptorDescriptor at that revision

elements

Get elements at a specific revision

function elements(uint64 id, uint32 rev0) external view returns (bytes32[] memory elems);

Parameters

NameTypeDescription
iduint64Object ID
rev0uint32Revision number (0 = latest)

Returns

NameTypeDescription
elemsbytes32[]Elements array at that revision

sota

Get the latest descriptor and current owner

function sota(uint64 id) external view returns (Descriptor memory od, address owner_);

Parameters

NameTypeDescription
iduint64Object ID

Returns

NameTypeDescription
odDescriptorDescriptor at the specified revision
owner_addressCurrent owner (not historical)

snapshot

Get descriptor and elements at a specific revision

function snapshot(uint64 id, uint32 rev0) external view returns (Descriptor memory od, bytes32[] memory elems);

Parameters

NameTypeDescription
iduint64Object ID
rev0uint32Revision number to query (0 = latest)

Returns

NameTypeDescription
odDescriptorDescriptor at the specified revision
elemsbytes32[]Elements at the specified revision

Events

Created

Emitted when a new object is created

event Created(uint64 id, Descriptor od, bytes32[] elems, address owner);

Parameters

NameTypeDescription
iduint64Object ID
odDescriptorObject descriptor
elemsbytes32[]Elements of the object
owneraddressInitial owner

Updated

Emitted when an object is updated

event Updated(uint64 id, Descriptor od, bytes32[] elems);

Parameters

NameTypeDescription
iduint64Object ID
odDescriptorUpdated descriptor
elemsbytes32[]Updated elements

Upgraded

Emitted when an object is upgraded

event Upgraded(uint64 id, Descriptor od);

Parameters

NameTypeDescription
iduint64Object ID
odDescriptorDescriptor after upgrade

Touched

Emitted when an object is touched (bumped without content change)

event Touched(uint64 id, Descriptor od);

Parameters

NameTypeDescription
iduint64Object ID
odDescriptorLatest descriptor

Destroyed

Emitted when an object is destroyed

event Destroyed(uint64 id, Descriptor od);

Parameters

NameTypeDescription
iduint64Object ID
odDescriptorDescriptor before destruction

Transferred

Emitted when ownership is transferred

event Transferred(uint64 id, address from, address to);

Parameters

NameTypeDescription
iduint64Object ID
fromaddressPrevious owner
toaddressNew owner