OOPS

OOPS (Object Operating and Positioning System) is the contract responsible for handling the registration and management of relations, transforms, and spaces, while also overseeing object interactions and positioning within the protocol.

Functions

registerRelation

Registers a new relation

function registerRelation(bytes32 desc, RelationRule memory rule, uint64[] memory adjSpec) external returns (uint64);

Parameters

NameTypeDescription
descbytes32The description of the relation
ruleRelationRuleThe rule defining the relation's behavior
adjSpecuint64[]The adjacency specification for the relation

Returns

NameTypeDescription
<none>uint64The ID of the newly registered relation

updateRelation

Updates an existing relation

function updateRelation(uint64 rel, bytes32 desc) external;

Parameters

NameTypeDescription
reluint64The ID of the relation to update
descbytes32The new description of the relation

transferRelation

Transfers ownership of a relation to another address

function transferRelation(uint64 rel, address to) external;

Parameters

NameTypeDescription
reluint64The ID of the relation
toaddressThe address to transfer ownership to

registerSpace

Registers a new space at a specific block

function registerSpace(uint64 block, bytes32 desc) external;

Parameters

NameTypeDescription
blockuint64The block number of the space
descbytes32The description of the space

updateSpace

Updates an existing space

function updateSpace(uint64 block, bytes32 desc, uint64[] memory rels) external;

Parameters

NameTypeDescription
blockuint64The block number of the space
descbytes32The new description of the space
relsuint64[]Updated relations in the space

transferSpace

Transfers ownership of a space to another address

function transferSpace(uint64 block, address to) external;

Parameters

NameTypeDescription
blockuint64The block number of the space
toaddressThe address to transfer ownership to

relate

Relates a dependent object to a destination object

function relate(uint256 dep, uint128 dest) external;

Parameters

NameTypeDescription
depuint256The ID of the dependent object
destuint128The ID of the destination object

relate

Relates multiple dependent objects to a destination object

function relate(uint256[] memory deps, uint128 dest) external;

Parameters

NameTypeDescription
depsuint256[]Array of dependent object IDs
destuint128The ID of the destination object

unrelate

Unrelates a dependent object from a destination object

function unrelate(uint256 dep, uint128 dest) external;

Parameters

NameTypeDescription
depuint256The ID of the dependent object
destuint128The ID of the destination object

unrelate

Unrelates multiple dependent objects from a destination object

function unrelate(uint256[] memory deps, uint256 dest) external;

Parameters

NameTypeDescription
depsuint256[]Array of dependent object IDs
destuint256The ID of the destination object

move

Moves an object to a new position

function move(uint256 obj, uint128 pos) external;

Parameters

NameTypeDescription
objuint256The ID of the object
posuint128The new position of the object

move

Moves multiple objects to a new position

function move(uint256[] memory objs, uint128 pos) external;

Parameters

NameTypeDescription
objsuint256[]Array of object IDs
posuint128The new position of the objects

Events

RelationRegistered

Emitted when a new relation is registered

event RelationRegistered(uint64 rel, RelationRule rule, uint64[] adjSpec, bytes32 desc, address owner);

Parameters

NameTypeDescription
reluint64The ID of the registered relation
ruleRelationRuleThe rule defining the relation's behavior
adjSpecuint64[]Specifies adjacencies or dependencies for the relation
descbytes32The description of the relation
owneraddressThe owner of the relation

RelationUpdated

Emitted when an existing relation is updated

event RelationUpdated(uint64 rel, bytes32 desc);

Parameters

NameTypeDescription
reluint64The ID of the updated relation
descbytes32The updated description of the relation

RelationTransferred

Emitted when a relation's ownership is transferred

event RelationTransferred(uint64 rel, address from, address to);

Parameters

NameTypeDescription
reluint64The ID of the transferred relation
fromaddressThe current owner of the relation
toaddressThe new owner of the relation

SpaceRegistered

Emitted when a new space is registered

event SpaceRegistered(uint64 block, bytes32 desc, address owner);

Parameters

NameTypeDescription
blockuint64The block number where the space is registered
descbytes32The description of the space
owneraddressThe owner of the space

SpaceUpdated

Emitted when a space's details are updated

event SpaceUpdated(uint64 block, bytes32 desc, uint64[] rels);

Parameters

NameTypeDescription
blockuint64The block number of the space
descbytes32The updated description of the space
relsuint64[]The updated relations in the space

SpaceTransferred

Emitted when ownership of a space is transferred

event SpaceTransferred(uint64 block, address from, address to);

Parameters

NameTypeDescription
blockuint64The block number of the space
fromaddressThe current owner of the space
toaddressThe new owner of the space

Emitted when an object is related to another object

event Related(uint256 dep, uint128 dest, uint32 rev);

Parameters

NameTypeDescription
depuint256The ID of the dependent object
destuint128The ID of the destination object
revuint32The revision number of the relation

Emitted when multiple objects are related to a destination object

event Related(uint256[] deps, uint128 dest, uint32 rev);

Parameters

NameTypeDescription
depsuint256[]Array of dependent object IDs
destuint128The ID of the destination object
revuint32The revision number of the relation

Unrelated

Emitted when an object is unrelated (disconnected) from another object

event Unrelated(uint256 dep, uint128 dest, uint32 rev);

Parameters

NameTypeDescription
depuint256The ID of the dependent object
destuint128The ID of the destination object
revuint32The revision number of the relation

Unrelated

Emitted when multiple objects are unrelated from a destination object

event Unrelated(uint256[] deps, uint128 dest, uint32 rev);

Parameters

NameTypeDescription
depsuint256[]Array of dependent object IDs
destuint128The ID of the destination object
revuint32The revision number of the relation

Moved

Emitted when the position of an object is changed

event Moved(uint256 obj, uint128 pos);

Parameters

NameTypeDescription
objuint256The ID of the object being moved
posuint128The new position of the object

Moved

Emitted when multiple objects are moved to a new position

event Moved(uint256[] objs, uint128 pos);

Parameters

NameTypeDescription
objsuint256[]Array of object IDs being moved
posuint128The new position of the objects

Structs

RelationRule

Describes the rules of a relation between objects.

struct RelationRule {
    uint8 ownerOnForm;
    uint8 posOnForm;
    uint8 connOnForm;
    uint8 ownerOnTerm;
    uint8 posOnTerm;
    uint8 connOnTerm;
}