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:
Name | Type | Description |
---|
controller | address | The address of the controller contract. |
setSubscriberAddress
function setSubscriberAddress(address _subscriber) external
Sets the address of the subscriber contract.
Parameters:
Name | Type | Description |
---|
_subscriber | address | The address of the subscriber contract. |
setImplementationAddress
function setImplementationAddress(uint8 _id, address _implementation) external;
Sets the implementation address for a specific ID.
Parameters:
Name | Type | Description |
---|
_id | uint8 | The ID for which the implementation address is being set. |
_implementation | address | The 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:
Name | Type | Description |
---|
_entityName | string | The name of the entity.. |
_description | string | The description of the entity. |
_thumbnail | string | The thumbnail image of the entity. |
_entitySlotDefaultURI | string | The default URI for entity slots. |
_slotPrice | uint256 | The price for subscribing to entity slots. |
Return Values:
Name | Type | Description |
---|
_instance | string | The 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:
Name | Type | Description |
---|
_contractAddress | address | The contract address of the entity. |
Return Values:
Type | Description |
---|
bool | A 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:
Name | Type | Description |
---|
_contractAddress | address | The contract address of the entity. |
Return Values:
Type | Description |
---|
uint256 | The 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:
Name | Type | Description |
---|
_entityId | uint256 | The entity ID. |
Return Values:
Type | Description |
---|
address | The 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:
Name | Type | Description |
---|
_implementation | uint8 | The implementation ID. |
Return Values:
Type | Description |
---|
address | The implementation address associated with the implementation ID. |
getController
function getController() external view returns (address)
Returns the address of the controller.
Return Values:
Type | Description |
---|
address | The address of the controller. |
getSubscriber
function getSubscriber() external view returns (address)
Returns the address of the subscriber contract.
Return Values:
Type | Description |
---|
address | The address of the subscriber contract. |
getControllerAndSubscriber
function getControllerAndSubscriber() external view returns (address, address)
Returns the addresses of the controller and the subscriber.
Return Values:
Type | Description |
---|
address | The 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:
Name | Type | Description |
---|
contractAddress | address | Contract address |
creator | address | Creator address |
id | uint256 | ID |
name | string | Name |
description | string | Description |
thumbnail | string | Thumbnail |
entitySlotDefaultURI | string | Slot default URI |
getLastEntityId
function getLastEntityId() external view returns (uint256)
Returns the ID of the last registered entity.
Return Values:
Type | Description |
---|
uint256 | The ID of the last registered entity.. |
Events
SubscriberSet
event SubscriberSet(address subscriber);
Emitted when the subscriber contract address is set.
Parameters:
Name | Type | Description |
---|
subscriber | address | The address of the subscriber contract. |
ControllerSet
event ControllerSet(address controller);
Emitted when the controller contract address is set.
Parameters:
Name | Type | Description |
---|
controller | address | The 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:
Name | Type | Description |
---|
id | uint256 | The ID of the implementation. |
implementation | address | The 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:
Name | Type | Description |
---|
entity | address | The address of the entity. |
contractAddress | address | The address of the contract. |
entityId | uint256 | The ID of the entity. |
entityName | string | The name of the entity. |
description | string | The description of the entity. |
thumbnail | string | The thumbnail image URL of the entity. |
entityDefaultSlotURI | string | The default URI for the entity's slots. |
subscriptionPrice | uint256 | The price for the entity's subscription slot. |