Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SetSolo

Git Source

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

NameTypeDescription
iduint64Object ID
krev0uint32New kind revision (0 = no change)
srev0uint32New set revision (0 = no change)

Returns

NameTypeDescription
descDescriptorod 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

NameTypeDescription
iduint64Object ID

Returns

NameTypeDescription
odDescriptorDescriptor after touch

transfer

Transfer ownership of an object

function transfer(uint64 id, address to) external virtual override onlyObjectOwner(id);

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 override returns (string memory uri_);

Returns

NameTypeDescription
uri_stringURI template string

owner

Get current owner of an object

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

Parameters

NameTypeDescription
iduint64Object ID

Returns

NameTypeDescription
owner_addressCurrent owner address

descriptor

Get descriptor at a specific revision

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

Parameters

NameTypeDescription
iduint64Object ID
rev0uint32Revision number (0 = latest)

Returns

NameTypeDescription
odDescriptorDescriptor 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

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

Returns

NameTypeDescription
odDescriptorDescriptor at the specified revision
elemsbytes32[]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;
}