Skip to content

IUniverseRegistry

IUniverseRegistry

AccountIsNotAuthorizedOperatorForUniverseManagement

error AccountIsNotAuthorizedOperatorForUniverseManagement(uint256 universeId, address account)

Thrown when the message sender does not own UNIVERSE_WIZARD role and is not Universe owner.

Name Type Description
universeId uint256 The Universe ID.
account address The account that was checked.

AccountIsNotUniverseWizard

error AccountIsNotUniverseWizard(address account)

Thrown when the message sender does not own UNIVERSE_WIZARD role.

AccountIsNotUniverseOwner

error AccountIsNotUniverseOwner(address account)

Thrown when a check is made where the given account must also be the Universe owner.

PaymentTokenIsNotRegistered

error PaymentTokenIsNotRegistered(address paymentToken)

Thrown when a check is made when given token is not registered for the universe.

PaymentTokenAlreadyRegistered

error PaymentTokenAlreadyRegistered(address paymentToken)

Thrown when trying to add payment token that is already register for the universe.

EmptyUniverseName

error EmptyUniverseName()

Thrown when a the supplied universe name is empty.

EmptyListOfUniversePaymentTokens

error EmptyListOfUniversePaymentTokens()

Thrown when trying to register a universe with empty list of payment tokens.

QueryForNonExistentUniverse

error QueryForNonExistentUniverse(uint256 universeId)

Thrown when trying to read universe data for a universe is not registered.

UniverseCreated

event UniverseCreated(uint256 universeId, string name, address[] paymentTokens)

Emitted when a universe is created.

Name Type Description
universeId uint256 Universe ID.
name string Universe name.
paymentTokens address[] Universe token.

UniverseNameChanged

event UniverseNameChanged(uint256 universeId, string name)

Emitted when a universe name is changed.

Name Type Description
universeId uint256 Universe ID.
name string The newly set name.

PaymentTokenRegistered

event PaymentTokenRegistered(uint256 universeId, address paymentToken)

Emitted when a universe payment token is registered.

Name Type Description
universeId uint256 Universe ID.
paymentToken address Universe payment token.

PaymentTokenRemoved

event PaymentTokenRemoved(uint256 universeId, address paymentToken)

Emitted when a universe payment token is disabled.

Name Type Description
universeId uint256 Universe ID.
paymentToken address Universe payment token.

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 ("/").

UniverseParams

struct UniverseParams {
  string name;
  address[] paymentTokens;
}

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 universeName) external

Update the universe name.

Name Type Description
universeId uint256 The unique identifier for the universe.
universeName string The universe name to set.

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.

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.

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.

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[]

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.

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.

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.