Skip to content

ERC721AssetController

ERC721AssetController

InvalidERC721Value

error InvalidERC721Value(uint256 value)

Thrown when the asset value is invalid for ERC721 token standard.

assetClass

function assetClass() external pure returns (bytes4)

Returns controller asset class.

Name Type Description
[0] bytes4 Asset class ID.

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.

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.

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[] assetIds) external pure

Ensures asset array is sorted

_transferAsset

function _transferAsset(struct Assets.Asset asset, address from, address to, bytes data) internal

Executes asset transfer.

_validateAsset

function _validateAsset(struct Assets.Asset asset) internal pure

Reverts if the asset params are not valid.

Name Type Description
asset struct Assets.Asset Asset structure.