Skip to content

IAssetController

IAssetController

AssetClassMismatch

error AssetClassMismatch(bytes4 provided, bytes4 required)

Thrown when the asset has invalid class for specific operation.

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

AssetCollectionMismatch

error AssetCollectionMismatch(address expected, address actual)

AssetOrderMismatch

error AssetOrderMismatch(address token, uint256 left, uint256 right)

AssetTransfer

event AssetTransfer(struct Assets.Asset asset, address from, address to, bytes data)

Emitted when asset is transferred.

Name Type Description
asset struct Assets.Asset Asset being transferred.
from address Asset sender.
to address Asset recipient.
data bytes Auxiliary data.

assetClass

function assetClass() external pure returns (bytes4)

Returns controller asset class.

Name Type Description
[0] bytes4 Asset class ID.

transfer

function transfer(struct Assets.Asset asset, address from, address to, bytes data) external

Transfers asset. Emits a {AssetTransfer} event.

Name Type Description
asset struct Assets.Asset Asset being transferred.
from address Asset sender.
to address Asset recipient.
data bytes Auxiliary data.

transferAssetToVault

function transferAssetToVault(struct Assets.Asset asset, address assetOwner, address vault) external

Transfers asset from owner to the vault contract.

Name Type Description
asset struct Assets.Asset Asset being transferred.
assetOwner address Original asset owner address.
vault address Asset vault contract address.

returnAssetFromVault

function returnAssetFromVault(struct Assets.Asset asset, address vault) external

Transfers asset from the vault contract to the original owner.

Name Type Description
asset struct Assets.Asset Asset being transferred.
vault address Asset vault contract address.

collectionId

function collectionId(struct Assets.AssetId assetId) external pure returns (bytes32)

Decodes asset ID structure and returns collection identifier. The collection ID is bytes32 value which is calculated based on the asset class. For example, ERC721 collection can be identified by address only, but for ERC1155 it should be calculated based on address and token ID.

Name Type Description
[0] bytes32 Collection ID.

ensureSorted

function ensureSorted(struct Assets.AssetId[] assets) external pure

Ensures asset array is sorted in incremental order. This is required for batched listings to guarantee stable hashing