Skip to main content

mQuarkRegistry

Entry smart contract for the protocol. It manages the Entity registration, it acts like a factory contract; deploys a new entity contract every time a new entity is registered.

Functions

setControllerAddress

 function setControllerAddress(address _controller) external

Sets the address of the controller contract.

Parameters:

NameTypeDescription
controlleraddressThe address of the controller contract.

setSubscriberAddress

 function setSubscriberAddress(address _subscriber) external

Sets the address of the subscriber contract.

Parameters:

NameTypeDescription
_subscriberaddressThe address of the subscriber contract.

setImplementationAddress

function setImplementationAddress(uint8 _id, address _implementation) external;

Sets the implementation address for a specific ID.

Parameters:

NameTypeDescription
_iduint8The ID for which the implementation address is being set.
_implementationaddressThe address of the implementation.

registerEntity

function registerEntity(
string calldata _entityName,
string calldata _description,
string calldata _thumbnail,
string calldata _entitySlotDefaultURI,
uint256 _slotPrice
) external returns (address _instance);

Registers a new entity.

Parameters:

NameTypeDescription
_entityNamestringThe name of the entity..
_descriptionstringThe description of the entity.
_thumbnailstringThe thumbnail image of the entity.
_entitySlotDefaultURIstringThe default URI for entity slots.
_slotPriceuint256The price for subscribing to entity slots.

Return Values:

NameTypeDescription
_instancestringThe deployed address of the entity..

getEntityIsRegistered

function getEntityIsRegistered(address _contractAddress) external view returns (bool)

Returns a boolean indicating whether the entity is registered or not.

Parameters:

NameTypeDescription
_contractAddressaddressThe contract address of the entity.

Return Values:

TypeDescription
boolA boolean indicating if the entity is registered.

getEntityId

function getEntityId(address _contractAddress) external view returns (uint256)

Returns the entity ID associated with a given contract address.

Parameters:

NameTypeDescription
_contractAddressaddressThe contract address of the entity.

Return Values:

TypeDescription
uint256The entity ID associated with the contract address.

getEntityAddress

function getEntityAddress(uint256 _entityId) external view returns (address)

Returns the contract address associated with a given entity ID.

Parameters:

NameTypeDescription
_entityIduint256The entity ID.

Return Values:

TypeDescription
addressThe contract address associated with the entity ID.

getImplementation

function getImplementation(uint8 _implementation) external view returns (address)

Returns the implementation address associated with a given implementation ID.

Parameters:

NameTypeDescription
_implementationuint8The implementation ID.

Return Values:

TypeDescription
addressThe implementation address associated with the implementation ID.

getController

function getController() external view returns (address)

Returns the address of the controller.

Return Values:

TypeDescription
addressThe address of the controller.

getSubscriber

function getSubscriber() external view returns (address)

Returns the address of the subscriber contract.

Return Values:

TypeDescription
addressThe address of the subscriber contract.

getControllerAndSubscriber

function getControllerAndSubscriber() external view returns (address, address)

Returns the addresses of the controller and the subscriber.

Return Values:

TypeDescription
addressThe addresses of the controller and the subscriber.

getRegisteredEntity

function getRegisteredEntity(
uint256 _entityId
)
external
view
returns (
address contractAddress,
address creator,
uint256 id,
string memory name,
string memory description,
string memory thumbnail,
string memory entitySlotDefaultURI
)

Returns registered entity

Return Values:

NameTypeDescription
contractAddressaddressContract address
creatoraddressCreator address
iduint256ID
namestringName
descriptionstringDescription
thumbnailstringThumbnail
entitySlotDefaultURIstringSlot default URI

getLastEntityId

  function getLastEntityId() external view returns (uint256)

Returns the ID of the last registered entity.

Return Values:

TypeDescription
uint256The ID of the last registered entity..

Events

SubscriberSet

event SubscriberSet(address subscriber);

Emitted when the subscriber contract address is set.

Parameters:

NameTypeDescription
subscriberaddressThe address of the subscriber contract.

ControllerSet

event ControllerSet(address controller);

Emitted when the controller contract address is set.

Parameters:

NameTypeDescription
controlleraddressThe address of the controller contract.

ImplementationSet

  event ImplementationSet(uint256 id, address implementation);

Emitted when the implementation contract address is set for a specific ID.

Parameters:

NameTypeDescription
iduint256The ID of the implementation.
implementationaddressThe address of the implementation contract.

EntityRegistered

 event EntityRegistered(
address entity,
address contractAddress,
uint256 entityId,
string entityName,
string description,
string thumbnail,
string entityDefaultSlotURI,
uint256 subscriptionPrice
);

Emitted when an entity is registered to the contract.

Parameters:

NameTypeDescription
entityaddressThe address of the entity.
contractAddressaddressThe address of the contract.
entityIduint256The ID of the entity.
entityNamestringThe name of the entity.
descriptionstringThe description of the entity.
thumbnailstringThe thumbnail image URL of the entity.
entityDefaultSlotURIstringThe default URI for the entity's slots.
subscriptionPriceuint256The price for the entity's subscription slot.