Skip to main content

LSP8CompatibleERC721Mintable

beware

This contract is being deprecated and will be deleted from @lukso/lsp-smart-contracts repository. However if you want to still use/maintain it, you will sill be able to find it in the version 0.14.0.

Standard Specifications
Solidity implementation

LSP8CompatibleERC721Mintable deployable preset contract with a public mint function callable only by the contract owner.

Public Methods

Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally.

constructor

References
constructor(
string name_,
string symbol_,
address newOwner_,
uint256 lsp4TokenType_,
uint256 lsp8TokenIdFormat_
);

Deploying a LSP8CompatibleERC721Mintable token contract with: token name = name_, token symbol = symbol_, and address newOwner_ as the token contract owner.

Parameters

NameTypeDescription
name_stringThe name of the token.
symbol_stringThe symbol of the token.
newOwner_addressThe owner of the token contract.
lsp4TokenType_uint256The type of token this digital asset contract represents (0 = Token, 1 = NFT, 2 = Collection).
lsp8TokenIdFormat_uint256The format of tokenIds (= NFTs) that this contract will create.

fallback

References
fallback() external payable;

receive

References
receive() external payable;

approve

References
function approve(address operator, uint256 tokenId) external nonpayable;

Calling approve function to approve operator at address operator to transfer tokenId tokenId on behalf of its owner.

Approval function compatible with ERC721 approve(address,uint256).

Parameters

NameTypeDescription
operatoraddressThe address to approve for tokenId.
tokenIduint256The tokenId to approve.

authorizeOperator

References
function authorizeOperator(
address operator,
bytes32 tokenId,
bytes operatorNotificationData
) external nonpayable;

Allow an operator address to transfer or burn a specific tokenId on behalf of its token owner. See isOperatorFor. Notify the operator based on the LSP1-UniversalReceiver standard

Emitted events:

Parameters

NameTypeDescription
operatoraddressThe address to authorize as an operator.
tokenIdbytes32The token ID operator has access to.
operatorNotificationDatabytesThe data to notify the operator about via LSP1.

balanceOf

References
function balanceOf(address tokenOwner) external view returns (uint256);

Get the number of token IDs owned by tokenOwner.

Parameters

NameTypeDescription
tokenOwneraddressThe address to query *

Returns

NameTypeDescription
0uint256The total number of token IDs that tokenOwner owns.

batchCalls

References
info

It's not possible to send value along the functions call due to the use of delegatecall.

function batchCalls(bytes[] data) external nonpayable returns (bytes[] results);

Executing the following batch of abi-encoded function calls on the contract: data.

Allows a caller to batch different function calls in one call. Perform a delegatecall on self, to call different functions with preserving the context.

Parameters

NameTypeDescription
databytes[]An array of ABI encoded function calls to be called on the contract.

Returns

NameTypeDescription
resultsbytes[]An array of abi-encoded data returned by the functions executed.

getApproved

References
function getApproved(uint256 tokenId) external view returns (address);

Retrieving the address other than the token owner that is approved to transfer tokenId tokenId on behalf of its owner.

Compatible with ERC721 getApproved.

Parameters

NameTypeDescription
tokenIduint256The tokenId to query.

Returns

NameTypeDescription
0addressThe address of the operator for tokenId.

getData

References
function getData(bytes32 dataKey) external view returns (bytes dataValue);

Reading the ERC725Y storage for data key dataKey returned the following value: dataValue.

Get in the ERC725Y storage the bytes data stored at a specific data key dataKey.

Parameters

NameTypeDescription
dataKeybytes32The data key for which to retrieve the value.

Returns

NameTypeDescription
dataValuebytesThe bytes value stored under the specified data key.

getDataBatch

References
function getDataBatch(
bytes32[] dataKeys
) external view returns (bytes[] dataValues);

Reading the ERC725Y storage for data keys dataKeys returned the following values: dataValues.

Get in the ERC725Y storage the bytes data stored at multiple data keys dataKeys.

Parameters

NameTypeDescription
dataKeysbytes32[]The array of keys which values to retrieve

Returns

NameTypeDescription
dataValuesbytes[]The array of data stored at multiple keys

getDataBatchForTokenIds

References
function getDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys
) external view returns (bytes[] dataValues);

Retrieves data in batch for multiple tokenId and dataKey pairs.

Parameters

NameTypeDescription
tokenIdsbytes32[]An array of token IDs.
dataKeysbytes32[]An array of data keys corresponding to the token IDs.

Returns

NameTypeDescription
dataValuesbytes[]An array of data values for each pair of tokenId and dataKey.

getDataForTokenId

References
function getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) external view returns (bytes dataValue);

Retrieves data for a specific tokenId and dataKey.

Parameters

NameTypeDescription
tokenIdbytes32The unique identifier for a token.
dataKeybytes32The key for the data to retrieve.

Returns

NameTypeDescription
dataValuebytesThe data value associated with the given tokenId and dataKey.

getOperatorsOf

References
function getOperatorsOf(bytes32 tokenId) external view returns (address[]);

Returns all operator addresses that are allowed to transfer or burn a specific tokenId on behalf of its owner.

Parameters

NameTypeDescription
tokenIdbytes32The token ID to get the operators for.

Returns

NameTypeDescription
0address[]An array of operators allowed to transfer or burn a specific tokenId. Requirements - tokenId must exist.

isApprovedForAll

References
function isApprovedForAll(
address tokenOwner,
address operator
) external view returns (bool);

Checking if address operator is approved to transfer any tokenId owned by address owner.

Compatible with ERC721 isApprovedForAll.

Parameters

NameTypeDescription
tokenOwneraddressThe tokenOwner address to query.
operatoraddressThe operator address to query.

Returns

NameTypeDescription
0boolReturns if the operator is allowed to manage all of the assets of owner

isOperatorFor

References
function isOperatorFor(
address operator,
bytes32 tokenId
) external view returns (bool);

Returns whether operator address is an operator for a given tokenId.

Parameters

NameTypeDescription
operatoraddressThe address to query operator status for.
tokenIdbytes32The token ID to check if operator is allowed to operate on.

Returns

NameTypeDescription
0booltrue if operator is an operator for tokenId, false otherwise.

mint

References
function mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) external nonpayable;

Minting tokenId tokenId for address to with the additional data data (Note: allow non-LSP1 recipient is set to force).

Public _mint function only callable by the owner.

Parameters

NameTypeDescription
toaddressThe address that will receive the minted tokenId.
tokenIdbytes32The tokenId to mint.
forceboolSet to false to ensure that you are minting for a recipient that implements LSP1, false otherwise for forcing the minting.
databytesAny addition data to be sent alongside the minting.

name

References
function name() external view returns (string);

Returns the name of the token. For compatibility with clients & tools that expect ERC721.

Returns

NameTypeDescription
0stringThe name of the token

owner

References
function owner() external view returns (address);

Returns the address of the current owner.

Returns

NameTypeDescription
0address-

ownerOf

References
function ownerOf(uint256 tokenId) external view returns (address);

Retrieving the address that own tokenId tokenId.

Compatible with ERC721 ownerOf.

Parameters

NameTypeDescription
tokenIduint256The tokenId to query.

Returns

NameTypeDescription
0addressThe owner of the tokenId.

renounceOwnership

References
function renounceOwnership() external nonpayable;

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.


revokeOperator

References
function revokeOperator(
address operator,
bytes32 tokenId,
bool notify,
bytes operatorNotificationData
) external nonpayable;

Remove access of operator for a given tokenId, disallowing it to transfer tokenId on behalf of its owner. See also isOperatorFor.

Parameters

NameTypeDescription
operatoraddressThe address to revoke as an operator.
tokenIdbytes32The tokenId operator is revoked from operating on.
notifyboolBoolean indicating whether to notify the operator or not
operatorNotificationDatabytesThe data to notify the operator about via LSP1.

safeTransferFrom

References
info

This function sets the force parameter to true so that EOAs and any contract can receive the tokenId.

function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external nonpayable;

Calling safeTransferFrom function to transfer tokenId tokenId from address from to address to.

Safe Transfer function without optional data from the ERC721 standard interface.

Parameters

NameTypeDescription
fromaddressThe sending address.
toaddressThe receiving address.
tokenIduint256The tokenId to transfer.

safeTransferFrom

References
info

This function sets the force parameter to true so that EOAs and any contract can receive the tokenId.

function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes data
) external nonpayable;

Calling safeTransferFrom function to transfer tokenId tokenId from address from to address to.

Safe Transfer function with optional data from the ERC721 standard interface.

Parameters

NameTypeDescription
fromaddressThe sending address.
toaddressThe receiving address.
tokenIduint256The tokenId to transfer.
databytesThe data to be sent with the transfer.

setApprovalForAll

References
function setApprovalForAll(address operator, bool approved) external nonpayable;

Setting the "approval for all" status of operator _operator to _approved to allow it to transfer any tokenIds on behalf of msg.sender.

Enable or disable approval for a third party ("operator") to manage all of msg.sender's assets. The contract MUST allow multiple operators per owner. See _setApprovalForAll

Emitted events:

Parameters

NameTypeDescription
operatoraddressAddress to add to the set of authorized operators.
approvedboolTrue if the operator is approved, false to revoke approval.

setData

References
Warning

Note for developers: despite the fact that this function is set as payable, if the function is not intended to receive value (= native tokens), an additional check should be implemented to ensure that msg.value sent was equal to 0.

function setData(bytes32 dataKey, bytes dataValue) external payable;

Setting the following data key value pair in the ERC725Y storage. Data key: dataKey, data value: dataValue.

Sets a single bytes value dataValue in the ERC725Y storage for a specific data key dataKey. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data.

Requirements:

  • SHOULD only be callable by the owner.

Emitted events:

Parameters

NameTypeDescription
dataKeybytes32The data key for which to set a new value.
dataValuebytesThe new bytes value to set.

setDataBatch

References
Warning

Note for developers: despite the fact that this function is set as payable, if the function is not intended to receive value (= native tokens), an additional check should be implemented to ensure that msg.value sent was equal to 0.

function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable;

Setting the following data key value pairs in the ERC725Y storage. Data keys: dataKeys, data values: dataValues.

Batch data setting function that behaves the same as setData but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.

Requirements:

  • SHOULD only be callable by the owner of the contract.

Emitted events:

Parameters

NameTypeDescription
dataKeysbytes32[]An array of data keys to set bytes values for.
dataValuesbytes[]An array of bytes values to set for each dataKeys.

setDataBatchForTokenIds

References
function setDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys,
bytes[] dataValues
) external nonpayable;

Sets data in batch for multiple tokenId and dataKey pairs.

Parameters

NameTypeDescription
tokenIdsbytes32[]An array of token IDs.
dataKeysbytes32[]An array of data keys corresponding to the token IDs.
dataValuesbytes[]An array of values to set for the given data keys.

setDataForTokenId

References
function setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) external nonpayable;

Sets data for a specific tokenId and dataKey.

Parameters

NameTypeDescription
tokenIdbytes32The unique identifier for a token.
dataKeybytes32The key for the data to set.
dataValuebytesThe value to set for the given data key.

supportsInterface

References
function supportsInterface(bytes4 interfaceId) external view returns (bool);

Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

Parameters

NameTypeDescription
interfaceIdbytes4-

Returns

NameTypeDescription
0bool-

symbol

References
function symbol() external view returns (string);

Returns the symbol of the token, usually a shorter version of the name. For compatibility with clients & tools that expect ERC721.

Returns

NameTypeDescription
0stringThe symbol of the token

tokenIdsOf

References
function tokenIdsOf(address tokenOwner) external view returns (bytes32[]);

Returns the list of token IDs that the tokenOwner address owns.

Parameters

NameTypeDescription
tokenOwneraddressThe address that we want to get the list of token IDs for.

Returns

NameTypeDescription
0bytes32[]An array of bytes32[] tokenIds owned by tokenOwner.

tokenOwnerOf

References
function tokenOwnerOf(bytes32 tokenId) external view returns (address);

Returns the list of tokenIds for the tokenOwner address.

Parameters

NameTypeDescription
tokenIdbytes32tokenOwner The address to query owned tokens

Returns

NameTypeDescription
0addressThe owner address of the given tokenId.

tokenURI

References
function tokenURI(uint256) external view returns (string);

Retrieving the token URI of tokenId tokenId.

Compatible with ERC721Metadata tokenURI. Retrieve the tokenURI for a specific tokenId.

Parameters

NameTypeDescription
_0uint256-

Returns

NameTypeDescription
0stringThe token URI.

totalSupply

References
function totalSupply() external view returns (uint256);

Returns the number of existing tokens that have been minted in this contract.

Returns

NameTypeDescription
0uint256The number of existing tokens.

transfer

References
function transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) external nonpayable;

Transfer a given tokenId token from the from address to the to address. If operators are set for a specific tokenId, all the operators are revoked after the tokenId have been transferred. The force parameter MUST be set to true when transferring tokens to Externally Owned Accounts (EOAs) or contracts that do not implement the LSP1 standard.

Parameters

NameTypeDescription
fromaddressThe address that owns the given tokenId.
toaddressThe address that will receive the tokenId.
tokenIdbytes32The token ID to transfer.
forceboolWhen set to true, the to address CAN be any addres. When set to false, the to address MUST be a contract that supports the LSP1 UniversalReceiver standard.
databytesAny additional data the caller wants included in the emitted event, and sent in the hooks of the from and to addresses.

transferBatch

References
function transferBatch(
address[] from,
address[] to,
bytes32[] tokenId,
bool[] force,
bytes[] data
) external nonpayable;

Transfers multiple tokens at once based on the arrays of from, to and tokenId. If any transfer fails, the whole call will revert.

Parameters

NameTypeDescription
fromaddress[]An array of sending addresses.
toaddress[]An array of recipient addresses.
tokenIdbytes32[]An array of token IDs to transfer.
forcebool[]When set to true, to may be any address. When set to false, to must be a contract that supports the LSP1 standard and not revert.
databytes[]Any additional data the caller wants included in the emitted event, and sent in the hooks to the from and to addresses.

transferFrom

References
info

This function sets the force parameter to true so that EOAs and any contract can receive the tokenId.

function transferFrom(
address from,
address to,
uint256 tokenId
) external nonpayable;

Calling transferFrom function to transfer tokenId tokenId from address from to address to.

Transfer functions from the ERC721 standard interface.

Parameters

NameTypeDescription
fromaddressThe sending address.
toaddressThe receiving address.
tokenIduint256The tokenId to transfer.

transferOwnership

References
function transferOwnership(address newOwner) external nonpayable;

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddress-

Internal Methods

Any method labeled as internal serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs.

Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities.

_checkOwner

function _checkOwner() internal view;

Throws if the sender is not the owner.


_setOwner

function _setOwner(address newOwner) internal nonpayable;

Changes the owner if newOwner and oldOwner are different This pattern is useful in inheritance.


_getData

function _getData(bytes32 dataKey) internal view returns (bytes dataValue);

Read the value stored under a specific dataKey inside the underlying ERC725Y storage, represented as a mapping of bytes32 data keys mapped to their bytes data values.

mapping(bytes32 => bytes) _store

Parameters

NameTypeDescription
dataKeybytes32A bytes32 data key to read the associated bytes value from the store.

Returns

NameTypeDescription
dataValuebytesThe bytes value associated with the given dataKey in the ERC725Y storage.

_setData

function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;

The ERC725Y data key _LSP8_TOKENID_FORMAT_KEY cannot be changed once the identifiable digital asset contract has been deployed.


_isOperatorOrOwner

function _isOperatorOrOwner(
address caller,
bytes32 tokenId
) internal view returns (bool);

verifies if the caller is operator or owner for the tokenId

Returns

NameTypeDescription
0booltrue if caller is either operator or owner

_revokeOperator

function _revokeOperator(
address operator,
address tokenOwner,
bytes32 tokenId,
bool notified,
bytes operatorNotificationData
) internal nonpayable;

removes operator from the list of operators for the tokenId


_clearOperators

function _clearOperators(
address tokenOwner,
bytes32 tokenId
) internal nonpayable;

revoke all the current operators for a specific tokenId token which belongs to tokenOwner.

Parameters

NameTypeDescription
tokenOwneraddressThe address that is the owner of the tokenId.
tokenIdbytes32The token to remove the associated operators for.

_exists

function _exists(bytes32 tokenId) internal view returns (bool);

Returns whether tokenId exists. Tokens start existing when they are minted (_mint), and stop existing when they are burned (_burn).


_existsOrError

function _existsOrError(bytes32 tokenId) internal view;

When tokenId does not exist then revert with an error.


_mint

function _mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;

_burn

function _burn(bytes32 tokenId, bytes data) internal nonpayable;

_transfer

function _transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;

_setDataForTokenId

function _setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) internal nonpayable;

Sets data for a specific tokenId and dataKey in the ERC725Y storage The ERC725Y data key is the hash of the tokenId and dataKey concatenated

Emitted events:

Parameters

NameTypeDescription
tokenIdbytes32The unique identifier for a token.
dataKeybytes32The key for the data to set.
dataValuebytesThe value to set for the given data key.

_getDataForTokenId

function _getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) internal view returns (bytes dataValues);

Retrieves data for a specific tokenId and dataKey from the ERC725Y storage The ERC725Y data key is the hash of the tokenId and dataKey concatenated

Parameters

NameTypeDescription
tokenIdbytes32The unique identifier for a token.
dataKeybytes32The key for the data to retrieve.

Returns

NameTypeDescription
dataValuesbytesThe data value associated with the given tokenId and dataKey.

_beforeTokenTransfer

function _beforeTokenTransfer(
address from,
address to,
bytes32 tokenId,
bytes data
) internal nonpayable;

Hook that is called before any token transfer, including minting and burning. Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function.

Parameters

NameTypeDescription
fromaddressThe sender address
toaddress@param tokenId The tokenId to transfer
tokenIdbytes32The tokenId to transfer
databytesThe data sent alongside the transfer

_afterTokenTransfer

function _afterTokenTransfer(
address from,
address to,
bytes32 tokenId,
bytes data
) internal nonpayable;

Hook that is called after any token transfer, including minting and burning. Allows to run custom logic after updating balances, but before notifiying sender/recipient via LSP1 by overriding this function.

Parameters

NameTypeDescription
fromaddressThe sender address
toaddress@param tokenId The tokenId to transfer
tokenIdbytes32The tokenId to transfer
databytesThe data sent alongside the transfer

_notifyTokenOperator

function _notifyTokenOperator(
address operator,
bytes lsp1Data
) internal nonpayable;

Attempt to notify the operator operator about the tokenId being authorized. This is done by calling its universalReceiver function with the _TYPEID_LSP8_TOKENOPERATOR as typeId, if operator is a contract that supports the LSP1 interface. If operator is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent.

Parameters

NameTypeDescription
operatoraddressThe address to call the universalReceiver function on.
lsp1Databytesthe data to be sent to the operator address in the universalReceiver call.

_notifyTokenSender

function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable;

Attempt to notify the token sender from about the tokenId being transferred. This is done by calling its universalReceiver function with the _TYPEID_LSP8_TOKENSSENDER as typeId, if from is a contract that supports the LSP1 interface. If from is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent.

Parameters

NameTypeDescription
fromaddressThe address to call the universalReceiver function on.
lsp1Databytesthe data to be sent to the from address in the universalReceiver call.

_notifyTokenReceiver

function _notifyTokenReceiver(
address to,
bool force,
bytes lsp1Data
) internal nonpayable;

Attempt to notify the token receiver to about the tokenId being received. This is done by calling its universalReceiver function with the _TYPEID_LSP8_TOKENSRECIPIENT as typeId, if to is a contract that supports the LSP1 interface. If to is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the force boolean flag.

  • if force is set to true, nothing will happen and no notification will be sent.

  • if force is set to `false, the transaction will revert.

Parameters

NameTypeDescription
toaddressThe address to call the universalReceiver function on.
forceboolA boolean that describe if transfer to a to address that does not support LSP1 is allowed or not.
lsp1DatabytesThe data to be sent to the to address in the universalReceiver(...) call.

_supportsInterfaceInERC165Extension

function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);

Returns whether the interfaceId being checked is supported in the extension of the supportsInterface selector. To be used by extendable contracts wishing to extend the ERC165 interfaceIds originally supported by reading whether the interfaceId queried is supported in the supportsInterface extension if the extension is set, if not it returns false.


_getExtensionAndForwardValue

function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);

Returns the extension address stored under the following data key:

  • _LSP17_EXTENSION_PREFIX + <bytes4> (Check [LSP2-ERC725YJSONSchema] for encoding the data key).

  • If no extension is stored, returns the address(0).


_fallbackLSP17Extendable

info

The LSP8 Token contract should not hold any native tokens. Any native tokens received by the contract will be forwarded to the extension address mapped to the selector from msg.sig.

function _fallbackLSP17Extendable(
bytes callData
) internal nonpayable returns (bytes);

Forwards the call with the received value to an extension mapped to a function selector. Calls _getExtensionAndForwardValue to get the address of the extension mapped to the function selector being called on the account. If there is no extension, the address(0) will be returned. We will always forward the value to the extension, as the LSP8 contract is not supposed to hold any native tokens. Reverts if there is no extension for the function being called. If there is an extension for the function selector being called, it calls the extension with the CALL opcode, passing the msg.data appended with the 20 bytes of the msg.sender and 32 bytes of the msg.value


_safeTransfer

function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes data
) internal nonpayable;

Transfer the tokenId from from to to and check if the to recipient address is a contract that implements the IERC721Received interface and return the right magic value. See _checkOnERC721Received for more infos.


_setApprovalForAll

function _setApprovalForAll(
address tokensOwner,
address operator,
bool approved
) internal nonpayable;

Approve operator to operate on all tokens of tokensOwner.

Emitted events:


Events

Approval

References
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

Emitted when the allowance of a spender for an owner is set by a call to approve. value is the new allowance.

Parameters

NameTypeDescription
owner indexedaddress-
approved indexedaddress-
tokenId indexeduint256-

ApprovalForAll

References
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

Emitted when account grants or revokes permission to operator to transfer their tokens, according to approved.

Parameters

NameTypeDescription
owner indexedaddress-
operator indexedaddress-
approvedbool-

DataChanged

References
event DataChanged(bytes32 indexed dataKey, bytes dataValue);

The following data key/value pair has been changed in the ERC725Y storage: Data key: dataKey, data value: dataValue.

Emitted when data at a specific dataKey was changed to a new value dataValue.

Parameters

NameTypeDescription
dataKey indexedbytes32The data key for which a bytes value is set.
dataValuebytesThe value to set for the given data key.

OperatorAuthorizationChanged

References
event OperatorAuthorizationChanged(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId, bytes operatorNotificationData);

Emitted when tokenOwner enables operator to transfer or burn the tokenId.

Parameters

NameTypeDescription
operator indexedaddressThe address authorized as an operator.
tokenOwner indexedaddressThe owner of the tokenId.
tokenId indexedbytes32The tokenId operator address has access on behalf of tokenOwner.
operatorNotificationDatabytesThe data to notify the operator about via LSP1.

OperatorRevoked

References
event OperatorRevoked(address indexed operator, address indexed tokenOwner, bytes32 indexed tokenId, bool notified, bytes operatorNotificationData);

Emitted when tokenOwner disables operator to transfer or burn tokenId on its behalf.

Parameters

NameTypeDescription
operator indexedaddressThe address revoked from the operator array (getOperatorsOf).
tokenOwner indexedaddressThe owner of the tokenId.
tokenId indexedbytes32The tokenId operator is revoked from operating on.
notifiedboolBool indicating whether the operator has been notified or not
operatorNotificationDatabytesThe data to notify the operator about via LSP1.

OwnershipTransferred

References
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

Parameters

NameTypeDescription
previousOwner indexedaddress-
newOwner indexedaddress-

TokenIdDataChanged

References
event TokenIdDataChanged(bytes32 indexed tokenId, bytes32 indexed dataKey, bytes dataValue);

Emitted when setting data for tokenId.

Parameters

NameTypeDescription
tokenId indexedbytes32The tokenId which data is set for.
dataKey indexedbytes32The data key for which a bytes value is set.
dataValuebytesThe value to set for the given data key.

Transfer

References
event Transfer(address operator, address indexed from, address indexed to, bytes32 indexed tokenId, bool force, bytes data);

Emitted when tokenId token is transferred from the from to the to address.

Parameters

NameTypeDescription
operatoraddressThe address of operator that sent the tokenId
from indexedaddressThe previous owner of the tokenId
to indexedaddressThe new owner of tokenId
tokenId indexedbytes32The tokenId that was transferred
forceboolIf the token transfer enforces the to recipient address to be a contract that implements the LSP1 standard or not.
databytesAny additional data the caller included by the caller during the transfer, and sent in the hooks to the from and to addresses.

Transfer

References
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

Emitted when value tokens are moved from one account (from) to another (to). Note that value may be zero.

Parameters

NameTypeDescription
from indexedaddress-
to indexedaddress-
tokenId indexeduint256-

Errors

ERC725Y_DataKeysValuesEmptyArray

References
error ERC725Y_DataKeysValuesEmptyArray();

Reverts when one of the array parameter provided to setDataBatch function is an empty array.


ERC725Y_DataKeysValuesLengthMismatch

References
error ERC725Y_DataKeysValuesLengthMismatch();

Reverts when there is not the same number of elements in the datakeys and dataValues array parameters provided when calling the setDataBatch function.


ERC725Y_MsgValueDisallowed

References
error ERC725Y_MsgValueDisallowed();

Reverts when sending value to the setData or setDataBatch function.


InvalidExtensionAddress

References
error InvalidExtensionAddress(bytes storedData);

reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)

Parameters

NameTypeDescription
storedDatabytes-

InvalidFunctionSelector

References
error InvalidFunctionSelector(bytes data);

reverts when the contract is called with a function selector not valid (less than 4 bytes of data)

Parameters

NameTypeDescription
databytes-

LSP4TokenNameNotEditable

References
error LSP4TokenNameNotEditable();

Reverts when trying to edit the data key LSP4TokenName after the digital asset contract has been deployed / initialized. The LSP4TokenName data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.


LSP4TokenSymbolNotEditable

References
error LSP4TokenSymbolNotEditable();

Reverts when trying to edit the data key LSP4TokenSymbol after the digital asset contract has been deployed / initialized. The LSP4TokenSymbol data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.


LSP4TokenTypeNotEditable

References
error LSP4TokenTypeNotEditable();

Reverts when trying to edit the data key LSP4TokenType after the digital asset contract has been deployed / initialized. The LSP4TokenType data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.


LSP8BatchCallFailed

References
error LSP8BatchCallFailed(uint256 callIndex);

Batch call failed.

Reverts when a batch call failed.

Parameters

NameTypeDescription
callIndexuint256-

LSP8CannotSendToAddressZero

References
error LSP8CannotSendToAddressZero();

Reverts when trying to send token to the zero address.


LSP8CannotSendToSelf

References
error LSP8CannotSendToSelf();

Reverts when specifying the same address for from and to in a token transfer.


LSP8CannotUseAddressZeroAsOperator

References
error LSP8CannotUseAddressZeroAsOperator();

Reverts when trying to set the zero address as an operator.


LSP8InvalidTransferBatch

References
error LSP8InvalidTransferBatch();

Reverts when the parameters used for transferBatch have different lengths.


LSP8NonExistentTokenId

References
error LSP8NonExistentTokenId(bytes32 tokenId);

Reverts when tokenId has not been minted.

Parameters

NameTypeDescription
tokenIdbytes32-

LSP8NonExistingOperator

References
error LSP8NonExistingOperator(address operator, bytes32 tokenId);

Reverts when operator is not an operator for the tokenId.

Parameters

NameTypeDescription
operatoraddress-
tokenIdbytes32-

LSP8NotTokenOperator

References
error LSP8NotTokenOperator(bytes32 tokenId, address caller);

Reverts when caller is not an allowed operator for tokenId.

Parameters

NameTypeDescription
tokenIdbytes32-
calleraddress-

LSP8NotTokenOwner

References
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);

Reverts when caller is not the tokenOwner of the tokenId.

Parameters

NameTypeDescription
tokenOwneraddress-
tokenIdbytes32-
calleraddress-

LSP8NotifyTokenReceiverContractMissingLSP1Interface

References
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);

Reverts if the tokenReceiver does not implement LSP1 when minting or transferring tokens with bool force set as false.

Parameters

NameTypeDescription
tokenReceiveraddress-

LSP8NotifyTokenReceiverIsEOA

References
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);

Reverts if the tokenReceiver is an EOA when minting or transferring tokens with bool force set as false.

Parameters

NameTypeDescription
tokenReceiveraddress-

LSP8OperatorAlreadyAuthorized

References
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);

Reverts when operator is already authorized for the tokenId.

Parameters

NameTypeDescription
operatoraddress-
tokenIdbytes32-

LSP8TokenContractCannotHoldValue

References
error LSP8TokenContractCannotHoldValue();

LSP8 contract cannot receive native tokens.

Error occurs when sending native tokens to the LSP8 contract without sending any data. E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension.


LSP8TokenIdAlreadyMinted

References
error LSP8TokenIdAlreadyMinted(bytes32 tokenId);

Reverts when tokenId has already been minted.

Parameters

NameTypeDescription
tokenIdbytes32-

LSP8TokenIdFormatNotEditable

References
error LSP8TokenIdFormatNotEditable();

Reverts when trying to edit the data key LSP8TokenIdFormat after the identifiable digital asset contract has been deployed. The LSP8TokenIdFormat data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.


LSP8TokenIdsDataEmptyArray

References
error LSP8TokenIdsDataEmptyArray();

Reverts when empty arrays is passed to the function


LSP8TokenIdsDataLengthMismatch

References
error LSP8TokenIdsDataLengthMismatch();

Reverts when the length of the token IDs data arrays is not equal


LSP8TokenOwnerCannotBeOperator

References
error LSP8TokenOwnerCannotBeOperator();

Reverts when trying to authorize or revoke the token's owner as an operator.


NoExtensionFoundForFunctionSelector

References
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);

reverts when there is no extension for the function selector being called with

Parameters

NameTypeDescription
functionSelectorbytes4-

OwnableCallerNotTheOwner

References
error OwnableCallerNotTheOwner(address callerAddress);

Reverts when only the owner is allowed to call the function.

Parameters

NameTypeDescription
callerAddressaddressThe address that tried to make the call.

OwnableCannotSetZeroAddressAsOwner

References
error OwnableCannotSetZeroAddressAsOwner();

Reverts when trying to set address(0) as the contract owner when deploying the contract, initializing it or transferring ownership of the contract.