SetSolo
Inherits: ISet
State Variables
ID_MAX
uint64 private constant ID_MAX = type(uint64).max - 1
_objects
mapping(uint64 => ObjectData) internal _objects
Functions
onlyObjectOwner
Restricts function to the current object owner.
modifier onlyObjectOwner(uint64 id) ;
upgrade
Upgrade an object to a new kind or set revision
function upgrade(uint64 id, uint32 krev0, uint32 srev0)
external
virtual
override
onlyObjectOwner(id)
returns (Descriptor memory desc);
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 |
|---|---|---|
desc | Descriptor | od Descriptor after upgrade |
touch
Touch an object to increment revision without content change
function touch(uint64 id) external virtual override onlyObjectOwner(id) 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 virtual override onlyObjectOwner(id);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint64 | Object ID |
to | address | Address of the new owner |
uri
Get URI template for metadata
Client should replace {id} and {rev} placeholders
function uri() external view override returns (string memory uri_);
Returns
| Name | Type | Description |
|---|---|---|
uri_ | string | URI template string |
owner
Get current owner of an object
function owner(uint64 id) external view override 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 override 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
override
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 |
supportsInterface
Returns true if this contract implements the interface defined by
interfaceId. See the corresponding
https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
to learn more about how these ids are created.
This function call must use less than 30 000 gas.
function supportsInterface(bytes4 interfaceId) external pure virtual override returns (bool);
_onlyObjectOwner
function _onlyObjectOwner(uint64 id) internal view;
_create
function _create(address to, uint64 id, Descriptor memory od, bytes32[] memory elems)
internal
returns (Descriptor memory);
_create0
function _create0(address to, uint64 id, Descriptor memory od) internal returns (Descriptor memory);
_create1
function _create1(address to, uint64 id, Descriptor memory od, bytes32 elem0) internal returns (Descriptor memory);
_create2
function _create2(address to, uint64 id, Descriptor memory od, bytes32 elem0, bytes32 elem1)
internal
returns (Descriptor memory);
_update
function _update(uint64 id, bytes32[] memory elems) internal returns (Descriptor memory);
_upgrade
function _upgrade(uint64 id, uint32 krev0, uint32 srev0) internal returns (Descriptor memory);
_touch
function _touch(uint64 id) internal returns (Descriptor memory);
_transfer
function _transfer(uint64 id, address to) internal returns (address from);
_owner
function _owner(uint64 id) internal view returns (address);
_descriptor
function _descriptor(uint64 id, uint32 rev0) internal view returns (Descriptor memory);
_snapshot
function _snapshot(uint64 id, uint32 rev0) internal view returns (Descriptor memory od, bytes32[] memory elems);
_postCreate
function _postCreate(address to, uint64 id, Descriptor memory od, bytes32[] memory elems) internal virtual;
_postUpgrade
function _postUpgrade(uint64 id, Descriptor memory od, uint32 krev0, uint32 srev0) internal virtual;
_postUpdate
function _postUpdate(uint64 id, Descriptor memory od, bytes32[] memory elems) internal virtual;
_postTouch
function _postTouch(uint64 id, Descriptor memory od) internal virtual;
_postTransfer
function _postTransfer(uint64 id, Descriptor memory od, address from, address to) internal virtual;
_checkKindRevision
function _checkKindRevision(uint64 kind, uint32 krev0) internal view virtual returns (uint32);
_checkSetRevision
function _checkSetRevision(uint64 set, uint32 srev0) internal view virtual returns (uint32);
_SetSolo_supportsInterface
function _SetSolo_supportsInterface(bytes4 interfaceId) internal pure returns (bool);
_objectURI
function _objectURI() internal view virtual returns (string memory);
Errors
InvalidObjectId
error InvalidObjectId();
NotObjectOwner
error NotObjectOwner();
NoUpgradeTarget
error NoUpgradeTarget();
KindRevisionTooLow
error KindRevisionTooLow();
SetRevisionTooLow
error SetRevisionTooLow();
KindRevisionTooHigh
error KindRevisionTooHigh();
SetRevisionTooHigh
error SetRevisionTooHigh();
ObjectExists
error ObjectExists();
ObjectNotExist
error ObjectNotExist();
ObjectRevisionTooHigh
error ObjectRevisionTooHigh();
ObjectRevisionNotArchived
error ObjectRevisionNotArchived();
Structs
ObjectData
struct ObjectData {
Descriptor desc;
address owner;
bytes32[] elems;
}