Skip to content

IAssetClassRegistry

IAssetClassRegistry

AssetClassMismatch

error AssetClassMismatch(bytes4 provided, bytes4 required)

Thrown when the asset class supported by contract does not match the required one.

Name Type Description
provided bytes4 Provided class ID.
required bytes4 Required class ID.

AssetClassIsAlreadyRegistered

error AssetClassIsAlreadyRegistered(bytes4 assetClass)

Thrown upon attempting to register an asset class twice.

Name Type Description
assetClass bytes4 Duplicate asset class ID.

UnregisteredAssetClass

error UnregisteredAssetClass(bytes4 assetClass)

Thrown upon attempting to work with unregistered asset class.

Name Type Description
assetClass bytes4 Asset class ID.

InvalidAssetControllerInterface

error InvalidAssetControllerInterface()

Thrown when the asset controller contract does not implement the required interface.

InvalidAssetVaultInterface

error InvalidAssetVaultInterface()

Thrown when the vault contract does not implement the required interface.

AssetClassRegistered

event AssetClassRegistered(bytes4 assetClass, address controller, address vault)

Emitted when the new asset class is registered.

Name Type Description
assetClass bytes4 Asset class ID.
controller address Controller address.
vault address Vault address.

AssetClassControllerChanged

event AssetClassControllerChanged(bytes4 assetClass, address newController)

Emitted when the asset class controller is changed.

Name Type Description
assetClass bytes4 Asset class ID.
newController address New controller address.

AssetClassVaultChanged

event AssetClassVaultChanged(bytes4 assetClass, address newVault)

Emitted when the asset class vault is changed.

Name Type Description
assetClass bytes4 Asset class ID.
newVault address New vault address.

ClassConfig

struct ClassConfig {
  address vault;
  address controller;
}

registerAssetClass

function registerAssetClass(bytes4 assetClass, struct IAssetClassRegistry.ClassConfig config) external

Registers new asset class.

Name Type Description
assetClass bytes4 Asset class ID.
config struct IAssetClassRegistry.ClassConfig Asset class initial configuration.

setAssetClassVault

function setAssetClassVault(bytes4 assetClass, address vault) external

Sets asset class vault.

Name Type Description
assetClass bytes4 Asset class ID.
vault address Asset class vault address.

setAssetClassController

function setAssetClassController(bytes4 assetClass, address controller) external

Sets asset class controller.

Name Type Description
assetClass bytes4 Asset class ID.
controller address Asset class controller address.

assetClassConfig

function assetClassConfig(bytes4 assetClass) external view returns (struct IAssetClassRegistry.ClassConfig)

Returns asset class configuration.

Name Type Description
assetClass bytes4 Asset class ID.
Name Type Description
[0] struct IAssetClassRegistry.ClassConfig Asset class configuration.

isRegisteredAssetClass

function isRegisteredAssetClass(bytes4 assetClass) external view returns (bool)

Checks asset class registration.

Name Type Description
assetClass bytes4 Asset class ID.

checkRegisteredAssetClass

function checkRegisteredAssetClass(bytes4 assetClass) external view

Reverts if asset class is not registered.

Name Type Description
assetClass bytes4 Asset class ID.