MultiOperatorHost Extension
MultiOperatorHost Extension code - MultiOperatorHost Extension address
Factory Approach
The MultiOperatorHost Extension, implementing the LazyInitCapableElement
contract, is factory-capable contract, meaning that it can be cloned and initialized via the Extension Factories. Only the EthereansOS private team multi-sig has the right to add a new Extension clonable model to the Extension Factories while everyone can clone an Extension from one of the available models.
Granular Permissions
The Extension can assign two permissions to two operators:
Create and / or mint Items
Change Collection and / or Item metadata
Only the name
, symbol
and uri
of an Item can be changed by the Extension; the host
cannot be changed.
Permissions are assigned when an Extension is cloned from the Extension Factory and initialized. (see here)
An assigned Operator address—and no one else—can reassign the permission to a new Operator address.
There can only be one Operator address per permission:
The permission table is managed via the _subjectIsAuthorizedFor
function:
To reiterate, permissions aside from the two outlined above can’t be assigned and once a Collection is linked to a MultiOperatorHost, it can’t be linked to another extension
Decimals
An itemId created via an Extension has 18 decimals on both the Main interface (the ERC1155 interface) and on its Interoperable Interface (its ERC20 interface).
MultiOperatorHost deploy and initialization
When you deploy a MultiOperatorHost Extension, you also automatically create the Items collection.
The MultiOperatorHost Extension must be cloned using the deploy method of the Extension Factory:
To correctly initialize the MultiOperatorHost Extension, you have to pass the deployData
in this way:
Functions
Change Operators addresses
Function type: write
Callable by:
Operator address
This function is used to change an Operator address and can only be called by a current Operator address. For example, the Operator with permission to create and / or mint Items can call it to give up its permission to a new Operator.
Create/Mint Items
Function type: write.
Callable by:
Operator address with the minting permission
This function can be used to create a new Item id or to mint a new amount of an existing Item id inside an already existing Collection.
In the first case, the id
parameter of the CreateItem
must be passed as 0. In the second case, it must be passed as the existing item id to mint.
Change Collection and Items Metadata
Change Collection Metadata
Function type: write.
Callable by:
Operator address with the Metadata permission
This function is used to change the Header
, and thereby the metadata, of the Collection linked to the Extension.
The input function is the new Header
struct (address
host
, string
name
, string
symbol
, string
uri
).
The host
address
cannot be changed.
The function output represents the old Collection Header
.
Change Items Metadata
Function type: write
Callable by:
Operator address with the Metadata permission
This function is used to change the Collection’s Items Metadata. As input, it takes an array of itemIds
, and a corresponding new Header
struct that contains the new Metadata.
Keep in mind that an Item has no host, so even if a host address is passed, the host will automatically be set as address(0)
.
The function’s output represents the old Items’ Header
.
Last updated