ISet
Inherits: IERC165
Core interface for set contracts
Functions
upgrade
Upgrade an object to a new kind or set revision
function upgrade(uint64 id, uint32 krev0, uint32 srev0) external returns (Descriptor memory od);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
krev0 | uint32 | New kind revision (0 = no change) |
srev0 | uint32 | New set revision (0 = no change) |
Returns
| Name | Type | Description |
|---|---|---|
od | Descriptor | Descriptor after upgrade |
touch
Touch an object to increment revision without content change
function touch(uint64 id) external returns (Descriptor memory od);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
Returns
| Name | Type | Description |
|---|---|---|
od | Descriptor | Descriptor after touch |
transfer
Transfer ownership of an object
function transfer(uint64 id, address to) external;
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
to | address | Address of the new owner |
owner
Get current owner of an object
function owner(uint64 id) external view returns (address owner_);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
Returns
| Name | Type | Description |
|---|---|---|
owner_ | address | Current owner address |
descriptor
Get descriptor at a specific revision
function descriptor(uint64 id, uint32 rev0) external view returns (Descriptor memory od);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
rev0 | uint32 | Revision number (0 = latest) |
Returns
| Name | Type | Description |
|---|---|---|
od | Descriptor | Descriptor at that revision |
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
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
rev0 | uint32 | Revision number to query (0 = latest) |
Returns
| Name | Type | Description |
|---|---|---|
od | Descriptor | Descriptor at the specified revision |
elems | bytes32[] | Elements at the specified revision |
uri
Get URI template for metadata
Client should replace {id} and {rev} placeholders
function uri() external view returns (string memory uri_);
Returns
| Name | Type | Description |
|---|---|---|
uri_ | string | URI template string |
Events
Created
Emitted when a new object is created
event Created(uint64 id, Descriptor od, bytes32[] elems, address owner);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
od | Descriptor | Object descriptor |
elems | bytes32[] | Elements of the object |
owner | address | Initial owner |
Updated
Emitted when an object is updated
event Updated(uint64 id, Descriptor od, bytes32[] elems);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
od | Descriptor | Updated descriptor |
elems | bytes32[] | Updated elements |
Upgraded
Emitted when an object is upgraded
event Upgraded(uint64 id, Descriptor od);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
od | Descriptor | Descriptor after upgrade |
Touched
Emitted when an object is touched (bumped without content change)
event Touched(uint64 id, Descriptor od);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
od | Descriptor | Latest descriptor |
Destroyed
Emitted when an object is destroyed
event Destroyed(uint64 id, Descriptor od);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
od | Descriptor | Descriptor before destruction |
Transferred
Emitted when ownership is transferred
event Transferred(uint64 id, Descriptor od, address from, address to);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
od | Descriptor | Descriptor after the transfer |
from | address | Previous owner |
to | address | New owner |