Skip to main content

Guides

KindRegistry

InvalidDesc

error InvalidDesc()

InvalidCode

error InvalidCode()

InvalidStateSpec

error InvalidStateSpec()

InvalidRelationSpec

error InvalidRelationSpec()

MethodDisabled

error MethodDisabled()

PseduoStateArray

struct PseduoStateArray {
bytes32 stateSpec;
bytes32 code;
bytes32 relSpec0;
bytes32 relSpec1;
bytes32 desc;
}

STATE_SPEC_FIELD

uint256 STATE_SPEC_FIELD

CODE_FIELD

uint256 CODE_FIELD

REL_SPEC_FIELD0

uint256 REL_SPEC_FIELD0

REL_SPEC_FIELD1

uint256 REL_SPEC_FIELD1

DESC_FIELD

uint256 DESC_FIELD

STATE_SIZE

uint256 STATE_SIZE

constructor

constructor() public

initialize

function initialize(address initialOwner, uint64 universe, string baseUri, address setRegistry, address relRegistry, bytes32 codeKindOfKind, bytes32 descKindOfKind, bytes32 codeKindOfSet, bytes32 descKindOfSet) public

register

function register(bytes32 code, enum ElementType[] stateSpec, uint64[] relSpec, bytes32 desc) external returns (uint64)

Registers a new kind in the registry

Parameters

NameTypeDescription
codebytes32Unique code for the kind
stateSpecenum ElementType[]State specification for the kind
relSpecuint64[]Relation specification for the kind
descbytes32Description of the kind

Return Values

NameTypeDescription
[0]uint64id The unique identifier of the newly created kind

update

function update(uint64 id, bytes32 code, bytes32 desc) external returns (struct ObjectMeta)

Updates the kind identified by id

Parameters

NameTypeDescription
iduint64Identifier of the kind to update
codebytes32Updated code for the kind
descbytes32Updated description of the kind

Return Values

NameTypeDescription
[0]struct ObjectMetameta Updated metadata of the kind

update

function update(uint64 id, bytes32 code, bytes32 desc, uint64[] relSpec) external returns (struct ObjectMeta)

Overloaded update function with relation specification

Parameters

NameTypeDescription
iduint64Identifier of the kind to update
codebytes32Updated code for the kind
descbytes32Updated description of the kind
relSpecuint64[]Updated relation specification

Return Values

NameTypeDescription
[0]struct ObjectMetameta Updated metadata of the kind

codeAt

function codeAt(uint64 id, uint32 rev) external view returns (bytes32)

Retrieves the code of a kind by id and revision number

Parameters

NameTypeDescription
iduint64Identifier of the kind
revuint32Revision number

Return Values

NameTypeDescription
[0]bytes32The code associated with the specified id and revision

stateSpecAt

function stateSpecAt(uint64 id, uint32 rev) external view returns (enum ElementType[])

Retrieves the state specification of a kind by id and revision number

Parameters

NameTypeDescription
iduint64Identifier of the kind
revuint32Revision number

Return Values

NameTypeDescription
[0]enum ElementType[]An array of ElementType representing the state specification

relSpecAt

function relSpecAt(uint64 id, uint32 rev) external view returns (uint64[])

Retrieves the relation specification of a kind by id and revision number

Parameters

NameTypeDescription
iduint64Identifier of the kind
revuint32Revision number

Return Values

NameTypeDescription
[0]uint64[]An array of uint64 representing the relation specification

update

function update(uint64, bytes32[]) public pure returns (struct ObjectMeta)