Skip to content

ERC721AssetUtils

ERC721AssetUtils

_assetClass

function _assetClass() internal pure returns (bytes4)

_tokenWithId

function _tokenWithId(struct Assets.Asset self) internal pure returns (address, uint256)

Extract token address + tokenId for ERC721 (works for ERC1155 tokens as well)

_tokenWithId

function _tokenWithId(struct Assets.AssetId self) internal pure returns (address, uint256)

Extract token address + tokenId for ERC721 (works for ERC1155 tokens as well)

_collectionId

function _collectionId(address token) internal pure returns (bytes32)

Calculates collection ID. Foe ERC721 tokens, the collection ID is calculated by hashing the contract address itself.

_decodeAssetId

function _decodeAssetId(struct Assets.AssetId id) internal pure returns (address token, uint256 tokenId)

Decodes asset ID and extracts identification data.

Name Type Description
id struct Assets.AssetId Asset ID structure.
Name Type Description
token address Token contract address.
tokenId uint256 Token ID.

_encodeAssetId

function _encodeAssetId(address token, uint256 tokenId) internal pure returns (struct Assets.AssetId)

Encodes asset ID.

Name Type Description
token address Token contract address.
tokenId uint256 Token ID.
Name Type Description
[0] struct Assets.AssetId Asset ID structure.