UniverseRegistry
UniverseRegistry
UniverseRegistryInitParams
struct UniverseRegistryInitParams {
contract IACL acl;
contract IMetahub metahub;
}
onlyUniverseOwner
modifier onlyUniverseOwner(uint256 universeId)
Modifier to make a function callable only by the universe owner.
onlyUniverseWizard
modifier onlyUniverseWizard()
Modifier to make a function callable only by the owner of the UNIVERSE_WIZARD role.
onlyIsAuthorizedOperatorForUniverseManagement
modifier onlyIsAuthorizedOperatorForUniverseManagement(uint256 universeId)
Reverts if the caller is not UNIVERSE_WIZARD or Universe owner .
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe ID. |
onlyValidUniverseName
modifier onlyValidUniverseName(string universeNameToCheck)
Modifier to check if the universe name is valid.
onlyRegisteredUniverse
modifier onlyRegisteredUniverse(uint256 universeId)
Modifier to check that the universe has been registered.
constructor
constructor() public
Constructor that gets called for the implementation contract.
initialize
function initialize(struct UniverseRegistry.UniverseRegistryInitParams params) external
UniverseRegistry initializer.
Name | Type | Description |
---|---|---|
params | struct UniverseRegistry.UniverseRegistryInitParams | Initialization params. |
setUniverseTokenBaseURI
function setUniverseTokenBaseURI(string baseURI) external
Updates the universe token base URI.
Name | Type | Description |
---|---|---|
baseURI | string | New base URI. Must include a trailing slash ("/"). |
createUniverse
function createUniverse(struct IUniverseRegistry.UniverseParams params) external returns (uint256)
Creates new Universe. This includes minting new universe NFT, where the caller of this method becomes the universe owner.
Name | Type | Description |
---|---|---|
params | struct IUniverseRegistry.UniverseParams | The universe properties & initial configuration params. |
Name | Type | Description |
---|---|---|
[0] | uint256 | Universe ID (universe token ID). |
setUniverseName
function setUniverseName(uint256 universeId, string name) external
Update the universe name.
Name | Type | Description |
---|---|---|
universeId | uint256 | The unique identifier for the universe. |
name | string |
registerUniversePaymentToken
function registerUniversePaymentToken(uint256 universeId, address paymentToken) external
Registers certain payment token for universe.
Name | Type | Description |
---|---|---|
universeId | uint256 | The unique identifier for the universe. |
paymentToken | address | The universe payment token. |
removeUniversePaymentToken
function removeUniversePaymentToken(uint256 universeId, address paymentToken) external
Removes certain payment token for universe.
Name | Type | Description |
---|---|---|
universeId | uint256 | The unique identifier for the universe. |
paymentToken | address | The universe payment token. |
universe
function universe(uint256 universeId) external view returns (string name, address[] paymentTokens)
Aggregate and return Universe data.
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe-specific ID. |
Name | Type | Description |
---|---|---|
name | string | The name of the universe. |
paymentTokens | address[] |
universePaymentTokens
function universePaymentTokens(uint256 universeId) external view returns (address[] paymentTokens)
Returns the Universe payment token address.
universeToken
function universeToken() external view returns (address)
Returns the Universe token address.
universeTokenBaseURI
function universeTokenBaseURI() external view returns (string)
Returns the Universe token base URI.
universeName
function universeName(uint256 universeId) external view returns (string)
Returns name.
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe ID. |
Name | Type | Description |
---|---|---|
[0] | string | universe name. |
checkUniverseOwner
function checkUniverseOwner(uint256 universeId, address account) external view
Reverts if the universe owner is not the provided account address.
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe ID. |
account | address | The address of the expected owner. |
checkUniversePaymentToken
function checkUniversePaymentToken(uint256 universeId, address paymentToken) external view
Reverts if the universe owner is not the provided account address.
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe ID. |
paymentToken | address | The address of the payment token. |
isUniverseWizard
function isUniverseWizard(address account) external view returns (bool)
Returns `true` if the account is UNIVERSE_WIZARD.
Name | Type | Description |
---|---|---|
account | address | The account to check for. |
isUniverseOwner
function isUniverseOwner(uint256 universeId, address account) external view returns (bool)
Returns `true` if the universe owner is the supplied account address.
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe ID. |
account | address | The address of the expected owner. |
contractKey
function contractKey() external pure returns (bytes4)
Returns implemented contract key.
Name | Type | Description |
---|---|---|
[0] | bytes4 | Contract key; |
supportsInterface
function supportsInterface(bytes4 interfaceId) public view returns (bool)
_Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.
This function call must use less than 30 000 gas._
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal
_Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.
Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
```solidity function authorizeUpgrade(address) internal override onlyOwner {} ```
_acl
function _acl() internal view returns (contract IACL)
return the IACL address
_checkUniverseOwner
function _checkUniverseOwner(uint256 universeId, address account) internal view
Revert if the passed account is not the owner of the universe.
_checkUniversePaymentToken
function _checkUniversePaymentToken(uint256 universeId, address paymentToken) internal view
Revert if the passed account is not the owner of the universe.
_isValidUniverseName
function _isValidUniverseName(uint256 universeId) internal view returns (bool)
Return `true` if the universe name is valid.
_isUniverseOwner
function _isUniverseOwner(uint256 universeId, address account) internal view returns (bool)
Return `true` if the account is the owner of the universe.
_isUniversePaymentToken
function _isUniversePaymentToken(uint256 universeId, address paymentToken) internal view returns (bool isPaymentToken)
Return `true` if the account is the owner of the universe.
_isUniverseWizard
function _isUniverseWizard(address account) internal view returns (bool)