| Contract | Interface ID | Description |
| :-------------------------------- | :----------: | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ERC165** | `0x01ffc9a7` | Standard Interface Detection. |
| **ERC1271** | `0x1626ba7e` | Standard Signature Validation Method for Contracts. |
| **ERC725X** | `0x7545acac` | General executor. |
| **ERC725Y** | `0x629aa694` | General Data key-value store. |
| **LSP0ERC725Account** | `0x24871b3d` | Interface of the [LSP-0-ERC725Account] standard, an account based smart contract that represents an identity on-chain. |
| **LSP1UniversalReceiver** | `0x6bb56a14` | Interface of the LSP1 - Universal Receiver standard, an entry function for a contract to receive arbitrary information. |
| **LSP1UniversalReceiverDelegate** | `0xa245bbda` | Interface of the LSP1 - Universal Receiver Delegate standard. |
| **LSP6KeyManager** | `0x23f34c62` | Interface of the LSP6 - Key Manager standard, a contract acting as a controller of an ERC725 Account using predefined permissions. |
| **LSP7DigitalAsset** | `0xb3c4928f` | Interface of the LSP7 - Digital Asset standard, a fungible digital asset. |
| **LSP8IdentifiableDigitalAsset** | `0x3a271706` | Interface of the LSP8 - Identifiable Digital Asset standard, a non-fungible digital asset. |
| **LSP9Vault** | `0x28af17e6` | Interface of LSP9 - Vault standard, a blockchain vault that can hold assets and interact with other smart contracts. |
| **LSP11BasicSocialRecovery** | `0x049a28f1` | Interface of the LSP11 - Basic Social Recovery standard, a contract to recover access control into an account. |
| **LSP14Ownable2Step** | `0x94be5999` | Interface of the LSP14 - Ownable 2-step standard, an extension of the [EIP173] (Ownable) standard with 2-step process to transfer or renounce ownership. |
| **LSP17Extendable** | `0xa918fa6b` | Module to add more functionalities to a contract using extensions. |
| **LSP17Extension** | `0xcee78b40` | Module to create a contract that can act as an extension. |
| **LSP20CallVerification** | `0x1a0eb6a5` | Implementation of a contract calling the verification functions according to LSP20 - Call Verification standard. |
| **LSP20CallVerifier** | `0x0d6ecac7` | Interface for the LSP20 Call Verification standard, a set of functions intended to perform verifications on behalf of another contract. |
| **LSP25ExecuteRelayCall** | `0x5ac79908` | |
| **LSP26FollowerSystem** | `0x2b299cea` | LSP26 Follower System provides a robust foundation for building social features into blockchain applications. |
---
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# ERC725
:::info Standard Specifications
[`ERC-725`](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md)
:::
:::info Solidity implementation
[`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
:::
> ERC725 bundle.
Bundle ERC725X and ERC725Y together into one smart contract.
## 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
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#constructor)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
:::
```solidity
constructor(address initialOwner);
```
_Deploying an ERC725 smart contract and setting address `initialOwner` as the contract owner._
Deploy a new ERC725 contract with the provided `initialOwner` as the contract [`owner`](#owner).
**Requirements:**
- `initialOwner` CANNOT be the zero address.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------- |
| `initialOwner` | `address` | the owner of the contract. |
### execute
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#execute)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `execute(uint256,address,uint256,bytes)`
- Function selector: `0x44c028fe`
:::
```solidity
function execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) external payable returns (bytes);
```
_Calling address `target` using `operationType`, transferring `value` wei and data: `data`._
Generic executor function to:
- send native tokens to any address.
- interact with any contract by passing an abi-encoded function call in the `data` parameter.
- deploy a contract by providing its creation bytecode in the `data` parameter.
**Requirements:**
- SHOULD only be callable by the [`owner`](#owner) of the contract.
- if a `value` is provided, the contract MUST have at least this amount to transfer to `target` from its balance and execute successfully.
- if the operation type is `STATICCALL` (`3`) or `DELEGATECALL` (`4`), `value` transfer is disallowed and SHOULD be 0.
- `target` SHOULD be `address(0)` when deploying a new contract via `operationType` `CREATE` (`1`), or `CREATE2` (`2`).
**Emitted events:**
- [`Executed`](#executed) event when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL).
- [`ContractCreated`](#contractcreated) event when deploying a new contract with `operationType` 1 (CREATE) or 2 (CREATE2).
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 |
| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) |
| `value` | `uint256` | The amount of native tokens to transfer (in Wei) |
| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------- |
| `0` | `bytes` | - |
### executeBatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#executebatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])`
- Function selector: `0x31858452`
:::
:::caution Warning
- The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) external payable returns (bytes[]);
```
_Calling multiple addresses `targets` using `operationsType`, transferring `values` wei and data: `datas`._
Batch executor function that behaves the same as [`execute`](#execute) but allowing multiple operations in the same transaction.
**Requirements:**
- All the array parameters provided MUST be equal and have the same length.
- SHOULD only be callable by the [`owner`](#owner) of the contract.
- The contract MUST have in its balance **at least the sum of all the `values`** to transfer and execute successfully each calldata payloads.
**Emitted events:**
- [`Executed`](#executed) event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL)
- [`ContractCreated`](#contractcreated) event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2)
#### Parameters
| Name | Type | Description |
| ---------------- | :---------: | --------------------------------------------------------------------------------------------------------------- |
| `operationsType` | `uint256[]` | The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4` |
| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). |
| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei). |
| `datas` | `bytes[]` | The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `bytes[]` | - |
### getData
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#getdata)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#getdatabatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### owner
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#owner)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#renounceownership)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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.
### setData
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#setdata)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#setdatabatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#supportsinterface)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### transferOwnership
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#transferownership)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_execute
```solidity
function _execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes);
```
check the `operationType` provided and perform the associated low-level opcode after checking for requirements (see [`execute`](#execute)).
### \_executeBatch
```solidity
function _executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) internal nonpayable returns (bytes[]);
```
check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)).
### \_executeCall
```solidity
function _executeCall(
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level call (operation type = 0)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------- |
| `target` | `address` | The address on which call is executed |
| `value` | `uint256` | The value to be sent with the call |
| `data` | `bytes` | The data to be sent with the call |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ---------------------- |
| `result` | `bytes` | The data from the call |
### \_executeStaticCall
```solidity
function _executeStaticCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level staticcall (operation type = 3)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `target` | `address` | The address on which staticcall is executed |
| `data` | `bytes` | The data to be sent with the staticcall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ------------------------------------- |
| `result` | `bytes` | The data returned from the staticcall |
### \_executeDelegateCall
:::caution Warning
The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function _executeDelegateCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level delegatecall (operation type = 4)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | --------------------------------------------- |
| `target` | `address` | The address on which delegatecall is executed |
| `data` | `bytes` | The data to be sent with the delegatecall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | --------------------------------------- |
| `result` | `bytes` | The data returned from the delegatecall |
### \_deployCreate
```solidity
function _deployCreate(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE` opcode (operation type = 1)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_deployCreate2
```solidity
function _deployCreate2(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE2` opcode (operation type = 2)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
Write a `dataValue` to the underlying ERC725Y storage, represented as a mapping of
`bytes32` data keys mapped to their `bytes` data values.
```solidity
mapping(bytes32 => bytes) _store
```
**Emitted events:**
- [`DataChanged`](#datachanged) event emitted after a successful `setData` call.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to write the associated `bytes` value to the store. |
| `dataValue` | `bytes` | The `bytes` value to associate with the given `dataKey` in the ERC725Y storage. |
## Events
### ContractCreated
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#contractcreated)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `ContractCreated(uint256,address,uint256,bytes32)`
- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3`
:::
```solidity
event ContractCreated(
uint256 indexed operationType,
address indexed contractAddress,
uint256 value,
bytes32 indexed salt
);
```
_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._
Emitted when a new contract was created and deployed.
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (`CREATE` or `CREATE2`). |
| `contractAddress` **`indexed`** | `address` | The created contract address. |
| `value` | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. |
| `salt` **`indexed`** | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. |
### DataChanged
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#datachanged)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Executed
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#executed)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `Executed(uint256,address,uint256,bytes4)`
- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e`
:::
```solidity
event Executed(
uint256 indexed operationType,
address indexed target,
uint256 value,
bytes4 indexed selector
);
```
_Called address `target` using `operationType` with `value` wei and `data`._
Emitted when calling an address `target` (EOA or contract) with `value`.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `target` address (`CALL`, `STATICALL` or `DELEGATECALL`). |
| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). |
| `value` | `uint256` | The amount of native tokens transferred along the call (in Wei). |
| `selector` **`indexed`** | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. |
### OwnershipTransferred
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownershiptransferred)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
## Errors
### ERC725X_ContractDeploymentFailed
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_contractdeploymentfailed)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_ContractDeploymentFailed()`
- Error hash: `0x0b07489b`
:::
```solidity
error ERC725X_ContractDeploymentFailed();
```
Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_CreateOperationsRequireEmptyRecipientAddress
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_createoperationsrequireemptyrecipientaddress)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()`
- Error hash: `0x3041824a`
:::
```solidity
error ERC725X_CreateOperationsRequireEmptyRecipientAddress();
```
Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_ExecuteParametersEmptyArray
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_executeparametersemptyarray)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_ExecuteParametersEmptyArray()`
- Error hash: `0xe9ad2b5f`
:::
```solidity
error ERC725X_ExecuteParametersEmptyArray();
```
Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array.
### ERC725X_ExecuteParametersLengthMismatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_executeparameterslengthmismatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_ExecuteParametersLengthMismatch()`
- Error hash: `0x3ff55f4d`
:::
```solidity
error ERC725X_ExecuteParametersLengthMismatch();
```
Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function.
### ERC725X_InsufficientBalance
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_insufficientbalance)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_InsufficientBalance(uint256,uint256)`
- Error hash: `0x0df9a8f8`
:::
```solidity
error ERC725X_InsufficientBalance(uint256 balance, uint256 value);
```
Reverts when trying to send more native tokens `value` than available in current `balance`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. |
| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. |
### ERC725X_MsgValueDisallowedInDelegateCall
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_msgvaluedisallowedindelegatecall)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()`
- Error hash: `0x5ac83135`
:::
```solidity
error ERC725X_MsgValueDisallowedInDelegateCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting.
### ERC725X_MsgValueDisallowedInStaticCall
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_msgvaluedisallowedinstaticcall)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_MsgValueDisallowedInStaticCall()`
- Error hash: `0x72f2bc6a`
:::
```solidity
error ERC725X_MsgValueDisallowedInStaticCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation.
### ERC725X_NoContractBytecodeProvided
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_nocontractbytecodeprovided)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_NoContractBytecodeProvided()`
- Error hash: `0xb81cd8d9`
:::
```solidity
error ERC725X_NoContractBytecodeProvided();
```
Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_UnknownOperationType
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_unknownoperationtype)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_UnknownOperationType(uint256)`
- Error hash: `0x7583b3bc`
:::
```solidity
error ERC725X_UnknownOperationType(uint256 operationTypeProvided);
```
Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ |
| `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. |
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownablecallernottheowner)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
---
# ERC725
:::info Standard Specifications
[`ERC-725`](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md)
:::
:::info Solidity implementation
[`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
:::
> ERC725 bundle.
Bundle ERC725X and ERC725Y together into one smart contract.
## 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
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#constructor)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
:::
```solidity
constructor(address initialOwner);
```
_Deploying an ERC725 smart contract and setting address `initialOwner` as the contract owner._
Deploy a new ERC725 contract with the provided `initialOwner` as the contract [`owner`](#owner).
**Requirements:**
- `initialOwner` CANNOT be the zero address.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------- |
| `initialOwner` | `address` | the owner of the contract. |
### execute
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#execute)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `execute(uint256,address,uint256,bytes)`
- Function selector: `0x44c028fe`
:::
```solidity
function execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) external payable returns (bytes);
```
_Calling address `target` using `operationType`, transferring `value` wei and data: `data`._
Generic executor function to:
- send native tokens to any address.
- interact with any contract by passing an abi-encoded function call in the `data` parameter.
- deploy a contract by providing its creation bytecode in the `data` parameter.
**Requirements:**
- SHOULD only be callable by the [`owner`](#owner) of the contract.
- if a `value` is provided, the contract MUST have at least this amount to transfer to `target` from its balance and execute successfully.
- if the operation type is `STATICCALL` (`3`) or `DELEGATECALL` (`4`), `value` transfer is disallowed and SHOULD be 0.
- `target` SHOULD be `address(0)` when deploying a new contract via `operationType` `CREATE` (`1`), or `CREATE2` (`2`).
**Emitted events:**
- [`Executed`](#executed) event when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL).
- [`ContractCreated`](#contractcreated) event when deploying a new contract with `operationType` 1 (CREATE) or 2 (CREATE2).
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 |
| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) |
| `value` | `uint256` | The amount of native tokens to transfer (in Wei) |
| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------- |
| `0` | `bytes` | - |
### executeBatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#executebatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])`
- Function selector: `0x31858452`
:::
:::caution Warning
- The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) external payable returns (bytes[]);
```
_Calling multiple addresses `targets` using `operationsType`, transferring `values` wei and data: `datas`._
Batch executor function that behaves the same as [`execute`](#execute) but allowing multiple operations in the same transaction.
**Requirements:**
- All the array parameters provided MUST be equal and have the same length.
- SHOULD only be callable by the [`owner`](#owner) of the contract.
- The contract MUST have in its balance **at least the sum of all the `values`** to transfer and execute successfully each calldata payloads.
**Emitted events:**
- [`Executed`](#executed) event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL)
- [`ContractCreated`](#contractcreated) event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2)
#### Parameters
| Name | Type | Description |
| ---------------- | :---------: | --------------------------------------------------------------------------------------------------------------- |
| `operationsType` | `uint256[]` | The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4` |
| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). |
| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei). |
| `datas` | `bytes[]` | The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `bytes[]` | - |
### getData
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#getdata)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#getdatabatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### owner
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#owner)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#renounceownership)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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.
### setData
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#setdata)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#setdatabatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#supportsinterface)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### transferOwnership
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#transferownership)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_execute
```solidity
function _execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes);
```
check the `operationType` provided and perform the associated low-level opcode after checking for requirements (see [`execute`](#execute)).
### \_executeBatch
```solidity
function _executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) internal nonpayable returns (bytes[]);
```
check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)).
### \_executeCall
```solidity
function _executeCall(
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level call (operation type = 0)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------- |
| `target` | `address` | The address on which call is executed |
| `value` | `uint256` | The value to be sent with the call |
| `data` | `bytes` | The data to be sent with the call |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ---------------------- |
| `result` | `bytes` | The data from the call |
### \_executeStaticCall
```solidity
function _executeStaticCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level staticcall (operation type = 3)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `target` | `address` | The address on which staticcall is executed |
| `data` | `bytes` | The data to be sent with the staticcall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ------------------------------------- |
| `result` | `bytes` | The data returned from the staticcall |
### \_executeDelegateCall
:::caution Warning
The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function _executeDelegateCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level delegatecall (operation type = 4)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | --------------------------------------------- |
| `target` | `address` | The address on which delegatecall is executed |
| `data` | `bytes` | The data to be sent with the delegatecall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | --------------------------------------- |
| `result` | `bytes` | The data returned from the delegatecall |
### \_deployCreate
```solidity
function _deployCreate(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE` opcode (operation type = 1)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_deployCreate2
```solidity
function _deployCreate2(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE2` opcode (operation type = 2)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
Write a `dataValue` to the underlying ERC725Y storage, represented as a mapping of
`bytes32` data keys mapped to their `bytes` data values.
```solidity
mapping(bytes32 => bytes) _store
```
**Emitted events:**
- [`DataChanged`](#datachanged) event emitted after a successful `setData` call.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to write the associated `bytes` value to the store. |
| `dataValue` | `bytes` | The `bytes` value to associate with the given `dataKey` in the ERC725Y storage. |
## Events
### ContractCreated
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#contractcreated)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `ContractCreated(uint256,address,uint256,bytes32)`
- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3`
:::
```solidity
event ContractCreated(uint256 indexed operationType, address indexed contractAddress, uint256 value, bytes32 indexed salt);
```
_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._
Emitted when a new contract was created and deployed.
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (`CREATE` or `CREATE2`). |
| `contractAddress` **`indexed`** | `address` | The created contract address. |
| `value` | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. |
| `salt` **`indexed`** | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. |
### DataChanged
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#datachanged)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Executed
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#executed)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `Executed(uint256,address,uint256,bytes4)`
- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e`
:::
```solidity
event Executed(uint256 indexed operationType, address indexed target, uint256 value, bytes4 indexed selector);
```
_Called address `target` using `operationType` with `value` wei and `data`._
Emitted when calling an address `target` (EOA or contract) with `value`.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `target` address (`CALL`, `STATICALL` or `DELEGATECALL`). |
| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). |
| `value` | `uint256` | The amount of native tokens transferred along the call (in Wei). |
| `selector` **`indexed`** | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. |
### OwnershipTransferred
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownershiptransferred)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
## Errors
### ERC725X_ContractDeploymentFailed
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_contractdeploymentfailed)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_ContractDeploymentFailed()`
- Error hash: `0x0b07489b`
:::
```solidity
error ERC725X_ContractDeploymentFailed();
```
Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_CreateOperationsRequireEmptyRecipientAddress
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_createoperationsrequireemptyrecipientaddress)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()`
- Error hash: `0x3041824a`
:::
```solidity
error ERC725X_CreateOperationsRequireEmptyRecipientAddress();
```
Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_ExecuteParametersEmptyArray
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_executeparametersemptyarray)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_ExecuteParametersEmptyArray()`
- Error hash: `0xe9ad2b5f`
:::
```solidity
error ERC725X_ExecuteParametersEmptyArray();
```
Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array.
### ERC725X_ExecuteParametersLengthMismatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_executeparameterslengthmismatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_ExecuteParametersLengthMismatch()`
- Error hash: `0x3ff55f4d`
:::
```solidity
error ERC725X_ExecuteParametersLengthMismatch();
```
Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function.
### ERC725X_InsufficientBalance
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_insufficientbalance)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_InsufficientBalance(uint256,uint256)`
- Error hash: `0x0df9a8f8`
:::
```solidity
error ERC725X_InsufficientBalance(uint256 balance, uint256 value);
```
Reverts when trying to send more native tokens `value` than available in current `balance`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. |
| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. |
### ERC725X_MsgValueDisallowedInDelegateCall
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_msgvaluedisallowedindelegatecall)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()`
- Error hash: `0x5ac83135`
:::
```solidity
error ERC725X_MsgValueDisallowedInDelegateCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting.
### ERC725X_MsgValueDisallowedInStaticCall
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_msgvaluedisallowedinstaticcall)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_MsgValueDisallowedInStaticCall()`
- Error hash: `0x72f2bc6a`
:::
```solidity
error ERC725X_MsgValueDisallowedInStaticCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation.
### ERC725X_NoContractBytecodeProvided
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_nocontractbytecodeprovided)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_NoContractBytecodeProvided()`
- Error hash: `0xb81cd8d9`
:::
```solidity
error ERC725X_NoContractBytecodeProvided();
```
Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_UnknownOperationType
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725x_unknownoperationtype)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725X_UnknownOperationType(uint256)`
- Error hash: `0x7583b3bc`
:::
```solidity
error ERC725X_UnknownOperationType(uint256 operationTypeProvided);
```
Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ |
| `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. |
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownablecallernottheowner)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**ERC-725**](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`ERC725.sol`](https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP0ERC725Account
:::info Standard Specifications
[`LSP-0-ERC725Account`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md)
:::
:::info Solidity implementation
[`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
:::
> Deployable Implementation of [LSP-0-ERC725Account] Standard.
A smart contract account including basic functionalities such as:
- Detecting supported standards using [ERC-165]
- Executing several operation on other addresses including creating contracts using [ERC-725X]
- A generic data key-value store using [ERC-725Y]
- Validating signatures using [ERC-1271]
- Receiving notification and react on them using [LSP-1-UniversalReceiver]
- Safer ownership management through 2-steps transfer using [LSP-14-Ownable2Step]
- Extending the account with new functions and interfaceIds of future standards using [LSP-17-ContractExtension]
- Verifying calls on the owner to make it easier to interact with the account directly using [LSP-20-CallVerification]
## 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
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#constructor)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
:::
```solidity
constructor(address initialOwner);
```
_Deploying a LSP0ERC725Account contract with owner set to address `initialOwner`._
Set `initialOwner` as the contract owner.
- The `constructor` also allows funding the contract on deployment.
- The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when funding the contract on deployment.
- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set as the contract [`owner`](#owner).
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------- |
| `initialOwner` | `address` | The owner of the contract. |
### fallback
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#fallback)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
:::
:::info
Whenever the call is associated with native tokens, the function will delegate the handling of native tokens internally to the [`universalReceiver`](#universalreceiver) function
passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data, except when the native token will be sent directly to the extension.
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens with some calldata.
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), return.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens and extension function selector is not found or not payable.
### receive
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#receive)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
:::
:::info
This function internally delegates the handling of native tokens to the [`universalReceiver`](#universalreceiver) function
passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and an empty bytes array as received data.
:::
```solidity
receive() external payable;
```
Executed:
- When receiving some native tokens without any additional data.
- On empty calls to the contract.
**Emitted events:**
- Emits a [`UniversalReceiver`](#universalreceiver) event when the `universalReceiver` logic is executed upon receiving native tokens.
### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_delay)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()`
- Function selector: `0xead3fbdf`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()
external
view
returns (uint256);
```
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_period)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()`
- Function selector: `0x01bfba61`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()
external
view
returns (uint256);
```
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### VERSION
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#version)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### acceptOwnership
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `acceptOwnership()`
- Function selector: `0x79ba5097`
:::
```solidity
function acceptOwnership() external nonpayable;
```
_`msg.sender` is accepting ownership of contract: `address(this)`._
Transfer ownership of the contract from the current [`owner()`](#owner) to the [`pendingOwner()`](#pendingowner). Once this function is called:
- The current [`owner()`](#owner) will lose access to the functions restricted to the [`owner()`](#owner) only.
- The [`pendingOwner()`](#pendingowner) will gain access to the functions restricted to the [`owner()`](#owner) only.
**Requirements:**
- Only the [`pendingOwner`](#pendingowner) can call this function.
- When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification].
- When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].
### batchCalls
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#batchcalls)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### execute
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#execute)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `execute(uint256,address,uint256,bytes)`
- Function selector: `0x44c028fe`
:::
```solidity
function execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) external payable returns (bytes);
```
_Calling address `target` using `operationType`, transferring `value` wei and data: `data`._
Generic executor function to:
- send native tokens to any address.
- interact with any contract by passing an abi-encoded function call in the `data` parameter.
- deploy a contract by providing its creation bytecode in the `data` parameter.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully.
- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`.
- If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.
**Emitted events:**
- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4).
- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2).
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 |
| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) |
| `value` | `uint256` | The amount of native tokens to transfer (in Wei) |
| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------- |
| `0` | `bytes` | - |
### executeBatch
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#executebatch)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])`
- Function selector: `0x31858452`
:::
:::caution Warning
- The `msg.value` should not be trusted for any method called within the batch with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) external payable returns (bytes[]);
```
_Calling multiple addresses `targets` using `operationsType`, transferring `values` wei and data: `datas`._
Batch executor function that behaves the same as [`execute`](#execute) but allowing multiple operations in the same transaction.
**Requirements:**
- The length of the parameters provided must be equal.
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully.
- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`.
- If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.
**Emitted events:**
- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration)
- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration)
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
#### Parameters
| Name | Type | Description |
| ---------------- | :---------: | --------------------------------------------------------------------------------------------------------------- |
| `operationsType` | `uint256[]` | The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4` |
| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). |
| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei). |
| `datas` | `bytes[]` | The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `bytes[]` | - |
### getData
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#getdata)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#getdatabatch)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### isValidSignature
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#isvalidsignature)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `isValidSignature(bytes32,bytes)`
- Function selector: `0x1626ba7e`
:::
:::caution Warning
This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP0ERC725Account and prevent signatures from the same EOA to be replayed across different LSP0ERC725Accounts.
:::
```solidity
function isValidSignature(
bytes32 dataHash,
bytes signature
) external view returns (bytes4 returnedStatus);
```
_Achieves the goal of [EIP-1271] by validating signatures of smart contracts according to their own logic._
Handles two cases:
1. If the owner is an EOA, recovers an address from the hash and the signature provided:
- Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature.
- If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid.
2. If the owner is a smart contract, it forwards the call of [`isValidSignature()`](#isvalidsignature) to the owner contract:
- If the contract fails or returns the `_ERC1271_FAILVALUE`, the [`isValidSignature()`](#isvalidsignature) on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid.
- If the [`isValidSignature()`](#isvalidsignature) on the owner returned the `_ERC1271_SUCCESSVALUE`, the [`isValidSignature()`](#isvalidsignature) on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------ |
| `dataHash` | `bytes32` | The hash of the data to be validated. |
| `signature` | `bytes` | A signature that can validate the previous parameter (Hash). |
#### Returns
| Name | Type | Description |
| ---------------- | :------: | ----------------------------------------------------------------- |
| `returnedStatus` | `bytes4` | A `bytes4` value that indicates if the signature is valid or not. |
### owner
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#owner)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### pendingOwner
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#pendingowner)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `pendingOwner()`
- Function selector: `0xe30c3978`
:::
:::info
If no ownership transfer is in progress, the pendingOwner will be `address(0).`.
:::
```solidity
function pendingOwner() external view returns (address);
```
The address that ownership of the contract is transferred to. This address may use [`acceptOwnership()`](#acceptownership) to gain ownership of the contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounceownership)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
:::danger
Leaves the contract without an owner. Once ownership of the contract has been renounced, any functions that are restricted to be called by the owner or an address allowed by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.
:::
```solidity
function renounceOwnership() external nonpayable;
```
_`msg.sender` is renouncing ownership of contract `address(this)`._
Renounce ownership of the contract in a 2-step process.
1. The first call will initiate the process of renouncing ownership.
2. The second call is used as a confirmation and will leave the contract without an owner.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
### setData
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#setdata)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
```solidity
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:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#setdatabatch)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
```solidity
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`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
- [`DataChanged`](#datachanged) event. (on each iteration of setting data)
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#supportsinterface)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
_Checking if this contract supports the interface defined by the `bytes4` interface ID `interfaceId`._
Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`.
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ------------------------------------------------------ |
| `interfaceId` | `bytes4` | The interface ID to check if the contract supports it. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------------------------------- |
| `0` | `bool` | `true` if this contract implements the interface defined by `interfaceId`, `false` otherwise. |
### transferOwnership
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
function transferOwnership(address pendingNewOwner) external nonpayable;
```
_Transfer ownership initiated by `newOwner`._
Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the [`universalReceiver()`](#universalreceiver) function on the `newOwner` contract.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted].
- Pending owner cannot accept ownership in the same tx via the LSP1 hook.
#### Parameters
| Name | Type | Description |
| ----------------- | :-------: | ----------- |
| `pendingNewOwner` | `address` | - |
### universalReceiver
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#universalreceiver)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Function signature: `universalReceiver(bytes32,bytes)`
- Function selector: `0x6bb56a14`
:::
```solidity
function universalReceiver(
bytes32 typeId,
bytes receivedData
) external payable returns (bytes returnedValues);
```
_Notifying the contract by calling its `universalReceiver` function with the following information: typeId: `typeId`; data: `data`._
Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps:
1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY].
- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId.
- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.
2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId.
- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. This function delegates internally the handling of native tokens to the [`universalReceiver`](#universalreceiver) function itself passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) when receiving native tokens.
- [`UniversalReceiver`](#universalreceiver) event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------- |
| `typeId` | `bytes32` | The type of call received. |
| `receivedData` | `bytes` | The data received. |
#### Returns
| Name | Type | Description |
| ---------------- | :-----: | ------------------------------------------------------------------------------------------------------- |
| `returnedValues` | `bytes` | The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call. |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_execute
```solidity
function _execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes);
```
check the `operationType` provided and perform the associated low-level opcode after checking for requirements (see [`execute`](#execute)).
### \_executeBatch
```solidity
function _executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) internal nonpayable returns (bytes[]);
```
check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)).
### \_executeCall
```solidity
function _executeCall(
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level call (operation type = 0)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------- |
| `target` | `address` | The address on which call is executed |
| `value` | `uint256` | The value to be sent with the call |
| `data` | `bytes` | The data to be sent with the call |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ---------------------- |
| `result` | `bytes` | The data from the call |
### \_executeStaticCall
```solidity
function _executeStaticCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level staticcall (operation type = 3)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `target` | `address` | The address on which staticcall is executed |
| `data` | `bytes` | The data to be sent with the staticcall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ------------------------------------- |
| `result` | `bytes` | The data returned from the staticcall |
### \_executeDelegateCall
:::caution Warning
The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function _executeDelegateCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level delegatecall (operation type = 4)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | --------------------------------------------- |
| `target` | `address` | The address on which delegatecall is executed |
| `data` | `bytes` | The data to be sent with the delegatecall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | --------------------------------------- |
| `result` | `bytes` | The data returned from the delegatecall |
### \_deployCreate
```solidity
function _deployCreate(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE` opcode (operation type = 1)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_deployCreate2
```solidity
function _deployCreate2(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE2` opcode (operation type = 2)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
Write a `dataValue` to the underlying ERC725Y storage, represented as a mapping of
`bytes32` data keys mapped to their `bytes` data values.
```solidity
mapping(bytes32 => bytes) _store
```
**Emitted events:**
- [`DataChanged`](#datachanged) event emitted after a successful `setData` call.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to write the associated `bytes` value to the store. |
| `dataValue` | `bytes` | The `bytes` value to associate with the given `dataKey` in the ERC725Y storage. |
### \_transferOwnership
```solidity
function _transferOwnership(address newOwner) internal nonpayable;
```
Set the pending owner of the contract and cancel any renounce ownership process that was previously started.
**Requirements:**
- `newOwner` cannot be the address of the contract itself.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------- |
| `newOwner` | `address` | The address of the new pending owner. |
### \_acceptOwnership
```solidity
function _acceptOwnership() internal nonpayable;
```
Set the pending owner of the contract as the new owner.
### \_renounceOwnership
```solidity
function _renounceOwnership() internal nonpayable;
```
Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed.
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address and the boolean indicating whether to forward the value received to the extension, stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
- If the stored value is 20 bytes, return false for the boolean
### \_fallbackLSP17Extendable
:::tip Hint
If you would like to forward the `msg.value` to the extension contract, you should store an additional `0x01` byte after the address of the extension under the corresponding LSP17 data key.
:::
```solidity
function _fallbackLSP17Extendable(
bytes callData
) internal nonpayable returns (bytes);
```
Forwards the call to an extension mapped to a function selector.
Calls [`_getExtensionAndForwardValue`](#_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.
Forwards the value sent with the call to the extension if the function selector is mapped to a payable extension.
Reverts if there is no extension for the function being called, except for the `bytes4(0)` function selector, which passes even if there is no extension for it.
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`](#msg.sender) and 32 bytes of the `msg.value`.
### \_verifyCall
```solidity
function _verifyCall(
address logicVerifier
) internal nonpayable returns (bool verifyAfter);
```
Calls [`lsp20VerifyCall`](#lsp20verifycall) function on the logicVerifier.
### \_verifyCallResult
```solidity
function _verifyCallResult(
address logicVerifier,
bytes callResult
) internal nonpayable;
```
Calls [`lsp20VerifyCallResult`](#lsp20verifycallresult) function on the logicVerifier.
### \_revertWithLSP20DefaultError
```solidity
function _revertWithLSP20DefaultError(
bool postCall,
bytes returnedData
) internal pure;
```
## Events
### ContractCreated
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#contractcreated)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `ContractCreated(uint256,address,uint256,bytes32)`
- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3`
:::
```solidity
event ContractCreated(
uint256 indexed operationType,
address indexed contractAddress,
uint256 value,
bytes32 indexed salt
);
```
_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._
Emitted when a new contract was created and deployed.
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (`CREATE` or `CREATE2`). |
| `contractAddress` **`indexed`** | `address` | The created contract address. |
| `value` | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. |
| `salt` **`indexed`** | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. |
### DataChanged
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#datachanged)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Executed
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#executed)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `Executed(uint256,address,uint256,bytes4)`
- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e`
:::
```solidity
event Executed(
uint256 indexed operationType,
address indexed target,
uint256 value,
bytes4 indexed selector
);
```
_Called address `target` using `operationType` with `value` wei and `data`._
Emitted when calling an address `target` (EOA or contract) with `value`.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `target` address (`CALL`, `STATICALL` or `DELEGATECALL`). |
| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). |
| `value` | `uint256` | The amount of native tokens transferred along the call (in Wei). |
| `selector` **`indexed`** | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. |
### OwnershipRenounced
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#ownershiprenounced)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `OwnershipRenounced()`
- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce`
:::
```solidity
event OwnershipRenounced();
```
_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._
Emitted when the ownership of the contract has been renounced.
### OwnershipTransferStarted
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferstarted)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `OwnershipTransferStarted(address,address)`
- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700`
:::
```solidity
event OwnershipTransferStarted(
address indexed previousOwner,
address indexed newOwner
);
```
_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._
Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------- |
| `previousOwner` **`indexed`** | `address` | The address of the previous owner. |
| `newOwner` **`indexed`** | `address` | The address of the new owner. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferred)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### RenounceOwnershipStarted
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounceownershipstarted)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `RenounceOwnershipStarted()`
- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7`
:::
```solidity
event RenounceOwnershipStarted();
```
_Ownership renouncement initiated._
Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process.
### UniversalReceiver
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#universalreceiver)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)`
- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2`
:::
```solidity
event UniversalReceiver(
address indexed from,
uint256 indexed value,
bytes32 indexed typeId,
bytes receivedData,
bytes returnedValue
);
```
\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId`
- Data received: `receivedData`.\*
Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData`
#### Parameters
| Name | Type | Description |
| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the [`universalReceiver(...)`](#universalreceiver) function. |
| `value` **`indexed`** | `uint256` | The amount sent to the [`universalReceiver(...)`](#universalreceiver) function. |
| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. |
| `receivedData` | `bytes` | Any arbitrary data that was sent to the [`universalReceiver(...)`](#universalreceiver) function. |
| `returnedValue` | `bytes` | The value returned by the [`universalReceiver(...)`](#universalreceiver) function. |
## Errors
### ERC725X_ContractDeploymentFailed
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_contractdeploymentfailed)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_ContractDeploymentFailed()`
- Error hash: `0x0b07489b`
:::
```solidity
error ERC725X_ContractDeploymentFailed();
```
Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_CreateOperationsRequireEmptyRecipientAddress
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_createoperationsrequireemptyrecipientaddress)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()`
- Error hash: `0x3041824a`
:::
```solidity
error ERC725X_CreateOperationsRequireEmptyRecipientAddress();
```
Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_ExecuteParametersEmptyArray
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparametersemptyarray)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_ExecuteParametersEmptyArray()`
- Error hash: `0xe9ad2b5f`
:::
```solidity
error ERC725X_ExecuteParametersEmptyArray();
```
Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array.
### ERC725X_ExecuteParametersLengthMismatch
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparameterslengthmismatch)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_ExecuteParametersLengthMismatch()`
- Error hash: `0x3ff55f4d`
:::
```solidity
error ERC725X_ExecuteParametersLengthMismatch();
```
Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function.
### ERC725X_InsufficientBalance
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_insufficientbalance)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_InsufficientBalance(uint256,uint256)`
- Error hash: `0x0df9a8f8`
:::
```solidity
error ERC725X_InsufficientBalance(uint256 balance, uint256 value);
```
Reverts when trying to send more native tokens `value` than available in current `balance`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. |
| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. |
### ERC725X_MsgValueDisallowedInDelegateCall
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedindelegatecall)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()`
- Error hash: `0x5ac83135`
:::
```solidity
error ERC725X_MsgValueDisallowedInDelegateCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting.
### ERC725X_MsgValueDisallowedInStaticCall
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedinstaticcall)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_MsgValueDisallowedInStaticCall()`
- Error hash: `0x72f2bc6a`
:::
```solidity
error ERC725X_MsgValueDisallowedInStaticCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation.
### ERC725X_NoContractBytecodeProvided
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_nocontractbytecodeprovided)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_NoContractBytecodeProvided()`
- Error hash: `0xb81cd8d9`
:::
```solidity
error ERC725X_NoContractBytecodeProvided();
```
Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_UnknownOperationType
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_unknownoperationtype)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725X_UnknownOperationType(uint256)`
- Error hash: `0x7583b3bc`
:::
```solidity
error ERC725X_UnknownOperationType(uint256 operationTypeProvided);
```
Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ |
| `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. |
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### LSP14CallerNotPendingOwner
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14callernotpendingowner)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP14CallerNotPendingOwner(address)`
- Error hash: `0x451e4528`
:::
```solidity
error LSP14CallerNotPendingOwner(address caller);
```
Reverts when the `caller` that is trying to accept ownership of the contract is not the pending owner.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `caller` | `address` | The address that tried to accept ownership. |
### LSP14CannotTransferOwnershipToSelf
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14cannottransferownershiptoself)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP14CannotTransferOwnershipToSelf()`
- Error hash: `0xe052a6f8`
:::
```solidity
error LSP14CannotTransferOwnershipToSelf();
```
_Cannot transfer ownership to the address of the contract itself._
Reverts when trying to transfer ownership to the `address(this)`.
### LSP14MustAcceptOwnershipInSeparateTransaction
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14mustacceptownershipinseparatetransaction)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()`
- Error hash: `0x5758dd07`
:::
```solidity
error LSP14MustAcceptOwnershipInSeparateTransaction();
```
_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._
Reverts when pending owner accept ownership in the same transaction of transferring ownership.
### LSP14NotInRenounceOwnershipInterval
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14notinrenounceownershipinterval)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP14NotInRenounceOwnershipInterval(uint256,uint256)`
- Error hash: `0x1b080942`
:::
```solidity
error LSP14NotInRenounceOwnershipInterval(
uint256 renounceOwnershipStart,
uint256 renounceOwnershipEnd
);
```
_Cannot confirm ownership renouncement yet. The ownership renouncement is allowed from: `renounceOwnershipStart` until: `renounceOwnershipEnd`._
Reverts when trying to renounce ownership before the initial confirmation delay.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ----------------------------------------------------------------------- |
| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. |
| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. |
### LSP20CallVerificationFailed
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp20callverificationfailed)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP20CallVerificationFailed(bool,bytes4)`
- Error hash: `0x9d6741e3`
:::
```solidity
error LSP20CallVerificationFailed(bool postCall, bytes4 returnedStatus);
```
reverts when the call to the owner does not return the LSP20 success value
#### Parameters
| Name | Type | Description |
| ---------------- | :------: | ------------------------------------------------------- |
| `postCall` | `bool` | True if the execution call was done, False otherwise |
| `returnedStatus` | `bytes4` | The bytes4 decoded data returned by the logic verifier. |
### LSP20CallingVerifierFailed
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp20callingverifierfailed)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP20CallingVerifierFailed(bool)`
- Error hash: `0x8c6a8ae3`
:::
```solidity
error LSP20CallingVerifierFailed(bool postCall);
```
reverts when the call to the owner fail with no revert reason
#### Parameters
| Name | Type | Description |
| ---------- | :----: | ---------------------------------------------------- |
| `postCall` | `bool` | True if the execution call was done, False otherwise |
### LSP20EOACannotVerifyCall
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp20eoacannotverifycall)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `LSP20EOACannotVerifyCall(address)`
- Error hash: `0x0c392301`
:::
```solidity
error LSP20EOACannotVerifyCall(address logicVerifier);
```
Reverts when the logic verifier is an Externally Owned Account (EOA) that cannot return the LSP20 success value.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | --------------------------------- |
| `logicVerifier` | `address` | The address of the logic verifier |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-0-ERC725Account**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP0ERC725Account.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP11BasicSocialRecovery
:::info Standard Specifications
[`LSP-11-BasicSocialRecovery`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md)
:::
:::info Solidity implementation
[`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
:::
> Implementation of LSP11 - Social Recovery standard
Sets permission for a controller address after a recovery process to interact with an ERC725 contract via the LSP6KeyManager
## 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
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
:::
```solidity
constructor(address _owner, address target_);
```
_Sets the target and the owner addresses_
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------- |
| `_owner` | `address` | The owner of the LSP11 contract |
| `target_` | `address` | The address of the ER725 contract to recover |
### addGuardian
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#addguardian)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `addGuardian(address)`
- Function selector: `0xa526d83b`
:::
```solidity
function addGuardian(address newGuardian) external nonpayable;
```
Adds a guardian of the targetCan be called only by the owner
#### Parameters
| Name | Type | Description |
| ------------- | :-------: | -------------------------------- |
| `newGuardian` | `address` | The address to add as a guardian |
### getGuardianChoice
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#getguardianchoice)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `getGuardianChoice(address)`
- Function selector: `0xf6a22f02`
:::
```solidity
function getGuardianChoice(address guardian) external view returns (address);
```
Returns the address of a controller that a `guardian` selected for in order to recover the target
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------ |
| `guardian` | `address` | the address of a guardian to query his selection |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------ |
| `0` | `address` | the address that `guardian` selected |
### getGuardians
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#getguardians)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `getGuardians()`
- Function selector: `0x0665f04b`
:::
```solidity
function getGuardians() external view returns (address[]);
```
Returns the addresses of all guardians The guardians will select an address to be added as a controller key for the linked `target` if he reaches the guardian threshold and provide the correct string that produce the secretHash
#### Returns
| Name | Type | Description |
| ---- | :---------: | ----------- |
| `0` | `address[]` | - |
### getGuardiansThreshold
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#getguardiansthreshold)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `getGuardiansThreshold()`
- Function selector: `0x187c5348`
:::
```solidity
function getGuardiansThreshold() external view returns (uint256);
```
Returns the guardian threshold The guardian threshold represents the minimum number of selection by guardians required for an address to start a recovery process
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### getRecoveryCounter
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#getrecoverycounter)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `getRecoveryCounter()`
- Function selector: `0xf79c8b77`
:::
```solidity
function getRecoveryCounter() external view returns (uint256);
```
Returns the current recovery counter When a recovery process is successfully finished the recovery counter is incremented
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### getRecoverySecretHash
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#getrecoverysecrethash)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `getRecoverySecretHash()`
- Function selector: `0x8f9083bb`
:::
```solidity
function getRecoverySecretHash() external view returns (bytes32);
```
Returns the recovery secret hash
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `bytes32` | - |
### isGuardian
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#isguardian)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `isGuardian(address)`
- Function selector: `0x0c68ba21`
:::
```solidity
function isGuardian(address _address) external view returns (bool);
```
Returns TRUE if the address provided is a guardian, FALSE otherwise
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | -------------------- |
| `_address` | `address` | The address to query |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### owner
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#owner)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### recoverOwnership
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#recoverownership)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `recoverOwnership(address,string,bytes32)`
- Function selector: `0xae8481b2`
:::
```solidity
function recoverOwnership(
address recoverer,
string plainSecret,
bytes32 newSecretHash
) external nonpayable;
```
Recovers the ownership permissions of an address in the linked target and increment the recover counter Requirements
- the address of the recoverer must have a selection equal or higher than the threshold defined in `getGuardiansThreshold(...)`
- must have provided the right `plainSecret` that produces the secret Hash
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | -------------------------------------------- |
| `recoverer` | `address` | The address of the recoverer |
| `plainSecret` | `string` | The secret word that produce the secret Hash |
| `newSecretHash` | `bytes32` | - |
### removeGuardian
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#removeguardian)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `removeGuardian(address)`
- Function selector: `0x71404156`
:::
```solidity
function removeGuardian(address existingGuardian) external nonpayable;
```
Removes a guardian of the targetCan be called only by the owner
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | ----------- |
| `existingGuardian` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#renounceownership)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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.
### selectNewController
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#selectnewcontroller)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `selectNewController(address)`
- Function selector: `0xaa7806d6`
:::
```solidity
function selectNewController(address addressSelected) external nonpayable;
```
select an address to be a potential controller address if he reaches the guardian threshold and provide the correct secret string Requirements:
- only guardians can select an address
#### Parameters
| Name | Type | Description |
| ----------------- | :-------: | ------------------------------------ |
| `addressSelected` | `address` | The address selected by the guardian |
### setGuardiansThreshold
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#setguardiansthreshold)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `setGuardiansThreshold(uint256)`
- Function selector: `0x6bfed20b`
:::
```solidity
function setGuardiansThreshold(uint256 newThreshold) external nonpayable;
```
Sets the minimum number of selection by the guardians required so that an address can recover ownershipCan be called only by the owner
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------- |
| `newThreshold` | `uint256` | - |
### setRecoverySecretHash
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#setrecoverysecrethash)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `setRecoverySecretHash(bytes32)`
- Function selector: `0xf799e38d`
:::
```solidity
function setRecoverySecretHash(
bytes32 newRecoverSecretHash
) external nonpayable;
```
Throws if hash provided is bytes32(0)
#### Parameters
| Name | Type | Description |
| ---------------------- | :-------: | ------------------------------------------------------------------------------- |
| `newRecoverSecretHash` | `bytes32` | The hash of the secret string Requirements: - `secretHash` cannot be bytes32(0) |
### supportsInterface
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#supportsinterface)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 _interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| -------------- | :------: | ----------- |
| `_interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### target
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#target)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `target()`
- Function selector: `0xd4b83992`
:::
```solidity
function target() external view returns (address);
```
The address of an ERC725 contract where we want to recover and set permissions for a controller address
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### transferOwnership
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#transferownership)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_validateRequirements
```solidity
function _validateRequirements(
address recoverer,
uint256 currentRecoveryCounter,
string plainSecret,
bytes32 newHash,
address[] guardians
) internal view;
```
The number of guardians should be reasonable, as the validation method
is using a loop to check the selection of each guardian
Throws if:
- The address trying to recover didn't reach the guardiansThreshold
- The new hash being set is bytes32(0)
- The secret word provided is incorrect
### \_cleanStorage
```solidity
function _cleanStorage(
uint256 recoveryCounter,
uint256 guardiansLength,
address[] guardians
) internal nonpayable;
```
Remove the guardians choice after a successful recovery process
To avoid keeping unnecessary state
## Events
### GuardianAdded
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#guardianadded)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `GuardianAdded(address)`
- Event topic hash: `0x038596bb31e2e7d3d9f184d4c98b310103f6d7f5830e5eec32bffe6f1728f969`
:::
```solidity
event GuardianAdded(address indexed newGuardian);
```
_Emitted when setting a new guardian for the target_
#### Parameters
| Name | Type | Description |
| --------------------------- | :-------: | --------------------------------- |
| `newGuardian` **`indexed`** | `address` | The address of the added guardian |
### GuardianRemoved
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#guardianremoved)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `GuardianRemoved(address)`
- Event topic hash: `0xb8107d0c6b40be480ce3172ee66ba6d64b71f6b1685a851340036e6e2e3e3c52`
:::
```solidity
event GuardianRemoved(address indexed removedGuardian);
```
_Emitted when removing an existing guardian for the target_
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ----------------------------------- |
| `removedGuardian` **`indexed`** | `address` | The address of the guardian removed |
### GuardiansThresholdChanged
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#guardiansthresholdchanged)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `GuardiansThresholdChanged(uint256)`
- Event topic hash: `0x7146d20a2c7b7c75c203774c9f241b61698fac43a4a81ccd828f0d8162392790`
:::
```solidity
event GuardiansThresholdChanged(uint256 indexed guardianThreshold);
```
_Emitted when changing the guardian threshold_
#### Parameters
| Name | Type | Description |
| --------------------------------- | :-------: | ----------------------------------------------------------------------------------------------- |
| `guardianThreshold` **`indexed`** | `uint256` | The minimum number of selection by guardians needed by a controller to start a recovery process |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#ownershiptransferred)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### RecoveryProcessSuccessful
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#recoveryprocesssuccessful)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `RecoveryProcessSuccessful(uint256,address,bytes32,address[])`
- Event topic hash: `0xf4ff8803d6b43af46d48c200977209829c2f42f19f27eda1c89dbf26a28009cd`
:::
```solidity
event RecoveryProcessSuccessful(
uint256 indexed recoveryCounter,
address indexed newController,
bytes32 indexed newSecretHash,
address[] guardians
);
```
_Emitted when the recovery process is finished by the controller who reached the guardian threshold and submitted the string that produce the secretHash_
#### Parameters
| Name | Type | Description |
| ------------------------------- | :---------: | -------------------------------------------------------------------------- |
| `recoveryCounter` **`indexed`** | `uint256` | The current recovery process |
| `newController` **`indexed`** | `address` | The address of the new controller controlling the target by the KeyManager |
| `newSecretHash` **`indexed`** | `bytes32` | - |
| `guardians` | `address[]` | The array of addresses containing the guardians of the target |
### SecretHashChanged
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#secrethashchanged)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `SecretHashChanged(bytes32)`
- Event topic hash: `0x2e8c5419a62207ade549fe0b66c1c85c16f5e1ed654815dee3a3f3ac41770df3`
:::
```solidity
event SecretHashChanged(bytes32 indexed secretHash);
```
_Emitted when changing the secret hash_
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | --------------------------------------------------- |
| `secretHash` **`indexed`** | `bytes32` | The secret hash used to finish the recovery process |
### SelectedNewController
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#selectednewcontroller)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Event signature: `SelectedNewController(uint256,address,address)`
- Event topic hash: `0xe43f3c1093c69ab76b2cf6246090acb2f8eab7f19ba9942dfc8b8ec446e3a3de`
:::
```solidity
event SelectedNewController(
uint256 indexed recoveryCounter,
address indexed guardian,
address indexed addressSelected
);
```
_Emitted when a guardian select a new potential controller address for the target_
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ------------------------------------ |
| `recoveryCounter` **`indexed`** | `uint256` | The current recovery process counter |
| `guardian` **`indexed`** | `address` | The address of the guardian |
| `addressSelected` **`indexed`** | `address` | The address selected by the guardian |
## Errors
### AddressZeroNotAllowed
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#addresszeronotallowed)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `AddressZeroNotAllowed()`
- Error hash: `0x0855380c`
:::
```solidity
error AddressZeroNotAllowed();
```
reverts when the address zero calls `recoverOwnership(..)` function
### CallerIsNotGuardian
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#callerisnotguardian)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `CallerIsNotGuardian(address)`
- Error hash: `0x5560e16d`
:::
```solidity
error CallerIsNotGuardian(address caller);
```
reverts when the caller is not a guardian
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ----------- |
| `caller` | `address` | - |
### GuardianAlreadyExist
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#guardianalreadyexist)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `GuardianAlreadyExist(address)`
- Error hash: `0xd52858db`
:::
```solidity
error GuardianAlreadyExist(address addressToAdd);
```
reverts when adding an already existing guardian
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------- |
| `addressToAdd` | `address` | - |
### GuardianDoNotExist
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#guardiandonotexist)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `GuardianDoNotExist(address)`
- Error hash: `0x3d8e524e`
:::
```solidity
error GuardianDoNotExist(address addressToRemove);
```
reverts when removing a non-existing guardian
#### Parameters
| Name | Type | Description |
| ----------------- | :-------: | ----------- |
| `addressToRemove` | `address` | - |
### GuardiansNumberCannotGoBelowThreshold
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#guardiansnumbercannotgobelowthreshold)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `GuardiansNumberCannotGoBelowThreshold(uint256)`
- Error hash: `0x27113777`
:::
```solidity
error GuardiansNumberCannotGoBelowThreshold(uint256 guardianThreshold);
```
reverts when removing a guardian and the threshold is equal to the number of guardians
#### Parameters
| Name | Type | Description |
| ------------------- | :-------: | ----------- |
| `guardianThreshold` | `uint256` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#ownablecallernottheowner)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
### SecretHashCannotBeZero
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#secrethashcannotbezero)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `SecretHashCannotBeZero()`
- Error hash: `0x7f617002`
:::
```solidity
error SecretHashCannotBeZero();
```
reverts when the secret hash provided is equal to bytes32(0)
### ThresholdCannotBeHigherThanGuardiansNumber
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#thresholdcannotbehigherthanguardiansnumber)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `ThresholdCannotBeHigherThanGuardiansNumber(uint256,uint256)`
- Error hash: `0xe3db80bd`
:::
```solidity
error ThresholdCannotBeHigherThanGuardiansNumber(
uint256 thresholdGiven,
uint256 guardianNumber
);
```
reverts when setting the guardians threshold to a number higher than the guardians number
#### Parameters
| Name | Type | Description |
| ---------------- | :-------: | ----------- |
| `thresholdGiven` | `uint256` | - |
| `guardianNumber` | `uint256` | - |
### ThresholdNotReachedForRecoverer
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#thresholdnotreachedforrecoverer)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `ThresholdNotReachedForRecoverer(address,uint256,uint256)`
- Error hash: `0xf78f0507`
:::
```solidity
error ThresholdNotReachedForRecoverer(
address recoverer,
uint256 selections,
uint256 guardiansThreshold
);
```
reverts when `recoverOwnership(..)` is called with a recoverer that didn't reach the guardians threshold
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | ------------------------------------------------ |
| `recoverer` | `address` | The address of the recoverer |
| `selections` | `uint256` | The number of selections that the recoverer have |
| `guardiansThreshold` | `uint256` | The minimum number of selection needed |
### WrongPlainSecret
:::note References
- Specification details: [**LSP-11-BasicSocialRecovery**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-11-BasicSocialRecovery.md#wrongplainsecret)
- Solidity implementation: [`LSP11BasicSocialRecovery.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp11-contracts/contracts/LSP11SocialRecovery.sol)
- Error signature: `WrongPlainSecret()`
- Error hash: `0x6fa723c3`
:::
```solidity
error WrongPlainSecret();
```
reverts when the plain secret produce a different hash than the secret hash originally set
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP14Ownable2Step
:::info Standard Specifications
[`LSP-14-Ownable2Step`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md)
:::
:::info Solidity implementation
[`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
:::
> LSP14Ownable2Step
This contract is a modified version of the [`OwnableUnset.sol`] implementation, where transferring and renouncing ownership works as a 2-step process. This can be used as a confirmation mechanism to prevent potential mistakes when transferring ownership of the contract, where the control of the contract could be lost forever. (_e.g: providing the wrong address as a parameter to the function, transferring ownership to an EOA for which the user lost its private key, etc..._)
## 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.
### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#renounce_ownership_confirmation_delay)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()`
- Function selector: `0xead3fbdf`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()
external
view
returns (uint256);
```
The number of block that MUST pass before one is able to confirm renouncing ownership.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------- |
| `0` | `uint256` | Number of blocks. |
### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#renounce_ownership_confirmation_period)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()`
- Function selector: `0x01bfba61`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()
external
view
returns (uint256);
```
The number of blocks during which one can renounce ownership.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------- |
| `0` | `uint256` | Number of blocks. |
### acceptOwnership
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#acceptownership)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `acceptOwnership()`
- Function selector: `0x79ba5097`
:::
```solidity
function acceptOwnership() external nonpayable;
```
_`msg.sender` is accepting ownership of contract: `address(this)`._
Transfer ownership of the contract from the current [`owner()`](#owner) to the [`pendingOwner()`](#pendingowner). Once this function is called:
- The current [`owner()`](#owner) will lose access to the functions restricted to the [`owner()`](#owner) only.
- The [`pendingOwner()`](#pendingowner) will gain access to the functions restricted to the [`owner()`](#owner) only.
**Requirements:**
- This function can only be called by the [`pendingOwner()`](#pendingowner).
### owner
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#owner)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### pendingOwner
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#pendingowner)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `pendingOwner()`
- Function selector: `0xe30c3978`
:::
:::info
If no ownership transfer is in progress, the pendingOwner will be `address(0).`.
:::
```solidity
function pendingOwner() external view returns (address);
```
The address that ownership of the contract is transferred to. This address may use [`acceptOwnership()`](#acceptownership) to gain ownership of the contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#renounceownership)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
:::danger
Leaves the contract without an owner. Once ownership of the contract has been renounced, any function that is restricted to be called only by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.
:::
```solidity
function renounceOwnership() external nonpayable;
```
_`msg.sender` is renouncing ownership of contract `address(this)`._
Renounce ownership of the contract in a 2-step process.
1. The first call will initiate the process of renouncing ownership.
2. The second call is used as a confirmation and will leave the contract without an owner.
### transferOwnership
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#transferownership)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
function transferOwnership(address newOwner) external nonpayable;
```
_Transfer ownership initiated by `newOwner`._
Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the [`universalReceiver()`](#universalreceiver) function on the `newOwner` contract.
**Requirements:**
- `newOwner` cannot accept ownership of the contract in the same transaction. (For instance, via a callback from its [`universalReceiver(...)`](#universalreceiver) function).
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------------------------- |
| `newOwner` | `address` | The address of the new owner. |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_transferOwnership
```solidity
function _transferOwnership(address newOwner) internal nonpayable;
```
Set the pending owner of the contract and cancel any renounce ownership process that was previously started.
**Requirements:**
- `newOwner` cannot be the address of the contract itself.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------- |
| `newOwner` | `address` | The address of the new pending owner. |
### \_acceptOwnership
```solidity
function _acceptOwnership() internal nonpayable;
```
Set the pending owner of the contract as the new owner.
### \_renounceOwnership
```solidity
function _renounceOwnership() internal nonpayable;
```
Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed.
## Events
### OwnershipRenounced
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#ownershiprenounced)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Event signature: `OwnershipRenounced()`
- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce`
:::
```solidity
event OwnershipRenounced();
```
_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._
Emitted when the ownership of the contract has been renounced.
### OwnershipTransferStarted
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#ownershiptransferstarted)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Event signature: `OwnershipTransferStarted(address,address)`
- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700`
:::
```solidity
event OwnershipTransferStarted(
address indexed previousOwner,
address indexed newOwner
);
```
_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._
Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------- |
| `previousOwner` **`indexed`** | `address` | The address of the previous owner. |
| `newOwner` **`indexed`** | `address` | The address of the new owner. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#ownershiptransferred)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### RenounceOwnershipStarted
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#renounceownershipstarted)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Event signature: `RenounceOwnershipStarted()`
- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7`
:::
```solidity
event RenounceOwnershipStarted();
```
_Ownership renouncement initiated._
Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process.
## Errors
### LSP14CallerNotPendingOwner
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#lsp14callernotpendingowner)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Error signature: `LSP14CallerNotPendingOwner(address)`
- Error hash: `0x451e4528`
:::
```solidity
error LSP14CallerNotPendingOwner(address caller);
```
Reverts when the `caller` that is trying to accept ownership of the contract is not the pending owner.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `caller` | `address` | The address that tried to accept ownership. |
### LSP14CannotTransferOwnershipToSelf
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#lsp14cannottransferownershiptoself)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Error signature: `LSP14CannotTransferOwnershipToSelf()`
- Error hash: `0xe052a6f8`
:::
```solidity
error LSP14CannotTransferOwnershipToSelf();
```
_Cannot transfer ownership to the address of the contract itself._
Reverts when trying to transfer ownership to the `address(this)`.
### LSP14MustAcceptOwnershipInSeparateTransaction
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#lsp14mustacceptownershipinseparatetransaction)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()`
- Error hash: `0x5758dd07`
:::
```solidity
error LSP14MustAcceptOwnershipInSeparateTransaction();
```
_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._
Reverts when pending owner accept ownership in the same transaction of transferring ownership.
### LSP14NotInRenounceOwnershipInterval
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#lsp14notinrenounceownershipinterval)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Error signature: `LSP14NotInRenounceOwnershipInterval(uint256,uint256)`
- Error hash: `0x1b080942`
:::
```solidity
error LSP14NotInRenounceOwnershipInterval(
uint256 renounceOwnershipStart,
uint256 renounceOwnershipEnd
);
```
_Cannot confirm ownership renouncement yet. The ownership renouncement is allowed from: `renounceOwnershipStart` until: `renounceOwnershipEnd`._
Reverts when trying to renounce ownership before the initial confirmation delay.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ----------------------------------------------------------------------- |
| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. |
| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-14-Ownable2Step**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md#ownablecallernottheowner)
- Solidity implementation: [`LSP14Ownable2Step.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP16UniversalFactory
:::info Standard Specifications
[`LSP-16-UniversalFactory`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md)
:::
:::info Solidity implementation
[`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
:::
> LSP16 Universal Factory
Factory contract to deploy different types of contracts using the CREATE2 opcode standardized as LSP16
- UniversalFactory: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md The UniversalFactory will be deployed using Nick's Factory (0x4e59b44847b379578588920ca78fbf26c0b4956c) The deployed address can be found in the LSP16 specification. Please refer to the LSP16 Specification to obtain the exact creation bytecode and salt that should be used to produce the address of the UniversalFactory on different chains. This factory contract is designed to deploy contracts at the same address on multiple chains. The UniversalFactory can deploy 2 types of contracts:
- non-initializable (normal deployment)
- initializable (external call after deployment, e.g: proxy contracts) The `providedSalt` parameter given by the deployer is not used directly as the salt by the CREATE2 opcode. Instead, it is used along with these parameters:
- `initializable` boolean
- `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`). These three parameters are concatenated together and hashed to generate the final salt for CREATE2. See [`generateSalt`](#generatesalt) function for more details. The constructor and `initializeCalldata` SHOULD NOT include any network-specific parameters (e.g: chain-id, a local token contract address), otherwise the deployed contract will not be recreated at the same address across different networks, thus defeating the purpose of the UniversalFactory. One way to solve this problem is to set an EOA owner in the `initializeCalldata`/constructor that can later call functions that set these parameters as variables in the contract. The UniversalFactory must be deployed at the same address on different chains to successfully deploy contracts at the same address across different chains.
## 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.
### computeAddress
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#computeaddress)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `computeAddress(bytes32,bytes32,bool,bytes)`
- Function selector: `0x3b315680`
:::
```solidity
function computeAddress(
bytes32 creationBytecodeHash,
bytes32 providedSalt,
bool initializable,
bytes initializeCalldata
) external view returns (address);
```
Computes the address of a contract to be deployed using CREATE2, based on the input parameters. Any change in one of these parameters will result in a different address. When the `initializable` boolean is set to `false`, `initializeCalldata` will not affect the function output.
#### Parameters
| Name | Type | Description |
| ---------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `creationBytecodeHash` | `bytes32` | The keccak256 hash of the creation bytecode to be deployed |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
| `initializable` | `bool` | A boolean that indicates whether an external call should be made to initialize the contract after deployment |
| `initializeCalldata` | `bytes` | The calldata to be executed on the created contract if `initializable` is set to `true` |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------- |
| `0` | `address` | The address where the contract will be deployed |
### computeERC1167Address
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#computeerc1167address)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `computeERC1167Address(address,bytes32,bool,bytes)`
- Function selector: `0xe888edcb`
:::
```solidity
function computeERC1167Address(
address implementationContract,
bytes32 providedSalt,
bool initializable,
bytes initializeCalldata
) external view returns (address);
```
Computes the address of an ERC1167 proxy contract based on the input parameters. Any change in one of these parameters will result in a different address. When the `initializable` boolean is set to `false`, `initializeCalldata` will not affect the function output.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `implementationContract` | `address` | The contract to create a clone of according to ERC1167 |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
| `initializable` | `bool` | A boolean that indicates whether an external call should be made to initialize the proxy contract after deployment |
| `initializeCalldata` | `bytes` | The calldata to be executed on the created contract if `initializable` is set to `true` |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------- |
| `0` | `address` | The address where the ERC1167 proxy contract will be deployed |
### deployCreate2
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#deploycreate2)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `deployCreate2(bytes,bytes32)`
- Function selector: `0x26736355`
:::
```solidity
function deployCreate2(
bytes creationBytecode,
bytes32 providedSalt
) external payable returns (address);
```
_Deploys a smart contract._
Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the [`computeAddress`](#computeaddress) function. This function deploys contracts without initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See [`generateSalt`](#generatesalt) function for more details. Using the same `creationBytecode` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address. If the constructor of the contract to deploy is payable, value can be sent to this function to fund the created contract. However, sending value to this function while the constructor is not payable will result in a revert.
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `creationBytecode` | `bytes` | The creation bytecode of the contract to be deployed |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------ |
| `0` | `address` | The address of the deployed contract |
### deployCreate2AndInitialize
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#deploycreate2andinitialize)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `deployCreate2AndInitialize(bytes,bytes32,bytes,uint256,uint256)`
- Function selector: `0xcdbd473a`
:::
```solidity
function deployCreate2AndInitialize(
bytes creationBytecode,
bytes32 providedSalt,
bytes initializeCalldata,
uint256 constructorMsgValue,
uint256 initializeCalldataMsgValue
) external payable returns (address);
```
_Deploys a smart contract and initializes it._
Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the [`computeAddress`](#computeaddress) function. This function deploys contracts with initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`. See [`generateSalt`](#generatesalt) function for more details. Using the same `creationBytecode`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address. If the constructor or the initialize function of the contract to deploy is payable, value can be sent along with the deployment/initialization to fund the created contract. However, sending value to this function while the constructor/initialize function is not payable will result in a revert. Will revert if the `msg.value` sent to the function is not equal to the sum of `constructorMsgValue` and `initializeCalldataMsgValue`.
#### Parameters
| Name | Type | Description |
| ---------------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `creationBytecode` | `bytes` | The creation bytecode of the contract to be deployed |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
| `initializeCalldata` | `bytes` | The calldata to be executed on the created contract |
| `constructorMsgValue` | `uint256` | The value sent to the contract during deployment |
| `initializeCalldataMsgValue` | `uint256` | The value sent to the contract during initialization |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------ |
| `0` | `address` | The address of the deployed contract |
### deployERC1167Proxy
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#deployerc1167proxy)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `deployERC1167Proxy(address,bytes32)`
- Function selector: `0x49d8abed`
:::
```solidity
function deployERC1167Proxy(
address implementationContract,
bytes32 providedSalt
) external nonpayable returns (address);
```
_Deploys a proxy smart contract._
Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the [`computeERC1167Address`](#computeerc1167address) function. This function deploys contracts without initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See [`generateSalt`](#generatesalt) function for more details. Using the same `implementationContract` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address. Sending value to the contract created is not possible since the constructor of the ERC1167 minimal proxy is not payable.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `implementationContract` | `address` | The contract address to use as the base implementation behind the proxy that will be deployed |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The address of the minimal proxy deployed |
### deployERC1167ProxyAndInitialize
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#deployerc1167proxyandinitialize)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `deployERC1167ProxyAndInitialize(address,bytes32,bytes)`
- Function selector: `0x5340165f`
:::
```solidity
function deployERC1167ProxyAndInitialize(
address implementationContract,
bytes32 providedSalt,
bytes initializeCalldata
) external payable returns (address);
```
_Deploys a proxy smart contract and initializes it._
Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the [`computeERC1167Address`](#computeerc1167address) function. This function deploys contracts with initialization (external call after deployment). The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`. See [`generateSalt`](#generatesalt) function for more details. Using the same `implementationContract`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address. If the initialize function of the contract to deploy is payable, value can be sent along to fund the created contract while initializing. However, sending value to this function while the initialize function is not payable will result in a revert.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `implementationContract` | `address` | The contract address to use as the base implementation behind the proxy that will be deployed |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
| `initializeCalldata` | `bytes` | The calldata to be executed on the created contract |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The address of the minimal proxy deployed |
### generateSalt
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#generatesalt)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Function signature: `generateSalt(bytes32,bool,bytes)`
- Function selector: `0x1a17ccbf`
:::
```solidity
function generateSalt(
bytes32 providedSalt,
bool initializable,
bytes initializeCalldata
) external pure returns (bytes32);
```
Generates the salt used to deploy the contract by hashing the following parameters (concatenated together) with keccak256:
1. the `providedSalt`
2. the `initializable` boolean
3. the `initializeCalldata`, only if the contract is initializable (the `initializable` boolean is set to `true`)
- The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is used along with these parameters:
1. `initializable` boolean
2. `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`).
- This approach ensures that in order to reproduce an initializable contract at the same address on another chain, not only the `providedSalt` is required to be the same, but also the initialize parameters within the `initializeCalldata` must also be the same. This maintains consistent deployment behaviour. Users are required to initialize contracts with the same parameters across different chains to ensure contracts are deployed at the same address across different chains.
1. Example (for initializable contracts)
- For an existing contract A on chain 1 owned by X, to replicate the same contract at the same address with the same owner X on chain 2, the salt used to generate the address should include the initializeCalldata that assigns X as the owner of contract A.
- For instance, if another user, Y, tries to deploy the contract at the same address on chain 2 using the same providedSalt, but with a different initializeCalldata to make Y the owner instead of X, the generated address would be different, preventing Y from deploying the contract with different ownership at the same address.
- However, for non-initializable contracts, if the constructor has arguments that specify the deployment behavior, they will be included in the creation bytecode. Any change in the constructor arguments will lead to a different contract's creation bytecode which will result in a different address on other chains.
2. Example (for non-initializable contracts)
- If a contract is deployed with specific constructor arguments on chain 1, these arguments are embedded within the creation bytecode. For instance, if contract B is deployed with a specific `tokenName` and `tokenSymbol` on chain 1, and a user wants to deploy the same contract with the same `tokenName` and `tokenSymbol` on chain 2, they must use the same constructor arguments to produce the same creation bytecode. This ensures that the same deployment behaviour is maintained across different chains, as long as the same creation bytecode is used.
- If another user Z, tries to deploy the same contract B at the same address on chain 2 using the same `providedSalt` but different constructor arguments (a different `tokenName` and/or `tokenSymbol`), the generated address will be different. This prevents user Z from deploying the contract with different constructor arguments at the same address on chain 2.
- The providedSalt was hashed to produce the salt used by CREATE2 opcode to prevent users from deploying initializable contracts using non-initializable functions such as [`deployCreate2`](#deploycreate2) without having the initialization call.
- In other words, if the providedSalt was not hashed and was used as it is as the salt by the CREATE2 opcode, malicious users can check the generated salt used for the already deployed initializable contract on chain 1, and deploy the contract from [`deployCreate2`](#deploycreate2) function on chain 2, with passing the generated salt of the deployed contract as providedSalt that will produce the same address but without the initialization, where the malicious user can initialize after.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `providedSalt` | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment |
| `initializable` | `bool` | The Boolean that specifies if the contract must be initialized or not |
| `initializeCalldata` | `bytes` | The calldata to be executed on the created contract if `initializable` is set to `true` |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------ |
| `0` | `bytes32` | The generated salt which will be used for CREATE2 deployment |
## 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.
### \_verifyCallResult
```solidity
function _verifyCallResult(bool success, bytes returndata) internal pure;
```
Verifies that the contract created was initialized correctly.
Bubble the revert reason if present, revert with `ContractInitializationFailed` otherwise.
## Events
### ContractCreated
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#contractcreated)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Event signature: `ContractCreated(address,bytes32,bytes32,bool,bytes)`
- Event topic hash: `0x8872a323d65599f01bf90dc61c94b4e0cc8e2347d6af4122fccc3e112ee34a84`
:::
```solidity
event ContractCreated(
address indexed createdContract,
bytes32 indexed providedSalt,
bytes32 generatedSalt,
bool indexed initialized,
bytes initializeCalldata
);
```
_Contract created. Contract address: `createdContract`._
Emitted whenever a contract is created.
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `createdContract` **`indexed`** | `address` | The address of the contract created. |
| `providedSalt` **`indexed`** | `bytes32` | The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment. |
| `generatedSalt` | `bytes32` | The salt used by the `CREATE2` opcode for contract deployment. |
| `initialized` **`indexed`** | `bool` | The Boolean that specifies if the contract must be initialized or not. |
| `initializeCalldata` | `bytes` | The bytes provided as initializeCalldata (Empty string when `initialized` is set to false). |
## Errors
### ContractInitializationFailed
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#contractinitializationfailed)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Error signature: `ContractInitializationFailed()`
- Error hash: `0xc1ee8543`
:::
```solidity
error ContractInitializationFailed();
```
_Couldn't initialize the contract._
Reverts when there is no revert reason bubbled up by the created contract when initializing
### InvalidValueSum
:::note References
- Specification details: [**LSP-16-UniversalFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md#invalidvaluesum)
- Solidity implementation: [`LSP16UniversalFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp16-contracts/contracts/LSP16UniversalFactory.sol)
- Error signature: `InvalidValueSum()`
- Error hash: `0x2fd9ca91`
:::
```solidity
error InvalidValueSum();
```
Reverts when `msg.value` sent to [`deployCreate2AndInitialize(..)`](#deploycreate2andinitialize) function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP17Extendable
:::info Standard Specifications
[`LSP-17-ContractExtension`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md)
:::
:::info Solidity implementation
[`LSP17Extendable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol)
:::
> Module to add more functionalities to a contract using extensions.
Implementation of the `fallback(...)` logic according to LSP17
- Contract Extension standard. This module can be inherited to extend the functionality of the parent contract when calling a function that doesn't exist on the parent contract via forwarding the call to an extension mapped to the function selector being called, set originally by the parent contract
## 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.
### supportsInterface
:::note References
- Specification details: [**LSP-17-ContractExtension**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#supportsinterface)
- Solidity implementation: [`LSP17Extendable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
## 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.
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension mapped to a specific function selector
If no extension was found, return the address(0)
To be overridden.
Up to the implementer contract to return an extension based on a function selector
### \_fallbackLSP17Extendable
:::tip Hint
This function does not forward to the extension contract the `msg.value` received by the contract that inherits `LSP17Extendable`.
If you would like to forward the `msg.value` to the extension contract, you can override the code of this internal function as follow:
```solidity
(bool success, bytes memory result) = extension.call{value: msg.value}(
abi.encodePacked(callData, msg.sender, msg.value)
);
```
:::
```solidity
function _fallbackLSP17Extendable(
bytes callData
) internal nonpayable returns (bytes);
```
Forwards the call to an extension mapped to a function selector.
Calls [`_getExtensionAndForwardValue`](#_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.
Forwards the value if the extension is payable.
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`](#msg.sender) and 32 bytes of the `msg.value`.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP17Extension
:::info Standard Specifications
[`LSP-17-ContractExtension`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md)
:::
:::info Solidity implementation
[`LSP17Extension.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol)
:::
> Module to create a contract that can act as an extension.
Implementation of the extension logic according to LSP17ContractExtension. This module can be inherited to provide context of the msg variable related to the extendable contract
## 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.
### VERSION
:::note References
- Specification details: [**LSP-17-ContractExtension**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#version)
- Solidity implementation: [`LSP17Extension.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### supportsInterface
:::note References
- Specification details: [**LSP-17-ContractExtension**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#supportsinterface)
- Solidity implementation: [`LSP17Extension.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
## 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.
### \_extendableMsgData
```solidity
function _extendableMsgData() internal view returns (bytes);
```
Returns the original `msg.data` passed to the extendable contract
without the appended `msg.sender` and `msg.value`.
### \_extendableMsgSender
```solidity
function _extendableMsgSender() internal view returns (address);
```
Returns the original `msg.sender` calling the extendable contract.
### \_extendableMsgValue
```solidity
function _extendableMsgValue() internal view returns (uint256);
```
Returns the original `msg.value` sent to the extendable contract.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# Extension4337
:::info Standard Specifications
[`LSP-17-Extensions`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md)
:::
:::info Solidity implementation
[`Extension4337.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp17-contracts/contracts/Extension4337.sol)
:::
## 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
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#constructor)
- Solidity implementation: [`Extension4337.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp17-contracts/contracts/Extension4337.sol)
:::
```solidity
constructor(address entryPoint_);
```
#### Parameters
| Name | Type | Description |
| ------------- | :-------: | ----------- |
| `entryPoint_` | `address` | - |
### VERSION
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#version)
- Solidity implementation: [`Extension4337.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp17-contracts/contracts/Extension4337.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### entryPoint
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#entrypoint)
- Solidity implementation: [`Extension4337.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp17-contracts/contracts/Extension4337.sol)
- Function signature: `entryPoint()`
- Function selector: `0xb0d691fe`
:::
```solidity
function entryPoint() external view returns (address);
```
Get the address of the Entry Point contract that will execute the user operation.
#### Returns
| Name | Type | Description |
| ---- | :-------: | -------------------------------------- |
| `0` | `address` | The address of the EntryPoint contract |
### supportsInterface
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#supportsinterface)
- Solidity implementation: [`Extension4337.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp17-contracts/contracts/Extension4337.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### validateUserOp
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#validateuserop)
- Solidity implementation: [`Extension4337.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp17-contracts/contracts/Extension4337.sol)
- Function signature: `validateUserOp(UserOperation,bytes32,uint256)`
- Function selector: `0xe86fc51e`
:::
:::info
In addition to the logic of the `IAccount` interface from 4337, the permissions of the address that signed the user operation are checked to ensure that it has the permission `_4337_PERMISSION`.
:::
```solidity
function validateUserOp(
UserOperation userOp,
bytes32 userOpHash,
uint256
) external nonpayable returns (uint256);
```
Validate user's signature and nonce. The entryPoint will make the call to the recipient only if this validation call returns successfully. Signature failure should be reported by returning `SIG_VALIDATION_FAILED` (`1`). This allows making a "simulation call" without a valid signature. Other failures (_e.g. nonce mismatch, or invalid signature format_) should still revert to signal failure. The third parameter (not mentioned but `missingAccountFunds` from the `IAccount` interface) describes the missing funds on the account's deposit in the entrypoint. This is the minimum amount to transfer to the sender(entryPoint) to be able to make the call. The excess is left as a deposit in the entrypoint, for future calls. Can be withdrawn anytime using "entryPoint.withdrawTo()" In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero.
**Requirements:**
- caller MUST be the **entrypoint contract**.
- the signature and nonce must be valid.
#### Parameters
| Name | Type | Description |
| ------------ | :-------------: | ----------- |
| `userOp` | `UserOperation` | - |
| `userOpHash` | `bytes32` | - |
| `_2` | `uint256` | - |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0` | `uint256` | validationData packaged ValidationData structure. use `_packValidationData` and `_unpackValidationData` to encode and decode - `<20-byte>` sigAuthorizer - 0 for valid signature, 1 to mark signature failure, otherwise, an address of an "authorizer" contract. - `<6-byte>` validUntil - last timestamp this operation is valid. 0 for "indefinite" - `<6-byte>` validAfter - first timestamp this operation is valid If an account doesn't use time-range, it is enough to return SIG_VALIDATION_FAILED value (1) for signature failure. Note that the validation code cannot use block.timestamp (or block.number) directly. |
## 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.
### \_extendableMsgData
```solidity
function _extendableMsgData() internal view returns (bytes);
```
Returns the original `msg.data` passed to the extendable contract
without the appended `msg.sender` and `msg.value`.
### \_extendableMsgSender
```solidity
function _extendableMsgSender() internal view returns (address);
```
Returns the original `msg.sender` calling the extendable contract.
### \_extendableMsgValue
```solidity
function _extendableMsgValue() internal view returns (uint256);
```
Returns the original `msg.value` sent to the extendable contract.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# OnERC721ReceivedExtension
:::info Standard Specifications
[`LSP-17-Extensions`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md)
:::
:::info Solidity implementation
[`OnERC721ReceivedExtension.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp17-contracts/contracts/OnERC721ReceivedExtension.sol)
:::
LSP17 Extension that can be attached to a LSP17Extendable contract to allow it to receive ERC721 tokens via `safeTransferFrom`.
## 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.
### VERSION
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#version)
- Solidity implementation: [`OnERC721ReceivedExtension.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp17-contracts/contracts/OnERC721ReceivedExtension.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### onERC721Received
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#onerc721received)
- Solidity implementation: [`OnERC721ReceivedExtension.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp17-contracts/contracts/OnERC721ReceivedExtension.sol)
- Function signature: `onERC721Received(address,address,uint256,bytes)`
- Function selector: `0x150b7a02`
:::
```solidity
function onERC721Received(
address,
address,
uint256,
bytes
) external nonpayable returns (bytes4);
```
See [`IERC721Receiver-onERC721Received`](#ierc721receiver-onerc721received). Always returns `IERC721Receiver.onERC721Received.selector`.
#### Parameters
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `_0` | `address` | - |
| `_1` | `address` | - |
| `_2` | `uint256` | - |
| `_3` | `bytes` | - |
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `bytes4` | - |
### supportsInterface
:::note References
- Specification details: [**LSP-17-Extensions**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#supportsinterface)
- Solidity implementation: [`OnERC721ReceivedExtension.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp17-contracts/contracts/OnERC721ReceivedExtension.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
## 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.
### \_extendableMsgData
```solidity
function _extendableMsgData() internal view returns (bytes);
```
Returns the original `msg.data` passed to the extendable contract
without the appended `msg.sender` and `msg.value`.
### \_extendableMsgSender
```solidity
function _extendableMsgSender() internal view returns (address);
```
Returns the original `msg.sender` calling the extendable contract.
### \_extendableMsgValue
```solidity
function _extendableMsgValue() internal view returns (uint256);
```
Returns the original `msg.value` sent to the extendable contract.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP1UniversalReceiverDelegateUP
:::info Standard Specifications
[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md)
:::
:::info Solidity implementation
[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
:::
> Implementation of a UniversalReceiverDelegate for the [LSP-0-ERC725Account]
The [`LSP1UniversalReceiverDelegateUP`](#lsp1universalreceiverdelegateup) follows the [LSP-1-UniversalReceiver] standard and is designed for [LSP-0-ERC725Account] contracts. The [`LSP1UniversalReceiverDelegateUP`](#lsp1universalreceiverdelegateup) is a contract called by the [`universalReceiver(...)`](#universalreceiver) function of the [LSP-0-ERC725Account] contract that:
- Writes the data keys representing assets received from type [LSP-7-DigitalAsset] and [LSP-8-IdentifiableDigitalAsset] into the account storage, and removes them when the balance is zero according to the [LSP-5-ReceivedAssets] Standard.
- Writes the data keys representing the owned vaults from type [LSP-9-Vault] into your account storage, and removes them when transferring ownership to other accounts according to the [LSP-10-ReceivedVaults] Standard.
## 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.
### VERSION
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#version)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### supportsInterface
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### universalReceiverDelegate
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiverdelegate)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Function signature: `universalReceiverDelegate(address,uint256,bytes32,bytes)`
- Function selector: `0xa245bbda`
:::
:::info
- If some issues occurred with generating the `dataKeys` or `dataValues` the `returnedMessage` will be an error message, otherwise it will be empty.
- If an error occurred when trying to use `setDataBatch(dataKeys,dataValues)`, it will return the raw error data back to the caller.
:::
:::caution Warning
When the data stored in the ERC725Y storage of the LSP0 contract is corrupted (\_e.g: ([LSP-5-ReceivedAssets]'s Array length not 16 bytes long, the token received is already registered in `LSP5ReceivetAssets[]`, the token being sent is not sent as full balance, etc...), the function call will still pass and return (**not revert!**) and not modify any data key on the storage of the [LSP-0-ERC725Account].
:::
```solidity
function universalReceiverDelegate(
address notifier,
uint256,
bytes32 typeId,
bytes
) external nonpayable returns (bytes);
```
_Reacted on received notification with `typeId`._
1. Writes the data keys of the received [LSP-7-DigitalAsset], [LSP-8-IdentifiableDigitalAsset] and [LSP-9-Vault] contract addresses into the account storage according to the [LSP-5-ReceivedAssets] and [LSP-10-ReceivedVaults] Standard.
2. The data keys representing an asset/vault are cleared when the asset/vault is no longer owned by the account.
**Requirements:**
- This contract should be allowed to use the [`setDataBatch(...)`](#setdatabatch) function in order to update the LSP5 and LSP10 Data Keys.
- Cannot accept native tokens
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ---------------------------------------------- |
| `notifier` | `address` | - |
| `_1` | `uint256` | - |
| `typeId` | `bytes32` | Unique identifier for a specific notification. |
| `_3` | `bytes` | - |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ---------------------------------------- |
| `0` | `bytes` | The result of the reaction for `typeId`. |
## 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.
### \_tokenSender
```solidity
function _tokenSender(address notifier) internal nonpayable returns (bytes);
```
Handler for LSP7 and LSP8 token sender type id.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------- |
| `notifier` | `address` | The LSP7 or LSP8 token address. |
### \_tokenRecipient
```solidity
function _tokenRecipient(
address notifier,
bytes4 interfaceId
) internal nonpayable returns (bytes);
```
Handler for LSP7 and LSP8 token recipient type id.
#### Parameters
| Name | Type | Description |
| ------------- | :-------: | ------------------------------- |
| `notifier` | `address` | The LSP7 or LSP8 token address. |
| `interfaceId` | `bytes4` | The LSP7 or LSP8 interface id. |
### \_vaultSender
```solidity
function _vaultSender(address notifier) internal nonpayable returns (bytes);
```
Handler for LSP9 vault sender type id.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------------------- |
| `notifier` | `address` | The LSP9 vault address. |
### \_vaultRecipient
```solidity
function _vaultRecipient(address notifier) internal nonpayable returns (bytes);
```
Handler for LSP9 vault recipient type id.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------------------- |
| `notifier` | `address` | The LSP9 vault address. |
### \_setDataBatchWithoutReverting
:::info
If an the low-level transaction revert, the returned data will be forwarded. Th contract that uses this function can use the `Address` library to revert with the revert reason.
:::
```solidity
function _setDataBatchWithoutReverting(
bytes32[] dataKeys,
bytes[] dataValues
) internal nonpayable returns (bytes);
```
Calls `bytes4(keccak256(setDataBatch(bytes32[],bytes[])))` without checking for `bool success`, but it returns all the data back.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------- |
| `dataKeys` | `bytes32[]` | Data Keys to be set. |
| `dataValues` | `bytes[]` | Data Values to be set. |
## Errors
### CannotRegisterEOAsAsAssets
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Error signature: `CannotRegisterEOAsAsAssets(address)`
- Error hash: `0xa5295345`
:::
```solidity
error CannotRegisterEOAsAsAssets(address caller);
```
_EOA: `caller` cannot be registered as an asset._
Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ---------------------- |
| `caller` | `address` | The address of the EOA |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP1UniversalReceiverDelegateVault
:::info Standard Specifications
[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md)
:::
:::info Solidity implementation
[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
:::
> Implementation of a UniversalReceiverDelegate for the [LSP9Vault]
The [`LSP1UniversalReceiverDelegateVault`](#lsp1universalreceiverdelegatevault) follows the [LSP-1-UniversalReceiver] standard and is designed for [LSP9Vault] contracts. The [`LSP1UniversalReceiverDelegateVault`](#lsp1universalreceiverdelegatevault) is a contract called by the [`universalReceiver(...)`](#universalreceiver) function of the [LSP-9-Vault] contract that:
- Writes the data keys representing assets received from type [LSP-7-DigitalAsset] and [LSP-8-IdentifiableDigitalAsset] into the account storage, and removes them when the balance is zero according to the [LSP-5-ReceivedAssets] Standard.
## 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.
### VERSION
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#version)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### supportsInterface
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### universalReceiverDelegate
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiverdelegate)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Function signature: `universalReceiverDelegate(address,uint256,bytes32,bytes)`
- Function selector: `0xa245bbda`
:::
:::info
- If some issues occurred with generating the `dataKeys` or `dataValues` the `returnedMessage` will be an error message, otherwise it will be empty.
- If an error occurred when trying to use `setDataBatch(dataKeys,dataValues)`, it will return the raw error data back to the caller.
:::
```solidity
function universalReceiverDelegate(
address notifier,
uint256,
bytes32 typeId,
bytes
) external nonpayable returns (bytes);
```
_Reacted on received notification with `typeId`._
Handles two cases: Writes the received [LSP-7-DigitalAsset] or [LSP-8-IdentifiableDigitalAsset] assets into the vault storage according to the [LSP-5-ReceivedAssets] standard.
**Requirements:**
- Cannot accept native tokens.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ---------------------------------------------- |
| `notifier` | `address` | - |
| `_1` | `uint256` | - |
| `typeId` | `bytes32` | Unique identifier for a specific notification. |
| `_3` | `bytes` | - |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ---------------------------------------- |
| `0` | `bytes` | The result of the reaction for `typeId`. |
## 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.
### \_tokenSender
```solidity
function _tokenSender(address notifier) internal nonpayable returns (bytes);
```
Handler for LSP7 and LSP8 token sender type id.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------- |
| `notifier` | `address` | The LSP7 or LSP8 token address. |
### \_tokenRecipient
```solidity
function _tokenRecipient(
address notifier,
bytes4 interfaceId
) internal nonpayable returns (bytes);
```
Handler for LSP7 and LSP8 token recipient type id.
#### Parameters
| Name | Type | Description |
| ------------- | :-------: | ------------------------------- |
| `notifier` | `address` | The LSP7 or LSP8 token address. |
| `interfaceId` | `bytes4` | The LSP7 or LSP8 interface id. |
### \_setDataBatchWithoutReverting
:::info
If an the low-level transaction revert, the returned data will be forwarded. Th contract that uses this function can use the `Address` library to revert with the revert reason.
:::
```solidity
function _setDataBatchWithoutReverting(
bytes32[] dataKeys,
bytes[] dataValues
) internal nonpayable returns (bytes);
```
Calls `bytes4(keccak256(setDataBatch(bytes32[],bytes[])))` without checking for `bool success`, but it returns all the data back.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------- |
| `dataKeys` | `bytes32[]` | Data Keys to be set. |
| `dataValues` | `bytes[]` | Data Values to be set. |
## Errors
### CannotRegisterEOAsAsAssets
:::note References
- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
- Error signature: `CannotRegisterEOAsAsAssets(address)`
- Error hash: `0xa5295345`
:::
```solidity
error CannotRegisterEOAsAsAssets(address caller);
```
_EOA: `caller` cannot be registered as an asset._
Reverts when EOA calls the [`universalReceiver(..)`](#universalreceiver) function with an asset/vault typeId.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ---------------------- |
| `caller` | `address` | The address of the EOA |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP20CallVerification
:::info Standard Specifications
[`LSP-20-CallVerification`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-20-CallVerification.md)
:::
:::info Solidity implementation
[`LSP20CallVerification.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol)
:::
> Implementation of a contract calling the verification functions according to LSP20 - Call Verification standard.
Module to be inherited used to verify the execution of functions according to a verifier address. Verification can happen before or after execution based on a returnedStatus.
## 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.
### \_verifyCall
```solidity
function _verifyCall(
address logicVerifier
) internal nonpayable returns (bool verifyAfter);
```
Calls [`lsp20VerifyCall`](#lsp20verifycall) function on the logicVerifier.
### \_verifyCallResult
```solidity
function _verifyCallResult(
address logicVerifier,
bytes callResult
) internal nonpayable;
```
Calls [`lsp20VerifyCallResult`](#lsp20verifycallresult) function on the logicVerifier.
### \_revertWithLSP20DefaultError
```solidity
function _revertWithLSP20DefaultError(
bool postCall,
bytes returnedData
) internal pure;
```
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# IPostDeploymentModule
:::info Standard Specifications
[`LSP-23-LinkedContractsDeployment`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md)
:::
:::info Solidity implementation
[`IPostDeploymentModule.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/IPostDeploymentModule.sol)
:::
## 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.
### executePostDeployment
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#executepostdeployment)
- Solidity implementation: [`IPostDeploymentModule.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/IPostDeploymentModule.sol)
- Function signature: `executePostDeployment(address,address,bytes)`
- Function selector: `0x28c4d14e`
:::
```solidity
function executePostDeployment(
address primaryContract,
address secondaryContract,
bytes calldataToPostDeploymentModule
) external nonpayable;
```
_This function can be used to perform any additional setup or configuration after the primary and secondary contracts have been deployed._
Executes post-deployment logic for the primary and secondary contracts.
#### Parameters
| Name | Type | Description |
| -------------------------------- | :-------: | -------------------------------------------------------- |
| `primaryContract` | `address` | The address of the deployed primary contract. |
| `secondaryContract` | `address` | The address of the deployed secondary contract. |
| `calldataToPostDeploymentModule` | `bytes` | Calldata to be passed for the post-deployment execution. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP23LinkedContractsFactory
:::info Standard Specifications
[`LSP-23-LinkedContractsDeployment`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md)
:::
:::info Solidity implementation
[`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
:::
## 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.
### computeAddresses
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#computeaddresses)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `computeAddresses(ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)`
- Function selector: `0xdecfb0b9`
:::
```solidity
function computeAddresses(
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
view
returns (address primaryContractAddress, address secondaryContractAddress);
```
#### Parameters
| Name | Type | Description |
| ------------------------------ | :--------------------------------------------------------: | ----------- |
| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | - |
| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | - |
| `postDeploymentModule` | `address` | - |
| `postDeploymentModuleCalldata` | `bytes` | - |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ----------- |
| `primaryContractAddress` | `address` | - |
| `secondaryContractAddress` | `address` | - |
### computeERC1167Addresses
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#computeerc1167addresses)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `computeERC1167Addresses(ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)`
- Function selector: `0x8da85898`
:::
```solidity
function computeERC1167Addresses(
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
view
returns (address primaryContractAddress, address secondaryContractAddress);
```
#### Parameters
| Name | Type | Description |
| --------------------------------- | :------------------------------------------------------------: | ----------- |
| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | - |
| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | - |
| `postDeploymentModule` | `address` | - |
| `postDeploymentModuleCalldata` | `bytes` | - |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ----------- |
| `primaryContractAddress` | `address` | - |
| `secondaryContractAddress` | `address` | - |
### deployContracts
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deploycontracts)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `deployContracts(ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)`
- Function selector: `0xf830c0ab`
:::
```solidity
function deployContracts(
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
payable
returns (address primaryContractAddress, address secondaryContractAddress);
```
#### Parameters
| Name | Type | Description |
| ------------------------------ | :--------------------------------------------------------: | ----------- |
| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | - |
| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | - |
| `postDeploymentModule` | `address` | - |
| `postDeploymentModuleCalldata` | `bytes` | - |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ----------- |
| `primaryContractAddress` | `address` | - |
| `secondaryContractAddress` | `address` | - |
### deployERC1167Proxies
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deployerc1167proxies)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `deployERC1167Proxies(ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)`
- Function selector: `0x17c042c4`
:::
```solidity
function deployERC1167Proxies(
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
payable
returns (address primaryContractAddress, address secondaryContractAddress);
```
#### Parameters
| Name | Type | Description |
| --------------------------------- | :------------------------------------------------------------: | ----------- |
| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | - |
| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | - |
| `postDeploymentModule` | `address` | - |
| `postDeploymentModuleCalldata` | `bytes` | - |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ----------- |
| `primaryContractAddress` | `address` | - |
| `secondaryContractAddress` | `address` | - |
## 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.
### \_deployPrimaryContract
```solidity
function _deployPrimaryContract(struct ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal nonpayable returns (address primaryContractAddress);
```
### \_deploySecondaryContract
```solidity
function _deploySecondaryContract(struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address primaryContractAddress) internal nonpayable returns (address secondaryContractAddress);
```
### \_deployAndInitializePrimaryContractProxy
```solidity
function _deployAndInitializePrimaryContractProxy(struct ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal nonpayable returns (address primaryContractAddress);
```
### \_deployAndInitializeSecondaryContractProxy
```solidity
function _deployAndInitializeSecondaryContractProxy(struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address primaryContractAddress) internal nonpayable returns (address secondaryContractAddress);
```
### \_generatePrimaryContractSalt
```solidity
function _generatePrimaryContractSalt(struct ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal pure returns (bytes32 primaryContractGeneratedSalt);
```
### \_generatePrimaryContractProxySalt
```solidity
function _generatePrimaryContractProxySalt(struct ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal pure returns (bytes32 primaryContractProxyGeneratedSalt);
```
## Events
### DeployedContracts
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deployedcontracts)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Event signature: `DeployedContracts(address,address,ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)`
- Event topic hash: `0x1ea27dabd8fd1508e844ab51c2fd3d9081f2684346857f9187da6d4a1aa7d3e6`
:::
```solidity
event DeployedContracts(address indexed primaryContract, address indexed secondaryContract, ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata);
```
Emitted when a primary and secondary contract are deployed.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :--------------------------------------------------------: | ------------------------------------------------------ |
| `primaryContract` **`indexed`** | `address` | Address of the deployed primary contract. |
| `secondaryContract` **`indexed`** | `address` | Address of the deployed secondary contract. |
| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | Parameters used for the primary contract deployment. |
| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | Parameters used for the secondary contract deployment. |
| `postDeploymentModule` | `address` | Address of the post-deployment module. |
| `postDeploymentModuleCalldata` | `bytes` | Calldata passed to the post-deployment module. |
### DeployedERC1167Proxies
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deployederc1167proxies)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Event signature: `DeployedERC1167Proxies(address,address,ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)`
- Event topic hash: `0xb03dbe7a02c063899f863d542410b5b038c8f537045be3a26e7144e0074e1c7b`
:::
```solidity
event DeployedERC1167Proxies(address indexed primaryContract, address indexed secondaryContract, ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata);
```
Emitted when proxies of a primary and secondary contract are deployed.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :------------------------------------------------------------: | ------------------------------------------------------------ |
| `primaryContract` **`indexed`** | `address` | Address of the deployed primary contract proxy. |
| `secondaryContract` **`indexed`** | `address` | Address of the deployed secondary contract proxy. |
| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | Parameters used for the primary contract proxy deployment. |
| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | Parameters used for the secondary contract proxy deployment. |
| `postDeploymentModule` | `address` | Address of the post-deployment module. |
| `postDeploymentModuleCalldata` | `bytes` | Calldata passed to the post-deployment module. |
## Errors
### InvalidValueSum
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#invalidvaluesum)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Error signature: `InvalidValueSum()`
- Error hash: `0x2fd9ca91`
:::
```solidity
error InvalidValueSum();
```
_Invalid value sent._
Reverts when the `msg.value` sent is not equal to the sum of value used for the deployment of the contract & its owner contract.
### PrimaryContractProxyInitFailureError
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#primarycontractproxyinitfailureerror)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Error signature: `PrimaryContractProxyInitFailureError(bytes)`
- Error hash: `0x4364b6ee`
:::
```solidity
error PrimaryContractProxyInitFailureError(bytes errorData);
```
_Failed to deploy & initialise the Primary Contract Proxy. Error: `errorData`._
Reverts when the deployment & initialisation of the contract has failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `errorData` | `bytes` | Potentially information about why the deployment & initialisation have failed. |
### SecondaryContractProxyInitFailureError
:::note References
- Specification details: [**LSP-23-LinkedContractsDeployment**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#secondarycontractproxyinitfailureerror)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Error signature: `SecondaryContractProxyInitFailureError(bytes)`
- Error hash: `0x9654a854`
:::
```solidity
error SecondaryContractProxyInitFailureError(bytes errorData);
```
_Failed to deploy & initialise the Secondary Contract Proxy. Error: `errorData`._
Reverts when the deployment & initialisation of the secondary contract has failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `errorData` | `bytes` | Potentially information about why the deployment & initialisation have failed. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# IPostDeploymentModule
:::info Standard Specifications
[`LSP-23-LinkedContractsFactory`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md)
:::
:::info Solidity implementation
[`IPostDeploymentModule.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
:::
## 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.
### executePostDeployment
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#executepostdeployment)
- Solidity implementation: [`IPostDeploymentModule.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `executePostDeployment(address,address,bytes)`
- Function selector: `0x28c4d14e`
:::
```solidity
function executePostDeployment(
address primaryContract,
address secondaryContract,
bytes calldataToPostDeploymentModule
) external nonpayable;
```
_This function can be used to perform any additional setup or configuration after the primary and secondary contracts have been deployed._
Executes post-deployment logic for the primary and secondary contracts.
#### Parameters
| Name | Type | Description |
| -------------------------------- | :-------: | -------------------------------------------------------- |
| `primaryContract` | `address` | The address of the deployed primary contract. |
| `secondaryContract` | `address` | The address of the deployed secondary contract. |
| `calldataToPostDeploymentModule` | `bytes` | Calldata to be passed for the post-deployment execution. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP23LinkedContractsFactory
:::info Standard Specifications
[`LSP-23-LinkedContractsFactory`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md)
:::
:::info Solidity implementation
[`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
:::
## 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.
### computeAddresses
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#computeaddresses)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `computeAddresses(ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)`
- Function selector: `0xdecfb0b9`
:::
```solidity
function computeAddresses(
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
view
returns (address primaryContractAddress, address secondaryContractAddress);
```
Computes the addresses of a primary contract and a secondary linked contract
#### Parameters
| Name | Type | Description |
| ------------------------------ | :--------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | Contains the needed parameter to deploy the primary contract. (`salt`, `fundingAmount`, `creationBytecode`) |
| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | Contains the needed parameter to deploy the secondary contract. (`fundingAmount`, `creationBytecode`, `addPrimaryContractAddress`, `extraConstructorParams`) |
| `postDeploymentModule` | `address` | The optional module to be executed after deployment |
| `postDeploymentModuleCalldata` | `bytes` | The data to be passed to the post deployment module |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------- |
| `primaryContractAddress` | `address` | The address of the deployed primary contract. |
| `secondaryContractAddress` | `address` | The address of the deployed secondary contract. |
### computeERC1167Addresses
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#computeerc1167addresses)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `computeERC1167Addresses(ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)`
- Function selector: `0x8da85898`
:::
```solidity
function computeERC1167Addresses(
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
view
returns (address primaryContractAddress, address secondaryContractAddress);
```
Computes the addresses of a primary and a secondary linked contracts ERC1167 proxies to be created
#### Parameters
| Name | Type | Description |
| --------------------------------- | :------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | Contains the needed parameters to deploy a primary proxy contract. (`salt`, `fundingAmount`, `implementationContract`, `initializationCalldata`) |
| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | Contains the needed parameters to deploy the secondary proxy contract. (`fundingAmount`, `implementationContract`, `initializationCalldata`, `addPrimaryContractAddress`, `extraInitializationParams`) |
| `postDeploymentModule` | `address` | The optional module to be executed after deployment. |
| `postDeploymentModuleCalldata` | `bytes` | The data to be passed to the post deployment module. |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------- |
| `primaryContractAddress` | `address` | The address of the deployed primary contract proxy |
| `secondaryContractAddress` | `address` | The address of the deployed secondary contract proxy |
### deployContracts
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deploycontracts)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `deployContracts(ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)`
- Function selector: `0xf830c0ab`
:::
```solidity
function deployContracts(
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
payable
returns (address primaryContractAddress, address secondaryContractAddress);
```
_Contracts deployed. Contract Address: `primaryContractAddress`. Primary Contract Address: `primaryContractAddress`_
Deploys a primary and a secondary linked contract.
#### Parameters
| Name | Type | Description |
| ------------------------------ | :--------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | Contains the needed parameter to deploy a contract. (`salt`, `fundingAmount`, `creationBytecode`) |
| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | Contains the needed parameter to deploy the secondary contract. (`fundingAmount`, `creationBytecode`, `addPrimaryContractAddress`, `extraConstructorParams`) |
| `postDeploymentModule` | `address` | The optional module to be executed after deployment |
| `postDeploymentModuleCalldata` | `bytes` | The data to be passed to the post deployment module |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------- |
| `primaryContractAddress` | `address` | The address of the primary contract. |
| `secondaryContractAddress` | `address` | The address of the secondary contract. |
### deployERC1167Proxies
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deployerc1167proxies)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Function signature: `deployERC1167Proxies(ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)`
- Function selector: `0x17c042c4`
:::
```solidity
function deployERC1167Proxies(
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
)
external
payable
returns (address primaryContractAddress, address secondaryContractAddress);
```
_Contract proxies deployed. Primary Proxy Address: `primaryContractAddress`. Secondary Contract Proxy Address: `secondaryContractAddress`_
Deploys ERC1167 proxies of a primary contract and a secondary linked contract
#### Parameters
| Name | Type | Description |
| --------------------------------- | :------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | Contains the needed parameters to deploy a proxy contract. (`salt`, `fundingAmount`, `implementationContract`, `initializationCalldata`) |
| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | Contains the needed parameters to deploy the secondary proxy contract. (`fundingAmount`, `implementationContract`, `initializationCalldata`, `addPrimaryContractAddress`, `extraInitializationParams`) |
| `postDeploymentModule` | `address` | The optional module to be executed after deployment. |
| `postDeploymentModuleCalldata` | `bytes` | The data to be passed to the post deployment module. |
#### Returns
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------- |
| `primaryContractAddress` | `address` | The address of the deployed primary contract proxy |
| `secondaryContractAddress` | `address` | The address of the deployed secondary contract proxy |
## 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.
### \_deployPrimaryContract
```solidity
function _deployPrimaryContract(struct ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal nonpayable returns (address primaryContractAddress);
```
### \_deploySecondaryContract
```solidity
function _deploySecondaryContract(struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address primaryContractAddress) internal nonpayable returns (address secondaryContractAddress);
```
### \_deployAndInitializePrimaryContractProxy
```solidity
function _deployAndInitializePrimaryContractProxy(struct ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal nonpayable returns (address primaryContractAddress);
```
### \_deployAndInitializeSecondaryContractProxy
```solidity
function _deployAndInitializeSecondaryContractProxy(struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address primaryContractAddress) internal nonpayable returns (address secondaryContractAddress);
```
### \_generatePrimaryContractSalt
```solidity
function _generatePrimaryContractSalt(struct ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment, struct ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal pure returns (bytes32 primaryContractGeneratedSalt);
```
### \_generatePrimaryContractProxySalt
```solidity
function _generatePrimaryContractProxySalt(struct ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit, struct ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit, address postDeploymentModule, bytes postDeploymentModuleCalldata) internal pure returns (bytes32 primaryContractProxyGeneratedSalt);
```
## Events
### DeployedContracts
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deployedcontracts)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Event signature: `DeployedContracts(address,address,ILSP23LinkedContractsFactory.PrimaryContractDeployment,ILSP23LinkedContractsFactory.SecondaryContractDeployment,address,bytes)`
- Event topic hash: `0x1ea27dabd8fd1508e844ab51c2fd3d9081f2684346857f9187da6d4a1aa7d3e6`
:::
```solidity
event DeployedContracts(
address indexed primaryContract,
address indexed secondaryContract,
ILSP23LinkedContractsFactory.PrimaryContractDeployment primaryContractDeployment,
ILSP23LinkedContractsFactory.SecondaryContractDeployment secondaryContractDeployment,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
);
```
Emitted when a primary and secondary contract are deployed.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :--------------------------------------------------------: | ------------------------------------------------------ |
| `primaryContract` **`indexed`** | `address` | Address of the deployed primary contract. |
| `secondaryContract` **`indexed`** | `address` | Address of the deployed secondary contract. |
| `primaryContractDeployment` | `ILSP23LinkedContractsFactory.PrimaryContractDeployment` | Parameters used for the primary contract deployment. |
| `secondaryContractDeployment` | `ILSP23LinkedContractsFactory.SecondaryContractDeployment` | Parameters used for the secondary contract deployment. |
| `postDeploymentModule` | `address` | Address of the post-deployment module. |
| `postDeploymentModuleCalldata` | `bytes` | Calldata passed to the post-deployment module. |
### DeployedERC1167Proxies
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#deployederc1167proxies)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Event signature: `DeployedERC1167Proxies(address,address,ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit,ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit,address,bytes)`
- Event topic hash: `0xb03dbe7a02c063899f863d542410b5b038c8f537045be3a26e7144e0074e1c7b`
:::
```solidity
event DeployedERC1167Proxies(
address indexed primaryContract,
address indexed secondaryContract,
ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit primaryContractDeploymentInit,
ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit secondaryContractDeploymentInit,
address postDeploymentModule,
bytes postDeploymentModuleCalldata
);
```
Emitted when proxies of a primary and secondary contract are deployed.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :------------------------------------------------------------: | ------------------------------------------------------------ |
| `primaryContract` **`indexed`** | `address` | Address of the deployed primary contract proxy. |
| `secondaryContract` **`indexed`** | `address` | Address of the deployed secondary contract proxy. |
| `primaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.PrimaryContractDeploymentInit` | Parameters used for the primary contract proxy deployment. |
| `secondaryContractDeploymentInit` | `ILSP23LinkedContractsFactory.SecondaryContractDeploymentInit` | Parameters used for the secondary contract proxy deployment. |
| `postDeploymentModule` | `address` | Address of the post-deployment module. |
| `postDeploymentModuleCalldata` | `bytes` | Calldata passed to the post-deployment module. |
## Errors
### InvalidValueSum
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#invalidvaluesum)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Error signature: `InvalidValueSum()`
- Error hash: `0x2fd9ca91`
:::
```solidity
error InvalidValueSum();
```
_Invalid value sent._
Reverts when the `msg.value` sent is not equal to the sum of value used for the deployment of the contract & its owner contract.
### PrimaryContractProxyInitFailureError
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#primarycontractproxyinitfailureerror)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Error signature: `PrimaryContractProxyInitFailureError(bytes)`
- Error hash: `0x4364b6ee`
:::
```solidity
error PrimaryContractProxyInitFailureError(bytes errorData);
```
_Failed to deploy & initialize the Primary Contract Proxy. Error: `errorData`._
Reverts when the deployment & initialization of the contract has failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `errorData` | `bytes` | Potentially information about why the deployment & initialization have failed. |
### SecondaryContractProxyInitFailureError
:::note References
- Specification details: [**LSP-23-LinkedContractsFactory**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#secondarycontractproxyinitfailureerror)
- Solidity implementation: [`LSP23LinkedContractsFactory.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol)
- Error signature: `SecondaryContractProxyInitFailureError(bytes)`
- Error hash: `0x9654a854`
:::
```solidity
error SecondaryContractProxyInitFailureError(bytes errorData);
```
_Failed to deploy & initialize the Secondary Contract Proxy. Error: `errorData`._
Reverts when the deployment & initialization of the secondary contract has failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `errorData` | `bytes` | Potentially information about why the deployment & initialization have failed. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP25MultiChannelNonce
:::info Standard Specifications
[`LSP-25-ExecuteRelayCall`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-25-ExecuteRelayCall.md)
:::
:::info Solidity implementation
[`LSP25MultiChannelNonce.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp25-contracts/contracts/ILSP25ExecuteRelayCall.sol)
:::
> Implementation of the multi channel nonce and the signature verification defined in the LSP25 standard.
This contract can be used as a backbone for other smart contracts to implement meta-transactions via the LSP25 Execute Relay Call interface. It contains a storage of nonces for signer addresses across various channel IDs, enabling these signers to submit signed transactions that order-independent. (transactions that do not need to be submitted one after the other in a specific order). Finally, it contains internal functions to verify signatures for specific calldata according the signature format specified in the LSP25 standard.
## 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.
### \_getNonce
```solidity
function _getNonce(
address from,
uint128 channelId
) internal view returns (uint256 idx);
```
Read the nonce for a `from` address on a specific `channelId`.
This will return an `idx`, which is the concatenation of two `uint128` as follow:
1. the `channelId` where the nonce was queried for.
2. the actual nonce of the given `channelId`.
For example, if on `channelId` number `5`, the latest nonce is `1`, the `idx` returned by this function will be:
```
// in decimals = 1701411834604692317316873037158841057281
idx = 0x0000000000000000000000000000000500000000000000000000000000000001
```
This idx can be described as follow:
```
channelId => 5 nonce in this channel => 1
v------------------------------v-------------------------------v
0x0000000000000000000000000000000500000000000000000000000000000001
```
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `from` | `address` | The address to read the nonce for. |
| `channelId` | `uint128` | The channel in which to extract the nonce. |
#### Returns
| Name | Type | Description |
| ----- | :-------: | ---------------------------------------------------------------------------------------------------------------------- |
| `idx` | `uint256` | The idx composed of two `uint128`: the channelId + nonce in channel concatenated together in a single `uint256` value. |
### \_recoverSignerFromLSP25Signature
```solidity
function _recoverSignerFromLSP25Signature(
bytes signature,
uint256 nonce,
uint256 validityTimestamps,
uint256 msgValue,
bytes callData
) internal view returns (address);
```
Recover the address of the signer that generated a `signature` using the parameters provided `nonce`, `validityTimestamps`, `msgValue` and `callData`.
The address of the signer will be recovered using the LSP25 signature format.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signature` | `bytes` | A 65 bytes long signature generated according to the signature format specified in the LSP25 standard. |
| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. |
| `validityTimestamps` | `uint256` | The validity timestamp that the signer used to generate the signature (See [`_verifyValidityTimestamps`](#_verifyvaliditytimestamps) to learn more). |
| `msgValue` | `uint256` | The amount of native tokens intended to be sent for the relay transaction. |
| `callData` | `bytes` | The calldata to execute as a relay transaction that the signer signed for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | -------------------------------------------------------- |
| `0` | `address` | The address that signed, recovered from the `signature`. |
### \_verifyValidityTimestamps
```solidity
function _verifyValidityTimestamps(uint256 validityTimestamps) internal view;
```
Verify that the current timestamp is within the date and time range provided by `validityTimestamps`.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, |
### \_isValidNonce
```solidity
function _isValidNonce(address from, uint256 idx) internal view returns (bool);
```
Verify that the nonce `_idx` for `_from` (obtained via [`getNonce`](#getnonce)) is valid in its channel ID.
The "idx" is a 256bits (unsigned) integer, where:
- the 128 leftmost bits = channelId
- and the 128 rightmost bits = nonce within the channel
#### Parameters
| Name | Type | Description |
| ------ | :-------: | ---------------------------------------------------------------------------- |
| `from` | `address` | The signer's address. |
| `idx` | `uint256` | The concatenation of the `channelId` + `nonce` within a specific channel ID. |
#### Returns
| Name | Type | Description |
| ---- | :----: | ------------------------------------------------------------------------ |
| `0` | `bool` | true if the nonce is the latest nonce for the `signer`, false otherwise. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP4DigitalAssetMetadata
:::info Standard Specifications
[`LSP-4-DigitalAsset-Metadata`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md)
:::
:::info Solidity implementation
[`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
:::
> Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store.
Standard Implementation of the LSP4 standard.
## 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.
### getData
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#getdata)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#getdatabatch)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### owner
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#owner)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#renounceownership)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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.
### setData
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#setdata)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#setdatabatch)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#supportsinterface)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### transferOwnership
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#transferownership)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
via this function once the digital asset contract has been deployed.
## Events
### DataChanged
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#datachanged)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#ownershiptransferred)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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.
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#ownablecallernottheowner)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-4-DigitalAsset-Metadata**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP6KeyManager
:::info Standard Specifications
[`LSP-6-KeyManager`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md)
:::
:::info Solidity implementation
[`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
:::
> Implementation of a contract acting as a controller of an ERC725 Account, using permissions stored in the ERC725Y storage.
All the permissions can be set on the ERC725 Account using `setData(bytes32,bytes)` or `setData(bytes32[],bytes[])`.
## 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
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#constructor)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
:::
```solidity
constructor(address target_);
```
_Deploying a LSP6KeyManager linked to the contract at address `target_`._
Deploy a Key Manager and set the `target_` address in the contract storage, making this Key Manager linked to this `target_` contract.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------ |
| `target_` | `address` | The address of the contract to control and forward calldata payloads to. |
### VERSION
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#version)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### execute
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#execute)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `execute(bytes)`
- Function selector: `0x09c5eabe`
:::
```solidity
function execute(bytes payload) external payable returns (bytes);
```
_Executing the following payload on the linked contract: `payload`_
Execute A `payload` on the linked [`target`](#target) contract after having verified the permissions associated with the function being run. The `payload` MUST be a valid abi-encoded function call of one of the functions present in the linked [`target`](#target), otherwise the call will fail. The linked [`target`](#target) will return some data on successful execution, or revert on failure.
**Emitted events:**
- [`PermissionsVerified`](#permissionsverified) event when the permissions related to `payload` have been verified successfully.
#### Parameters
| Name | Type | Description |
| --------- | :-----: | --------------------------------------------------------------------------- |
| `payload` | `bytes` | The abi-encoded function call to execute on the linked [`target`](#target). |
#### Returns
| Name | Type | Description |
| ---- | :-----: | --------------------------------------------------------------------------------------- |
| `0` | `bytes` | The abi-decoded data returned by the function called on the linked [`target`](#target). |
### executeBatch
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#executebatch)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `executeBatch(uint256[],bytes[])`
- Function selector: `0xbf0176ff`
:::
```solidity
function executeBatch(
uint256[] values,
bytes[] payloads
) external payable returns (bytes[]);
```
\*Executing the following batch of payloads and sensind on the linked contract.
- payloads: `payloads`
- values transferred for each payload: `values`\*
Same as [`execute`](#execute) but execute a batch of payloads (abi-encoded function calls) in a single transaction.
**Emitted events:**
- [`PermissionsVerified`](#permissionsverified) event for each permissions related to each `payload` that have been verified successfully.
#### Parameters
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------------------------------------------------------------- |
| `values` | `uint256[]` | An array of amount of native tokens to be transferred for each `payload`. |
| `payloads` | `bytes[]` | An array of abi-encoded function calls to execute successively on the linked [`target`](#target). |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------------------------------------------ |
| `0` | `bytes[]` | An array of abi-decoded data returned by the functions called on the linked [`target`](#target). |
### executeRelayCall
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#executerelaycall)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `executeRelayCall(bytes,uint256,uint256,bytes)`
- Function selector: `0x4c8a4e74`
:::
:::tip Hint
If you are looking to learn how to sign and execute relay transactions via the Key Manager, see our Javascript step by step guide [_"Execute Relay Transactions"_](../../../learn/universal-profile/key-manager/execute-relay-transactions.md). See the LSP6 Standard page for more details on how to [generate a valid signature for Execute Relay Call](/standards/access-control/lsp6-key-manager.md#how-to-sign-relay-transactions).
:::
```solidity
function executeRelayCall(
bytes signature,
uint256 nonce,
uint256 validityTimestamps,
bytes payload
) external payable returns (bytes);
```
_Executing the following payload given the nonce `nonce` and signature `signature`. Payload: `payload`_
Allows any address (executor) to execute a payload (= abi-encoded function call), given they have a valid signature from a signer address and a valid `nonce` for this signer. The signature MUST be generated according to the signature format defined by the LSP25 standard. The signer that generated the `signature` MUST be a controller with some permissions on the linked [`target`](#target). The `payload` will be executed on the [`target`](#target) contract once the LSP25 signature and the permissions of the signer have been verified.
**Emitted events:**
- [`PermissionsVerified`](#permissionsverified) event when the permissions related to `payload` have been verified successfully.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signature` | `bytes` | A 65 bytes long signature for a meta transaction according to LSP25. |
| `nonce` | `uint256` | The nonce of the address that signed the calldata (in a specific `_channel`), obtained via [`getNonce`](#getnonce). Used to prevent replay attack. |
| `validityTimestamps` | `uint256` | Two `uint128` timestamps concatenated together that describes when the relay transaction is valid "from" (left `uint128`) and "until" as a deadline (right `uint128`). |
| `payload` | `bytes` | The abi-encoded function call to execute. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ------------------------------------------------- |
| `0` | `bytes` | The data being returned by the function executed. |
### executeRelayCallBatch
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#executerelaycallbatch)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `executeRelayCallBatch(bytes[],uint256[],uint256[],uint256[],bytes[])`
- Function selector: `0xa20856a5`
:::
```solidity
function executeRelayCallBatch(
bytes[] signatures,
uint256[] nonces,
uint256[] validityTimestamps,
uint256[] values,
bytes[] payloads
) external payable returns (bytes[]);
```
_Executing a batch of relay calls (= meta-transactions)._
Same as [`executeRelayCall`](#executerelaycall) but execute a batch of signed calldata payloads (abi-encoded function calls) in a single transaction. The `signatures` can be from multiple controllers, not necessarely the same controller, as long as each of these controllers that signed have the right permissions related to the calldata `payload` they signed.
**Requirements:**
- the length of `signatures`, `nonces`, `validityTimestamps`, `values` and `payloads` MUST be the same.
- the value sent to this function (`msg.value`) MUST be equal to the sum of all `values` in the batch. There should not be any excess value sent to this function.
#### Parameters
| Name | Type | Description |
| -------------------- | :---------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `signatures` | `bytes[]` | An array of 65 bytes long signatures for meta transactions according to LSP25. |
| `nonces` | `uint256[]` | An array of nonces of the addresses that signed the calldata payloads (in specific channels). Obtained via [`getNonce`](#getnonce). Used to prevent replay attack. |
| `validityTimestamps` | `uint256[]` | An array of two `uint128` concatenated timestamps that describe when the relay transaction is valid "from" (left `uint128`) and "until" (right `uint128`). |
| `values` | `uint256[]` | An array of amount of native tokens to be transferred for each calldata `payload`. |
| `payloads` | `bytes[]` | An array of abi-encoded function calls to be executed successively. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ---------------------------------------------------------------- |
| `0` | `bytes[]` | An array of abi-decoded data returned by the functions executed. |
### getNonce
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#getnonce)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `getNonce(address,uint128)`
- Function selector: `0xb44581d9`
:::
:::tip Hint
A signer can choose its channel number arbitrarily. The recommended practice is to:
- use `channelId == 0` for transactions for which the ordering of execution matters.abi _Example: you have two transactions A and B, and transaction A must be executed first and complete successfully before transaction B should be executed)._
- use any other `channelId` number for transactions that you want to be order independent (out-of-order execution, execution _"in parallel"_). \_Example: you have two transactions A and B. You want transaction B to be executed a) without having to wait for transaction A to complete, or b) regardless if transaction A completed successfully or not.
:::
```solidity
function getNonce(
address from,
uint128 channelId
) external view returns (uint256);
```
_Reading the latest nonce of address `from` in the channel ID `channelId`._
Get the nonce for a specific `from` address that can be used for signing relay transactions via [`executeRelayCall`](#executerelaycall).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | -------------------------------------------------------------------------- |
| `from` | `address` | The address of the signer of the transaction. |
| `channelId` | `uint128` | The channel id that the signer wants to use for executing the transaction. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | -------------------------------------------- |
| `0` | `uint256` | The current nonce on a specific `channelId`. |
### isValidSignature
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#isvalidsignature)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `isValidSignature(bytes32,bytes)`
- Function selector: `0x1626ba7e`
:::
:::caution Warning
This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP6KeyManager and prevent signatures from the same EOA to be replayed across different LSP6KeyManager.
:::
```solidity
function isValidSignature(
bytes32 dataHash,
bytes signature
) external view returns (bytes4 returnedStatus);
```
Checks if a signature was signed by a controller that has the permission `SIGN`. If the signer is a controller with the permission `SIGN`, it will return the ERC1271 success value.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------- |
| `dataHash` | `bytes32` | - |
| `signature` | `bytes` | Signature byte array associated with \_data |
#### Returns
| Name | Type | Description |
| ---------------- | :------: | ---------------------------------------------------- |
| `returnedStatus` | `bytes4` | `0x1626ba7e` on success, or `0xffffffff` on failure. |
### lsp20VerifyCall
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#lsp20verifycall)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `lsp20VerifyCall(address,address,address,uint256,bytes)`
- Function selector: `0xde928f14`
:::
:::tip Hint
This function can call by any other address than the [`target`](#`target`). This allows to verify permissions in a _"read-only"_ manner. Anyone can call this function to verify if the `caller` has the right permissions to perform the abi-encoded function call `data` on the [`target`](#`target`) contract (while sending `msgValue` alongside the call). If the permissions have been verified successfully and `caller` is authorized, one of the following two LSP20 success value will be returned:
- `0x1a238000`: LSP20 success value **without** post verification (last byte is `0x00`).
- `0x1a238001`: LSP20 success value **with** post-verification (last byte is `0x01`).
:::
```solidity
function lsp20VerifyCall(
address,
address targetContract,
address caller,
uint256 msgValue,
bytes callData
) external nonpayable returns (bytes4);
```
#### Parameters
| Name | Type | Description |
| ---------------- | :-------: | ------------------------------------------------------------- |
| `_0` | `address` | - |
| `targetContract` | `address` | - |
| `caller` | `address` | The address who called the function on the `target` contract. |
| `msgValue` | `uint256` | - |
| `callData` | `bytes` | The calldata sent by the caller to the msg.sender |
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0` | `bytes4` | MUST return the first 3 bytes of `lsp20VerifyCall(address,uint256,bytes)` function selector if the call to the function is allowed, concatenated with a byte that determines if the lsp20VerifyCallResult function should be called after the original function call. The byte that invoke the lsp20VerifyCallResult function is strictly `0x01`. |
### lsp20VerifyCallResult
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#lsp20verifycallresult)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `lsp20VerifyCallResult(bytes32,bytes)`
- Function selector: `0xd3fc45d3`
:::
```solidity
function lsp20VerifyCallResult(
bytes32,
bytes
) external nonpayable returns (bytes4);
```
#### Parameters
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `_0` | `bytes32` | - |
| `_1` | `bytes` | - |
#### Returns
| Name | Type | Description |
| ---- | :------: | ---------------------------------------------------------------------------------------------- |
| `0` | `bytes4` | MUST return the lsp20VerifyCallResult function selector if the call to the function is allowed |
### supportsInterface
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#supportsinterface)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
See [`IERC165-supportsInterface`](#ierc165-supportsinterface).
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### target
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#target)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Function signature: `target()`
- Function selector: `0xd4b83992`
:::
```solidity
function target() external view returns (address);
```
Get The address of the contract linked to this Key Manager.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ---------------------------------- |
| `0` | `address` | The address of the linked contract |
## 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.
### \_verifyCanSetData
```solidity
function _verifyCanSetData(
address controlledContract,
address controllerAddress,
bytes32 controllerPermissions,
bytes32 inputDataKey,
bytes inputDataValue
) internal view;
```
verify if the `controllerAddress` has the permissions required to set a data key on the ERC725Y storage of the `controlledContract`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is set. |
| `controllerAddress` | `address` | the address of the controller who wants to set the data key. |
| `controllerPermissions` | `bytes32` | the permissions of the controller address. |
| `inputDataKey` | `bytes32` | the data key to set on the `controlledContract`. |
| `inputDataValue` | `bytes` | the data value to set for the `inputDataKey`. |
### \_verifyCanSetData
```solidity
function _verifyCanSetData(
address controlledContract,
address controller,
bytes32 permissions,
bytes32[] inputDataKeys,
bytes[] inputDataValues
) internal view;
```
verify if the `controllerAddress` has the permissions required to set an array of data keys on the ERC725Y storage of the `controlledContract`.
#### Parameters
| Name | Type | Description |
| -------------------- | :---------: | -------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is set. |
| `controller` | `address` | the address of the controller who wants to set the data key. |
| `permissions` | `bytes32` | the permissions of the controller address. |
| `inputDataKeys` | `bytes32[]` | an array of data keys to set on the `controlledContract`. |
| `inputDataValues` | `bytes[]` | an array of data values to set for the `inputDataKeys`. |
### \_getPermissionRequiredToSetDataKey
```solidity
function _getPermissionRequiredToSetDataKey(
address controlledContract,
bytes32 controllerPermissions,
bytes32 inputDataKey,
bytes inputDataValue
) internal view returns (bytes32);
```
retrieve the permission required based on the data key to be set on the `controlledContract`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. |
| `controllerPermissions` | `bytes32` | - |
| `inputDataKey` | `bytes32` | the data key to set on the `controlledContract`. Can be related to LSP6 Permissions, LSP1 Delegate or LSP17 Extensions. |
| `inputDataValue` | `bytes` | the data value to set for the `inputDataKey`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------------------------ |
| `0` | `bytes32` | the permission required to set the `inputDataKey` on the `controlledContract`. |
### \_getPermissionToSetPermissionsArray
```solidity
function _getPermissionToSetPermissionsArray(
address controlledContract,
bytes32 inputDataKey,
bytes inputDataValue,
bool hasBothAddControllerAndEditPermissions
) internal view returns (bytes32);
```
retrieve the permission required to update the `AddressPermissions[]` array data key defined in LSP6.
#### Parameters
| Name | Type | Description |
| ---------------------------------------- | :-------: | ----------------------------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. |
| `inputDataKey` | `bytes32` | either `AddressPermissions[]` (array length) or `AddressPermissions[index]` (array index) |
| `inputDataValue` | `bytes` | the updated value for the `inputDataKey`. MUST be: |
| `hasBothAddControllerAndEditPermissions` | `bool` | - |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------- |
| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. |
### \_getPermissionToSetControllerPermissions
```solidity
function _getPermissionToSetControllerPermissions(
address controlledContract,
bytes32 inputPermissionDataKey
) internal view returns (bytes32);
```
retrieve the permission required to set permissions for a controller address.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. |
| `inputPermissionDataKey` | `bytes32` | `AddressPermissions:Permissions:`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------- |
| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. |
### \_getPermissionToSetAllowedCalls
```solidity
function _getPermissionToSetAllowedCalls(
address controlledContract,
bytes32 dataKey,
bytes dataValue,
bool hasBothAddControllerAndEditPermissions
) internal view returns (bytes32);
```
Retrieve the permission required to set some AllowedCalls for a controller.
#### Parameters
| Name | Type | Description |
| ---------------------------------------- | :-------: | ------------------------------------------------------------------------------------------- |
| `controlledContract` | `address` | The address of the ERC725Y contract from which to fetch the value of `dataKey`. |
| `dataKey` | `bytes32` | A data key ion the format `AddressPermissions:AllowedCalls:`. |
| `dataValue` | `bytes` | The updated value for the `dataKey`. MUST be a bytes32[CompactBytesArray] of Allowed Calls. |
| `hasBothAddControllerAndEditPermissions` | `bool` | - |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------- |
| `0` | `bytes32` | Either ADD or EDIT PERMISSIONS. |
### \_getPermissionToSetAllowedERC725YDataKeys
```solidity
function _getPermissionToSetAllowedERC725YDataKeys(
address controlledContract,
bytes32 dataKey,
bytes dataValue,
bool hasBothAddControllerAndEditPermissions
) internal view returns (bytes32);
```
Retrieve the permission required to set some Allowed ERC725Y Data Keys for a controller.
#### Parameters
| Name | Type | Description |
| ---------------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract from which to fetch the value of `dataKey`. |
| `dataKey` | `bytes32` | A data key in the format `AddressPermissions:AllowedERC725YDataKeys:`. |
| `dataValue` | `bytes` | The updated value for the `dataKey`. MUST be a bytes[CompactBytesArray] of Allowed ERC725Y Data Keys. |
| `hasBothAddControllerAndEditPermissions` | `bool` | - |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------- |
| `0` | `bytes32` | Either ADD or EDIT PERMISSIONS. |
### \_getPermissionToSetLSP1Delegate
```solidity
function _getPermissionToSetLSP1Delegate(
address controlledContract,
bytes32 lsp1DelegateDataKey
) internal view returns (bytes32);
```
retrieve the permission required to either add or change the address
of a LSP1 Universal Receiver Delegate stored under a specific LSP1 data key.
#### Parameters
| Name | Type | Description |
| --------------------- | :-------: | -------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. |
| `lsp1DelegateDataKey` | `bytes32` | either the data key for the default `LSP1UniversalReceiverDelegate`, |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------- |
| `0` | `bytes32` | either ADD or CHANGE UNIVERSALRECEIVERDELEGATE. |
### \_getPermissionToSetLSP17Extension
```solidity
function _getPermissionToSetLSP17Extension(
address controlledContract,
bytes32 lsp17ExtensionDataKey
) internal view returns (bytes32);
```
Verify if `controller` has the required permissions to either add or change the address
of an LSP0 Extension stored under a specific LSP17Extension data key
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. |
| `lsp17ExtensionDataKey` | `bytes32` | the dataKey to set with `_LSP17_EXTENSION_PREFIX` as prefix. |
### \_verifyAllowedERC725YSingleKey
```solidity
function _verifyAllowedERC725YSingleKey(
address controllerAddress,
bytes32 inputDataKey,
bytes allowedERC725YDataKeysCompacted
) internal pure;
```
Verify if the `inputKey` is present in the list of `allowedERC725KeysCompacted` for the `controllerAddress`.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :-------: | ----------------------------------------------------------------------------------------- |
| `controllerAddress` | `address` | the address of the controller. |
| `inputDataKey` | `bytes32` | the data key to verify against the allowed ERC725Y Data Keys for the `controllerAddress`. |
| `allowedERC725YDataKeysCompacted` | `bytes` | a CompactBytesArray of allowed ERC725Y Data Keys for the `controllerAddress`. |
### \_verifyAllowedERC725YDataKeys
```solidity
function _verifyAllowedERC725YDataKeys(
address controllerAddress,
bytes32[] inputDataKeys,
bytes allowedERC725YDataKeysCompacted,
bool[] validatedInputKeysList,
uint256 allowedDataKeysFound
) internal pure;
```
Verify if all the `inputDataKeys` are present in the list of `allowedERC725KeysCompacted` of the `controllerAddress`.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :---------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `controllerAddress` | `address` | the address of the controller. |
| `inputDataKeys` | `bytes32[]` | the data keys to verify against the allowed ERC725Y Data Keys of the `controllerAddress`. |
| `allowedERC725YDataKeysCompacted` | `bytes` | a CompactBytesArray of allowed ERC725Y Data Keys of the `controllerAddress`. |
| `validatedInputKeysList` | `bool[]` | an array of booleans to store the result of the verification of each data keys checked. |
| `allowedDataKeysFound` | `uint256` | the number of data keys that were previously validated for other permissions like `ADDCONTROLLER`, `EDITPERMISSIONS`, etc... |
### \_requirePermissions
```solidity
function _requirePermissions(
address controller,
bytes32 addressPermissions,
bytes32 permissionRequired
) internal pure;
```
Check if the `controller` has the `permissionRequired` among its permission listed in `controllerPermissions`
If not, this function will revert with the error `NotAuthorised` and the name of the permission missing by the controller.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | --------------------------------- |
| `controller` | `address` | the caller address |
| `addressPermissions` | `bytes32` | the caller's permissions BitArray |
| `permissionRequired` | `bytes32` | the required permission |
### \_verifyCanExecute
```solidity
function _verifyCanExecute(
address controlledContract,
address controller,
bytes32 permissions,
uint256 operationType,
address to,
uint256 value,
bytes data
) internal view;
```
verify if `controllerAddress` has the required permissions to interact with other addresses using the controlledContract.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------- |
| `controlledContract` | `address` | the address of the ERC725 contract where the payload is executed and where the permissions are verified. |
| `controller` | `address` | the address who want to run the execute function on the ERC725Account. |
| `permissions` | `bytes32` | the permissions of the controller address. |
| `operationType` | `uint256` | - |
| `to` | `address` | - |
| `value` | `uint256` | - |
| `data` | `bytes` | - |
### \_verifyCanDeployContract
```solidity
function _verifyCanDeployContract(
address controller,
bytes32 permissions,
bool isFundingContract
) internal view;
```
### \_verifyCanStaticCall
```solidity
function _verifyCanStaticCall(
address controlledContract,
address controller,
bytes32 permissions,
address to,
uint256 value,
bytes data
) internal view;
```
### \_verifyCanCall
```solidity
function _verifyCanCall(
address controlledContract,
address controller,
bytes32 permissions,
address to,
uint256 value,
bytes data
) internal view;
```
### \_verifyAllowedCall
```solidity
function _verifyAllowedCall(
address controlledContract,
address controllerAddress,
uint256 operationType,
address to,
uint256 value,
bytes data
) internal view;
```
### \_extractCallType
```solidity
function _extractCallType(
uint256 operationType,
uint256 value,
bytes data
) internal pure returns (bytes4 requiredCallTypes);
```
extract the bytes4 representation of a single bit for the type of call according to the `operationType`
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | -------------------------------------------- |
| `operationType` | `uint256` | 0 = CALL, 3 = STATICCALL or 3 = DELEGATECALL |
| `value` | `uint256` | - |
| `data` | `bytes` | - |
#### Returns
| Name | Type | Description |
| ------------------- | :------: | --------------------------------------------------------- |
| `requiredCallTypes` | `bytes4` | a bytes4 value containing a single 1 bit for the callType |
### \_isAllowedAddress
```solidity
function _isAllowedAddress(
bytes allowedCall,
address to
) internal pure returns (bool);
```
### \_isAllowedStandard
```solidity
function _isAllowedStandard(
bytes allowedCall,
address to
) internal view returns (bool);
```
### \_isAllowedFunction
```solidity
function _isAllowedFunction(
bytes allowedCall,
bytes data
) internal pure returns (bool);
```
### \_isAllowedCallType
```solidity
function _isAllowedCallType(
bytes allowedCall,
bytes4 requiredCallTypes
) internal pure returns (bool);
```
### \_verifyExecuteRelayCallPermission
```solidity
function _verifyExecuteRelayCallPermission(
address controllerAddress,
bytes32 controllerPermissions
) internal pure;
```
### \_verifyOwnershipPermissions
```solidity
function _verifyOwnershipPermissions(
address controllerAddress,
bytes32 controllerPermissions
) internal pure;
```
### \_getNonce
```solidity
function _getNonce(
address from,
uint128 channelId
) internal view returns (uint256 idx);
```
Read the nonce for a `from` address on a specific `channelId`.
This will return an `idx`, which is the concatenation of two `uint128` as follow:
1. the `channelId` where the nonce was queried for.
2. the actual nonce of the given `channelId`.
For example, if on `channelId` number `5`, the latest nonce is `1`, the `idx` returned by this function will be:
```
// in decimals = 1701411834604692317316873037158841057281
idx = 0x0000000000000000000000000000000500000000000000000000000000000001
```
This idx can be described as follow:
```
channelId => 5 nonce in this channel => 1
v------------------------------v-------------------------------v
0x0000000000000000000000000000000500000000000000000000000000000001
```
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `from` | `address` | The address to read the nonce for. |
| `channelId` | `uint128` | The channel in which to extract the nonce. |
#### Returns
| Name | Type | Description |
| ----- | :-------: | ---------------------------------------------------------------------------------------------------------------------- |
| `idx` | `uint256` | The idx composed of two `uint128`: the channelId + nonce in channel concatenated together in a single `uint256` value. |
### \_recoverSignerFromLSP25Signature
```solidity
function _recoverSignerFromLSP25Signature(
bytes signature,
uint256 nonce,
uint256 validityTimestamps,
uint256 msgValue,
bytes callData
) internal view returns (address);
```
Recover the address of the signer that generated a `signature` using the parameters provided `nonce`, `validityTimestamps`, `msgValue` and `callData`.
The address of the signer will be recovered using the LSP25 signature format.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signature` | `bytes` | A 65 bytes long signature generated according to the signature format specified in the LSP25 standard. |
| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. |
| `validityTimestamps` | `uint256` | The validity timestamp that the signer used to generate the signature (See [`_verifyValidityTimestamps`](#_verifyvaliditytimestamps) to learn more). |
| `msgValue` | `uint256` | The amount of native tokens intended to be sent for the relay transaction. |
| `callData` | `bytes` | The calldata to execute as a relay transaction that the signer signed for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | -------------------------------------------------------- |
| `0` | `address` | The address that signed, recovered from the `signature`. |
### \_verifyValidityTimestamps
```solidity
function _verifyValidityTimestamps(uint256 validityTimestamps) internal view;
```
Verify that the current timestamp is within the date and time range provided by `validityTimestamps`.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, |
### \_isValidNonce
```solidity
function _isValidNonce(address from, uint256 idx) internal view returns (bool);
```
Verify that the nonce `_idx` for `_from` (obtained via [`getNonce`](#getnonce)) is valid in its channel ID.
The "idx" is a 256bits (unsigned) integer, where:
- the 128 leftmost bits = channelId
- and the 128 rightmost bits = nonce within the channel
#### Parameters
| Name | Type | Description |
| ------ | :-------: | ---------------------------------------------------------------------------- |
| `from` | `address` | The signer's address. |
| `idx` | `uint256` | The concatenation of the `channelId` + `nonce` within a specific channel ID. |
#### Returns
| Name | Type | Description |
| ---- | :----: | ------------------------------------------------------------------------ |
| `0` | `bool` | true if the nonce is the latest nonce for the `signer`, false otherwise. |
### \_execute
```solidity
function _execute(
uint256 msgValue,
bytes payload
) internal nonpayable returns (bytes);
```
### \_executeRelayCall
:::caution Warning
Be aware that this function can also throw an error if the `callData` was signed incorrectly (not conforming to the signature format defined in the LSP25 standard).
This is because the contract cannot distinguish if the data is signed correctly or not. Instead, it will recover an incorrect signer address from the signature
and throw an [`InvalidRelayNonce`](#invalidrelaynonce) error with the incorrect signer address as the first parameter.
:::
```solidity
function _executeRelayCall(
bytes signature,
uint256 nonce,
uint256 validityTimestamps,
uint256 msgValue,
bytes payload
) internal nonpayable returns (bytes);
```
Validate that the `nonce` given for the `signature` signed and the `payload` to execute is valid
and conform to the signature format according to the LSP25 standard.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `signature` | `bytes` | A valid signature for a signer, generated according to the signature format specified in the LSP25 standard. |
| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. |
| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, |
| `msgValue` | `uint256` | - |
| `payload` | `bytes` | The abi-encoded function call to execute. |
### \_executePayload
```solidity
function _executePayload(
address targetContract,
uint256 msgValue,
bytes payload
) internal nonpayable returns (bytes);
```
_Execute the `payload` passed to `execute(...)` or `executeRelayCall(...)`_
#### Parameters
| Name | Type | Description |
| ---------------- | :-------: | ----------------------------------------------------------------------------- |
| `targetContract` | `address` | - |
| `msgValue` | `uint256` | - |
| `payload` | `bytes` | The abi-encoded function call to execute on the [`target`](#target) contract. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ------------------------------------------------------------------------------------ |
| `0` | `bytes` | bytes The data returned by the call made to the linked [`target`](#target) contract. |
### \_verifyPermissions
```solidity
function _verifyPermissions(
address targetContract,
address from,
bool isRelayedCall,
bytes payload
) internal view;
```
Verify if the `from` address is allowed to execute the `payload` on the [`target`](#target) contract linked to this Key Manager.
#### Parameters
| Name | Type | Description |
| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `targetContract` | `address` | The contract that is owned by the Key Manager |
| `from` | `address` | Either the caller of [`execute`](#execute) or the signer of [`executeRelayCall`](#executerelaycall). |
| `isRelayedCall` | `bool` | - |
| `payload` | `bytes` | The abi-encoded function call to execute on the [`target`](#target) contract. |
### \_nonReentrantBefore
```solidity
function _nonReentrantBefore(
address targetContract,
bool isSetData,
address from
) internal nonpayable returns (bool reentrancyStatus);
```
Check if we are in the context of a reentrant call, by checking if the reentrancy status is `true`.
- If the status is `true`, the caller (or signer for relay call) MUST have the `REENTRANCY` permission. Otherwise, the call is reverted.
- If the status is `false`, it is set to `true` only if we are not dealing with a call to the functions `setData` or `setDataBatch`.
Used at the beginning of the [`lsp20VerifyCall`](#`lsp20verifycall`), [`_execute`](#`_execute`) and [`_executeRelayCall`](#`_executerelaycall`) functions, before the methods execution starts.
### \_nonReentrantAfter
```solidity
function _nonReentrantAfter(address targetContract) internal nonpayable;
```
Resets the reentrancy status to `false`
Used at the end of the [`lsp20VerifyCall`](#`lsp20verifycall`), [`_execute`](#`_execute`) and [`_executeRelayCall`](#`_executerelaycall`) functions after the functions' execution is terminated.
## Events
### PermissionsVerified
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#permissionsverified)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Event signature: `PermissionsVerified(address,uint256,bytes4)`
- Event topic hash: `0xc0a62328f6bf5e3172bb1fcb2019f54b2c523b6a48e3513a2298fbf0150b781e`
:::
```solidity
event PermissionsVerified(
address indexed signer,
uint256 indexed value,
bytes4 indexed selector
);
```
_Verified the permissions of `signer` for calling function `selector` on the linked account and sending `value` of native token._
Emitted when the LSP6KeyManager contract verified the permissions of the `signer` successfully.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signer` **`indexed`** | `address` | The address of the controller that executed the calldata payload (either directly via [`execute`](#execute) or via meta transaction using [`executeRelayCall`](#executerelaycall)). |
| `value` **`indexed`** | `uint256` | The amount of native token to be transferred in the calldata payload. |
| `selector` **`indexed`** | `bytes4` | The bytes4 function of the function that was executed on the linked [`target`](#target) |
## Errors
### BatchExecuteParamsLengthMismatch
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#batchexecuteparamslengthmismatch)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `BatchExecuteParamsLengthMismatch()`
- Error hash: `0x55a187db`
:::
```solidity
error BatchExecuteParamsLengthMismatch();
```
_The array parameters provided to the function `executeBatch(...)` do not have the same number of elements. (Different array param's length)._
Reverts when the array parameters `uint256[] value` and `bytes[] payload` have different sizes. There should be the same number of elements for each array parameters.
### BatchExecuteRelayCallParamsLengthMismatch
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#batchexecuterelaycallparamslengthmismatch)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `BatchExecuteRelayCallParamsLengthMismatch()`
- Error hash: `0xb4d50d21`
:::
```solidity
error BatchExecuteRelayCallParamsLengthMismatch();
```
_The array parameters provided to the function `executeRelayCallBatch(...)` do not have the same number of elements. (Different array param's length)._
Reverts when providing array parameters of different sizes to `executeRelayCallBatch(bytes[],uint256[],bytes[])`
### CallingKeyManagerNotAllowed
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#callingkeymanagernotallowed)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `CallingKeyManagerNotAllowed()`
- Error hash: `0xa431b236`
:::
```solidity
error CallingKeyManagerNotAllowed();
```
_Calling the Key Manager address for this transaction is disallowed._
Reverts when calling the KeyManager through `execute(uint256,address,uint256,bytes)`.
### DelegateCallDisallowedViaKeyManager
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#delegatecalldisallowedviakeymanager)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `DelegateCallDisallowedViaKeyManager()`
- Error hash: `0x80d6ebae`
:::
```solidity
error DelegateCallDisallowedViaKeyManager();
```
_Performing DELEGATE CALLS via the Key Manager is currently disallowed._
Reverts when trying to do a `delegatecall` via the ERC725X.execute(uint256,address,uint256,bytes) (operation type 4) function of the linked [`target`](#target). `DELEGATECALL` is disallowed by default on the LSP6KeyManager.
### ERC725X_ExecuteParametersEmptyArray
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#erc725x_executeparametersemptyarray)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `ERC725X_ExecuteParametersEmptyArray()`
- Error hash: `0xe9ad2b5f`
:::
```solidity
error ERC725X_ExecuteParametersEmptyArray();
```
Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array.
### ERC725X_ExecuteParametersLengthMismatch
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#erc725x_executeparameterslengthmismatch)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `ERC725X_ExecuteParametersLengthMismatch()`
- Error hash: `0x3ff55f4d`
:::
```solidity
error ERC725X_ExecuteParametersLengthMismatch();
```
Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### InvalidDataValuesForDataKeys
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invaliddatavaluesfordatakeys)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidDataValuesForDataKeys(bytes32,bytes)`
- Error hash: `0x1fa41397`
:::
```solidity
error InvalidDataValuesForDataKeys(bytes32 dataKey, bytes dataValue);
```
_Data value: `dataValue` length is different from the required length for the data key which is set._
Reverts when the data value length is not one of the required lengths for the specific data key.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------------------------------------------------------- |
| `dataKey` | `bytes32` | The data key that has a required length for the data value. |
| `dataValue` | `bytes` | The data value that has an invalid length. |
### InvalidERC725Function
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invaliderc725function)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidERC725Function(bytes4)`
- Error hash: `0x2ba8851c`
:::
```solidity
error InvalidERC725Function(bytes4 invalidFunction);
```
_The Key Manager could not verify the calldata of the transaction because it could not recognise the function being called. Invalid function selector: `invalidFunction`._
Reverts when trying to call a function on the linked [`target`](#target), that is not any of the following:
- `setData(bytes32,bytes)` (ERC725Y)
- `setDataBatch(bytes32[],bytes[])` (ERC725Y)
- `execute(uint256,address,uint256,bytes)` (ERC725X)
- `transferOwnership(address)` (LSP14)
- `acceptOwnership()` (LSP14)
- `renounceOwnership()` (LSP14)
#### Parameters
| Name | Type | Description |
| ----------------- | :------: | --------------------------------------------------------------------------------------------------------------------------- |
| `invalidFunction` | `bytes4` | The `bytes4` selector of the function that was attempted to be called on the linked [`target`](#target) but not recognised. |
### InvalidEncodedAllowedCalls
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invalidencodedallowedcalls)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidEncodedAllowedCalls(bytes)`
- Error hash: `0x187e77ab`
:::
```solidity
error InvalidEncodedAllowedCalls(bytes allowedCallsValue);
```
_Could not decode the Allowed Calls. Value = `allowedCallsValue`._
Reverts when `allowedCallsValue` is not properly encoded as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]` (CompactBytesArray made of tuples that are 32 bytes long each). See LSP2 value type `CompactBytesArray` for more infos.
#### Parameters
| Name | Type | Description |
| ------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------- |
| `allowedCallsValue` | `bytes` | The list of allowedCalls that are not encoded correctly as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]`. |
### InvalidEncodedAllowedERC725YDataKeys
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invalidencodedallowederc725ydatakeys)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidEncodedAllowedERC725YDataKeys(bytes,string)`
- Error hash: `0xae6cbd37`
:::
```solidity
error InvalidEncodedAllowedERC725YDataKeys(bytes value, string context);
```
_Error when reading the Allowed ERC725Y Data Keys. Reason: `context`, Allowed ERC725Y Data Keys value read: `value`._
Reverts when `value` is not encoded properly as a `bytes32[CompactBytesArray]`. The `context` string provides context on when this error occurred (\_e.g: when fetching the `AllowedERC725YDataKeys` to verify the permissions of a controller, or when validating the `AllowedERC725YDataKeys` when setting them for a controller).
#### Parameters
| Name | Type | Description |
| --------- | :------: | ---------------------------------------------------------- |
| `value` | `bytes` | The value that is not a valid `bytes32[CompactBytesArray]` |
| `context` | `string` | A brief description of where the error occurred. |
### InvalidLSP6Target
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invalidlsp6target)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidLSP6Target()`
- Error hash: `0xfc854579`
:::
```solidity
error InvalidLSP6Target();
```
_Invalid address supplied to link this Key Manager to (`address(0)`)._
Reverts when the address provided to set as the [`target`](#target) linked to this KeyManager is invalid (_e.g. `address(0)`_).
### InvalidPayload
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invalidpayload)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidPayload(bytes)`
- Error hash: `0x3621bbcc`
:::
```solidity
error InvalidPayload(bytes payload);
```
_Invalid calldata payload sent._
Reverts when the payload is invalid.
#### Parameters
| Name | Type | Description |
| --------- | :-----: | ----------- |
| `payload` | `bytes` | - |
### InvalidRelayNonce
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invalidrelaynonce)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidRelayNonce(address,uint256,bytes)`
- Error hash: `0xc9bd9eb9`
:::
```solidity
error InvalidRelayNonce(address signer, uint256 invalidNonce, bytes signature);
```
_The relay call failed because an invalid nonce was provided for the address `signer` that signed the execute relay call. Invalid nonce: `invalidNonce`, signature of signer: `signature`._
Reverts when the `signer` address retrieved from the `signature` has an invalid nonce: `invalidNonce`.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------- |
| `signer` | `address` | The address of the signer. |
| `invalidNonce` | `uint256` | The nonce retrieved for the `signer` address. |
| `signature` | `bytes` | The signature used to retrieve the `signer` address. |
### InvalidWhitelistedCall
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#invalidwhitelistedcall)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `InvalidWhitelistedCall(address)`
- Error hash: `0x6fd203c5`
:::
```solidity
error InvalidWhitelistedCall(address from);
```
_Invalid allowed calls (`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff`) set for address `from`. Could not perform external call._
Reverts when a `from` address has _"any whitelisted call"_ as allowed call set. This revert happens during the verification of the permissions of the address for its allowed calls. A `from` address is not allowed to have 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff in its list of `AddressPermissions:AllowedCalls:`, as this allows any STANDARD:ADDRESS:FUNCTION. This is equivalent to granting the SUPER permission and should never be valid.
#### Parameters
| Name | Type | Description |
| ------ | :-------: | ---------------------------------------------------------------------- |
| `from` | `address` | The controller address that has _"any allowed calls"_ whitelisted set. |
### KeyManagerCannotBeSetAsExtensionForLSP20Functions
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#keymanagercannotbesetasextensionforlsp20functions)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `KeyManagerCannotBeSetAsExtensionForLSP20Functions()`
- Error hash: `0x4a9fa8cf`
:::
```solidity
error KeyManagerCannotBeSetAsExtensionForLSP20Functions();
```
_Key Manager cannot be used as an LSP17 extension for LSP20 functions._
Reverts when the address of the Key Manager is being set as extensions for lsp20 functions
### LSP6BatchExcessiveValueSent
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#lsp6batchexcessivevaluesent)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `LSP6BatchExcessiveValueSent(uint256,uint256)`
- Error hash: `0xa51868b6`
:::
```solidity
error LSP6BatchExcessiveValueSent(uint256 totalValues, uint256 msgValue);
```
_Too much funds sent to forward each amount in the batch. No amount of native tokens should stay in the Key Manager._
This error occurs when there was too much funds sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])` to cover the sum of all the values forwarded on Reverts to avoid the KeyManager to holds some remaining funds sent to the following batch functions:
- execute(uint256[],bytes[])
- executeRelayCall(bytes[],uint256[],uint256[],bytes[]) This error occurs when `msg.value` is more than the sum of all the values being forwarded on each payloads (`values[]` parameter from the batch functions above).
#### Parameters
| Name | Type | Description |
| ------------- | :-------: | ----------- |
| `totalValues` | `uint256` | - |
| `msgValue` | `uint256` | - |
### LSP6BatchInsufficientValueSent
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#lsp6batchinsufficientvaluesent)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `LSP6BatchInsufficientValueSent(uint256,uint256)`
- Error hash: `0x30a324ac`
:::
```solidity
error LSP6BatchInsufficientValueSent(uint256 totalValues, uint256 msgValue);
```
_Not enough funds sent to forward each amount in the batch._
This error occurs when there was not enough funds sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])` to cover the sum of all the values forwarded on each payloads (`values[]` parameter from the batch functions above). This mean that `msg.value` is less than the sum of all the values being forwarded on each payloads (`values[]` parameters).
#### Parameters
| Name | Type | Description |
| ------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `totalValues` | `uint256` | The sum of all the values forwarded on each payloads (`values[]` parameter from the batch functions above). |
| `msgValue` | `uint256` | The amount of native tokens sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])`. |
### NoCallsAllowed
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#nocallsallowed)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NoCallsAllowed(address)`
- Error hash: `0x6cb60587`
:::
```solidity
error NoCallsAllowed(address from);
```
_The address `from` is not authorised to use the linked account contract to make external calls, because it has no Allowed Calls set._
Reverts when the `from` address has no `AllowedCalls` set and cannot interact with any address using the linked [`target`](#target).
#### Parameters
| Name | Type | Description |
| ------ | :-------: | ------------------------------------- |
| `from` | `address` | The address that has no AllowedCalls. |
### NoERC725YDataKeysAllowed
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#noerc725ydatakeysallowed)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NoERC725YDataKeysAllowed(address)`
- Error hash: `0xed7fa509`
:::
```solidity
error NoERC725YDataKeysAllowed(address from);
```
_The address `from` is not authorised to set data, because it has no ERC725Y Data Key allowed._
Reverts when the `from` address has no AllowedERC725YDataKeys set and cannot set any ERC725Y data key on the ERC725Y storage of the linked [`target`](#target).
#### Parameters
| Name | Type | Description |
| ------ | :-------: | ----------------------------------------------------- |
| `from` | `address` | The address that has no `AllowedERC725YDataKeys` set. |
### NoPermissionsSet
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#nopermissionsset)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NoPermissionsSet(address)`
- Error hash: `0xf292052a`
:::
```solidity
error NoPermissionsSet(address from);
```
_The address `from` does not have any permission set on the contract linked to the Key Manager._
Reverts when address `from` does not have any permissions set on the account linked to this Key Manager
#### Parameters
| Name | Type | Description |
| ------ | :-------: | ------------------------------------------ |
| `from` | `address` | the address that does not have permissions |
### NotAllowedCall
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#notallowedcall)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NotAllowedCall(address,address,bytes4)`
- Error hash: `0x45147bce`
:::
```solidity
error NotAllowedCall(address from, address to, bytes4 selector);
```
_The address `from` is not authorised to call the function `selector` on the `to` address._
Reverts when `from` is not authorised to call the `execute(uint256,address,uint256,bytes)` function because of a not allowed callType, address, standard or function.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The controller that tried to call the `execute(uint256,address,uint256,bytes)` function. |
| `to` | `address` | The address of an EOA or contract that `from` tried to call using the linked [`target`](#target) |
| `selector` | `bytes4` | If `to` is a contract, the bytes4 selector of the function that `from` is trying to call. If no function is called (_e.g: a native token transfer_), selector = `0x00000000` |
### NotAllowedERC725YDataKey
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#notallowederc725ydatakey)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NotAllowedERC725YDataKey(address,bytes32)`
- Error hash: `0x557ae079`
:::
```solidity
error NotAllowedERC725YDataKey(address from, bytes32 disallowedKey);
```
_The address `from` is not authorised to set the data key `disallowedKey` on the contract linked to the Key Manager._
Reverts when address `from` is not authorised to set the key `disallowedKey` on the linked [`target`](#target).
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | address The controller that tried to `setData` on the linked [`target`](#target). |
| `disallowedKey` | `bytes32` | A bytes32 data key that `from` is not authorised to set on the ERC725Y storage of the linked [`target`](#target). |
### NotAuthorised
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#notauthorised)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NotAuthorised(address,string)`
- Error hash: `0x3bdad6e6`
:::
```solidity
error NotAuthorised(address from, string permission);
```
_The address `from` is not authorised to `permission` on the contract linked to the Key Manager._
Reverts when address `from` is not authorised and does not have `permission` on the linked [`target`](#target)
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | address The address that was not authorised. |
| `permission` | `string` | permission The permission required (\_e.g: `SETDATA`, `CALL`, `TRANSFERVALUE`) |
### NotRecognisedPermissionKey
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#notrecognisedpermissionkey)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `NotRecognisedPermissionKey(bytes32)`
- Error hash: `0x0f7d735b`
:::
```solidity
error NotRecognisedPermissionKey(bytes32 dataKey);
```
_The data key `dataKey` starts with `AddressPermissions` prefix but is none of the permission data keys defined in LSP6._
Reverts when `dataKey` is a `bytes32` value that does not adhere to any of the permission data keys defined by the LSP6 standard
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------ |
| `dataKey` | `bytes32` | The dataKey that does not match any of the standard LSP6 permission data keys. |
### RelayCallBeforeStartTime
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#relaycallbeforestarttime)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `RelayCallBeforeStartTime()`
- Error hash: `0x00de4b8a`
:::
```solidity
error RelayCallBeforeStartTime();
```
_Relay call not valid yet._
Reverts when the relay call is cannot yet bet executed. This mean that the starting timestamp provided to [`executeRelayCall`](#executerelaycall) function is bigger than the current timestamp.
### RelayCallExpired
:::note References
- Specification details: [**LSP-6-KeyManager**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#relaycallexpired)
- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
- Error signature: `RelayCallExpired()`
- Error hash: `0x5c53a98c`
:::
```solidity
error RelayCallExpired();
```
_Relay call expired (deadline passed)._
Reverts when the period to execute the relay call has expired.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP7DigitalAsset
:::info Standard Specifications
[`LSP-7-DigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md)
:::
:::info Solidity implementation
[`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
> Implementation of a LSP7 Digital Asset, a contract that represents a fungible token.
Minting and transferring are supplied with a `uint256` amount. This implementation is agnostic to the way tokens are created. A supply mechanism has to be added in a derived contract using [`_mint`](#_mint) For a generic mechanism, see [`LSP7Mintable`](#lsp7mintable).
## 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.
### fallback
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#fallback)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#receive)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP7 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP7 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizeOperator(address,uint256,bytes)`
- Function selector: `0xb49506fd`
:::
:::danger
To avoid front-running and Allowance Double-Spend Exploit when increasing or decreasing the authorized amount of an operator, it is advised to use the [`increaseAllowance`](#increaseallowance) and [`decreaseAllowance`](#decreaseallowance) functions. For more information, see: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/
:::
```solidity
function authorizeOperator(
address operator,
uint256 amount,
bytes operatorNotificationData
) external nonpayable;
```
Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The address to authorize as an operator. |
| `amount` | `uint256` | The allowance amount of tokens operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### authorizedAmountFor
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizedAmountFor(address,address)`
- Function selector: `0x65aeaa95`
:::
```solidity
function authorizedAmountFor(
address operator,
address tokenOwner
) external view returns (uint256);
```
Get the amount of tokens `operator` address has access to from `tokenOwner`. Operators can send and burn tokens on behalf of their owners.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `operator` | `address` | The operator's address to query the authorized amount for. |
| `tokenOwner` | `address` | The token owner that `operator` has allowance on. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------- |
| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. |
### balanceOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#balanceof)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [`decimals`](#decimals) function returns `18`), the amount returned should be divided by 1e18 to get a better picture of the actual balance of the `tokenOwner`. _Example:_ `balanceOf(someAddress) -> 42_000_000_000_000_000_000 / 1e18 = 42 tokens`
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | --------------------------------------------------------- |
| `tokenOwner` | `address` | The address of the token holder to query the balance for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------- |
| `0` | `uint256` | The amount of tokens owned by `tokenOwner`. |
### batchCalls
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### decimals
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decimals)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decimals()`
- Function selector: `0x313ce567`
:::
```solidity
function decimals() external view returns (uint8);
```
Returns the number of decimals used to get its user representation. If the asset contract has been set to be non-divisible via the `isNonDivisible_` parameter in the `constructor`, the decimals returned will be `0`. Otherwise `18` is the common value.
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------------------------------------------- |
| `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. |
### decreaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decreaseAllowance(address,address,uint256,bytes)`
- Function selector: `0x78381670`
:::
```solidity
function decreaseAllowance(
address operator,
address tokenOwner,
uint256 subtractedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Decrease the allowance of `operator` by -`subtractedAmount`_
Atomically decreases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The operator to decrease allowance for `msg.sender` |
| `tokenOwner` | `address` | The address of the token owner. |
| `subtractedAmount` | `uint256` | The amount to decrease by in the operator's allowance. |
| `operatorNotificationData` | `bytes` | - |
### getData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdata)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getOperatorsOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getOperatorsOf(address)`
- Function selector: `0xd72fc29a`
:::
```solidity
function getOperatorsOf(address tokenOwner) external view returns (address[]);
```
Returns all `operator` addresses that are allowed to transfer or burn on behalf of `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `tokenOwner` | `address` | The token owner to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ----------------------------------------------------------------------------------- |
| `0` | `address[]` | An array of operators allowed to transfer or burn tokens on behalf of `tokenOwner`. |
### increaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `increaseAllowance(address,uint256,bytes)`
- Function selector: `0x2bc1da82`
:::
```solidity
function increaseAllowance(
address operator,
uint256 addedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Increase the allowance of `operator` by +`addedAmount`_
Atomically increases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` | `address` | The operator to increase the allowance for `msg.sender` |
| `addedAmount` | `uint256` | The additional amount to add on top of the current operator's allowance |
| `operatorNotificationData` | `bytes` | - |
### owner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#owner)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `revokeOperator(address,address,bool,bytes)`
- Function selector: `0x30d0dc37`
:::
```solidity
function revokeOperator(
address operator,
address tokenOwner,
bool notify,
bytes operatorNotificationData
) external nonpayable;
```
Enables `tokenOwner` to remove `operator` for its tokens, disallowing it to send any amount of tokens on its behalf. This function also allows the `operator` to remove itself if it is the caller of this function
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | --------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenOwner` | `address` | The address of the token owner. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdata)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### totalSupply
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transfer(address,address,uint256,bool,bytes)`
- Function selector: `0x760d9bba`
:::
```solidity
function transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) external nonpayable;
```
Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer has been completed (See [`authorizedAmountFor`](#authorizedamountfor)).
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | The recipient address. |
| `amount` | `uint256` | The amount of tokens to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])`
- Function selector: `0x2d7667c9`
:::
```solidity
function transferBatch(
address[] from,
address[] to,
uint256[] amount,
bool[] force,
bytes[] data
) external nonpayable;
```
Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the arrays of `from`, `to`, `amount`.
#### Parameters
| Name | Type | Description |
| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of receiving addresses. |
| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. |
| `force` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferownership)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
via this function once the digital asset contract has been deployed.
### \_updateOperator
```solidity
function _updateOperator(
address tokenOwner,
address operator,
uint256 allowance,
bool notified,
bytes operatorNotificationData
) internal nonpayable;
```
Changes token `amount` the `operator` has access to from `tokenOwner` tokens.
If the amount is zero the operator is removed from the list of operators, otherwise he is added to the list of operators.
If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- |
| `tokenOwner` | `address` | The address that will give `operator` an allowance for on its balance. |
| `operator` | `address` | @param operatorNotificationData The data to send to the universalReceiver function of the operator in case of notifying |
| `allowance` | `uint256` | The maximum amount of token that `operator` can spend from the `tokenOwner`'s balance. |
| `notified` | `bool` | Boolean indicating whether the operator has been notified about the change of allowance |
| `operatorNotificationData` | `bytes` | The data to send to the universalReceiver function of the operator in case of notifying |
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Mints `amount` of tokens and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from`.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to mint tokens for. |
| `amount` | `uint256` | The amount of tokens to mint. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted [`Transfer`](#transfer) event, and sent in the LSP1 hook to the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(address from, uint256 amount, bytes data) internal nonpayable;
```
Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to burn tokens from its balance. |
| `amount` | `uint256` | The amount of tokens to burn. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_spendAllowance
```solidity
function _spendAllowance(
address operator,
address tokenOwner,
uint256 amountToSpend
) internal nonpayable;
```
Spend `amountToSpend` from the `operator`'s authorized on behalf of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ------------------------------------------------------------------- |
| `operator` | `address` | The address of the operator to decrease the allowance of. |
| `tokenOwner` | `address` | The address that granted an allowance on its balance to `operator`. |
| `amountToSpend` | `uint256` | The amount of tokens to subtract in allowance of `operator`. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender/recipient via LSP1**.
:::
```solidity
function _transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance
of `to` by `+amount`.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to decrease the balance. |
| `to` | `address` | The address to increase the balance. |
| `amount` | `uint256` | The amount of tokens to transfer from `from` to `to`. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_beforeTokenTransfer
```solidity
function _beforeTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
function _afterTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient** by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
function _notifyTokenOperator(
address operator,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the operator `operator` about the `amount` tokens being authorized with.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable;
```
Attempt to notify the token sender `from` about the `amount` of tokens being transferred.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
function _notifyTokenReceiver(
address to,
bool force,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the token receiver `to` about the `amount` tokens being received.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
- we do not check that payable bool as in lsp7 standard we will always forward the value to the extension
### \_fallbackLSP17Extendable
:::info
The LSP7 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`.
:::
```solidity
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`](#_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.
Forwards the value if the extension is payable.
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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#datachanged)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)`
- Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d`
:::
```solidity
event OperatorAuthorizationChanged(
address indexed operator,
address indexed tokenOwner,
uint256 indexed amount,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` enables `operator` for `amount` tokens.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bool,bytes)`
- Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167`
:::
```solidity
event OperatorRevoked(
address indexed operator,
address indexed tokenOwner,
bool indexed notified,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from operating |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `notified` **`indexed`** | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### Transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `Transfer(address,address,address,uint256,bool,bytes)`
- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6`
:::
```solidity
event Transfer(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bool force,
bytes data
);
```
Emitted when the `from` transferred successfully `amount` of tokens to `to`.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. |
| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). |
| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). |
| `amount` | `uint256` | The amount of tokens transferred. |
| `force` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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.
### LSP7AmountExceedsAuthorizedAmount
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)`
- Error hash: `0xf3a6b691`
:::
```solidity
error LSP7AmountExceedsAuthorizedAmount(
address tokenOwner,
uint256 authorizedAmount,
address operator,
uint256 amount
);
```
reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than the `authorizedAmount`.
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `authorizedAmount` | `uint256` | - |
| `operator` | `address` | - |
| `amount` | `uint256` | - |
### LSP7AmountExceedsBalance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)`
- Error hash: `0x08d47949`
:::
```solidity
error LSP7AmountExceedsBalance(
uint256 balance,
address tokenOwner,
uint256 amount
);
```
reverts when sending an `amount` of tokens larger than the current `balance` of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `balance` | `uint256` | - |
| `tokenOwner` | `address` | - |
| `amount` | `uint256` | - |
### LSP7BatchCallFailed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7BatchCallFailed(uint256)`
- Error hash: `0xb774c284`
:::
```solidity
error LSP7BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP7CannotSendWithAddressZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotSendWithAddressZero()`
- Error hash: `0xd2d5ec30`
:::
```solidity
error LSP7CannotSendWithAddressZero();
```
reverts when trying to:
- mint tokens to the zero address.
- burn tokens from the zero address.
- transfer tokens from or to the zero address.
### LSP7CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotUseAddressZeroAsOperator()`
- Error hash: `0x6355e766`
:::
```solidity
error LSP7CannotUseAddressZeroAsOperator();
```
reverts when trying to set the zero address as an operator.
### LSP7DecreaseAllowanceNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreaseallowancenotauthorized)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreaseAllowanceNotAuthorized(address,address,address)`
- Error hash: `0x98ce2945`
:::
```solidity
error LSP7DecreaseAllowanceNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to decrease allowance is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7DecreasedAllowanceBelowZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreasedAllowanceBelowZero()`
- Error hash: `0x0ef76c35`
:::
```solidity
error LSP7DecreasedAllowanceBelowZero();
```
Reverts when trying to decrease an operator's allowance to more than its current allowance.
### LSP7InvalidTransferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7InvalidTransferBatch()`
- Error hash: `0x263eee8d`
:::
```solidity
error LSP7InvalidTransferBatch();
```
reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths.
### LSP7NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0xa608fbb6`
:::
```solidity
error LSP7NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x26c247f4`
:::
```solidity
error LSP7NotifyTokenReceiverIsEOA(address tokenReceiver);
```
reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7revokeoperatornotauthorized)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7RevokeOperatorNotAuthorized(address,address,address)`
- Error hash: `0x1a525b32`
:::
```solidity
error LSP7RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenContractCannotHoldValue()`
- Error hash: `0x388f5adc`
:::
```solidity
error LSP7TokenContractCannotHoldValue();
```
_LSP7 contract cannot receive native tokens._
Error occurs when sending native tokens to the LSP7 contract without sending any data. E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension.
### LSP7TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenOwnerCannotBeOperator()`
- Error hash: `0xdab75047`
:::
```solidity
error LSP7TokenOwnerCannotBeOperator();
```
reverts when trying to authorize or revoke the token's owner as an operator.
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OperatorAllowanceCannotBeIncreasedFromZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)`
- Error hash: `0xcba6e977`
:::
```solidity
error OperatorAllowanceCannotBeIncreasedFromZero(address operator);
```
Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an operator that does not have any allowance
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP7Burnable
:::info Standard Specifications
[`LSP-7-DigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md)
:::
:::info Solidity implementation
[`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
> LSP7 token extension that allows token holders to destroy both their own tokens and those that they have an allowance for as an operator.
## 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.
### fallback
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#fallback)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#receive)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP7 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP7 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizeOperator(address,uint256,bytes)`
- Function selector: `0xb49506fd`
:::
:::danger
To avoid front-running and Allowance Double-Spend Exploit when increasing or decreasing the authorized amount of an operator, it is advised to use the [`increaseAllowance`](#increaseallowance) and [`decreaseAllowance`](#decreaseallowance) functions. For more information, see: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/
:::
```solidity
function authorizeOperator(
address operator,
uint256 amount,
bytes operatorNotificationData
) external nonpayable;
```
Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The address to authorize as an operator. |
| `amount` | `uint256` | The allowance amount of tokens operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### authorizedAmountFor
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizedAmountFor(address,address)`
- Function selector: `0x65aeaa95`
:::
```solidity
function authorizedAmountFor(
address operator,
address tokenOwner
) external view returns (uint256);
```
Get the amount of tokens `operator` address has access to from `tokenOwner`. Operators can send and burn tokens on behalf of their owners.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `operator` | `address` | The operator's address to query the authorized amount for. |
| `tokenOwner` | `address` | The token owner that `operator` has allowance on. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------- |
| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. |
### balanceOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#balanceof)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [`decimals`](#decimals) function returns `18`), the amount returned should be divided by 1e18 to get a better picture of the actual balance of the `tokenOwner`. _Example:_ `balanceOf(someAddress) -> 42_000_000_000_000_000_000 / 1e18 = 42 tokens`
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | --------------------------------------------------------- |
| `tokenOwner` | `address` | The address of the token holder to query the balance for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------- |
| `0` | `uint256` | The amount of tokens owned by `tokenOwner`. |
### batchCalls
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### burn
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#burn)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `burn(address,uint256,bytes)`
- Function selector: `0x44d17187`
:::
```solidity
function burn(address from, uint256 amount, bytes data) external nonpayable;
```
See internal [`_burn`](#_burn) function for details.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ----------- |
| `from` | `address` | - |
| `amount` | `uint256` | - |
| `data` | `bytes` | - |
### decimals
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decimals)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decimals()`
- Function selector: `0x313ce567`
:::
```solidity
function decimals() external view returns (uint8);
```
Returns the number of decimals used to get its user representation. If the asset contract has been set to be non-divisible via the `isNonDivisible_` parameter in the `constructor`, the decimals returned will be `0`. Otherwise `18` is the common value.
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------------------------------------------- |
| `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. |
### decreaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decreaseAllowance(address,address,uint256,bytes)`
- Function selector: `0x78381670`
:::
```solidity
function decreaseAllowance(
address operator,
address tokenOwner,
uint256 subtractedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Decrease the allowance of `operator` by -`subtractedAmount`_
Atomically decreases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The operator to decrease allowance for `msg.sender` |
| `tokenOwner` | `address` | The address of the token owner. |
| `subtractedAmount` | `uint256` | The amount to decrease by in the operator's allowance. |
| `operatorNotificationData` | `bytes` | - |
### getData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdata)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getOperatorsOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getOperatorsOf(address)`
- Function selector: `0xd72fc29a`
:::
```solidity
function getOperatorsOf(address tokenOwner) external view returns (address[]);
```
Returns all `operator` addresses that are allowed to transfer or burn on behalf of `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `tokenOwner` | `address` | The token owner to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ----------------------------------------------------------------------------------- |
| `0` | `address[]` | An array of operators allowed to transfer or burn tokens on behalf of `tokenOwner`. |
### increaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `increaseAllowance(address,uint256,bytes)`
- Function selector: `0x2bc1da82`
:::
```solidity
function increaseAllowance(
address operator,
uint256 addedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Increase the allowance of `operator` by +`addedAmount`_
Atomically increases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` | `address` | The operator to increase the allowance for `msg.sender` |
| `addedAmount` | `uint256` | The additional amount to add on top of the current operator's allowance |
| `operatorNotificationData` | `bytes` | - |
### owner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#owner)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `revokeOperator(address,address,bool,bytes)`
- Function selector: `0x30d0dc37`
:::
```solidity
function revokeOperator(
address operator,
address tokenOwner,
bool notify,
bytes operatorNotificationData
) external nonpayable;
```
Enables `tokenOwner` to remove `operator` for its tokens, disallowing it to send any amount of tokens on its behalf. This function also allows the `operator` to remove itself if it is the caller of this function
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | --------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenOwner` | `address` | The address of the token owner. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdata)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### totalSupply
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transfer(address,address,uint256,bool,bytes)`
- Function selector: `0x760d9bba`
:::
```solidity
function transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) external nonpayable;
```
Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer has been completed (See [`authorizedAmountFor`](#authorizedamountfor)).
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | The recipient address. |
| `amount` | `uint256` | The amount of tokens to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])`
- Function selector: `0x2d7667c9`
:::
```solidity
function transferBatch(
address[] from,
address[] to,
uint256[] amount,
bool[] force,
bytes[] data
) external nonpayable;
```
Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the arrays of `from`, `to`, `amount`.
#### Parameters
| Name | Type | Description |
| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of receiving addresses. |
| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. |
| `force` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferownership)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
via this function once the digital asset contract has been deployed.
### \_updateOperator
```solidity
function _updateOperator(
address tokenOwner,
address operator,
uint256 allowance,
bool notified,
bytes operatorNotificationData
) internal nonpayable;
```
Changes token `amount` the `operator` has access to from `tokenOwner` tokens.
If the amount is zero the operator is removed from the list of operators, otherwise he is added to the list of operators.
If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- |
| `tokenOwner` | `address` | The address that will give `operator` an allowance for on its balance. |
| `operator` | `address` | @param operatorNotificationData The data to send to the universalReceiver function of the operator in case of notifying |
| `allowance` | `uint256` | The maximum amount of token that `operator` can spend from the `tokenOwner`'s balance. |
| `notified` | `bool` | Boolean indicating whether the operator has been notified about the change of allowance |
| `operatorNotificationData` | `bytes` | The data to send to the universalReceiver function of the operator in case of notifying |
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Mints `amount` of tokens and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from`.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to mint tokens for. |
| `amount` | `uint256` | The amount of tokens to mint. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted [`Transfer`](#transfer) event, and sent in the LSP1 hook to the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(address from, uint256 amount, bytes data) internal nonpayable;
```
Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to burn tokens from its balance. |
| `amount` | `uint256` | The amount of tokens to burn. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_spendAllowance
```solidity
function _spendAllowance(
address operator,
address tokenOwner,
uint256 amountToSpend
) internal nonpayable;
```
Spend `amountToSpend` from the `operator`'s authorized on behalf of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ------------------------------------------------------------------- |
| `operator` | `address` | The address of the operator to decrease the allowance of. |
| `tokenOwner` | `address` | The address that granted an allowance on its balance to `operator`. |
| `amountToSpend` | `uint256` | The amount of tokens to subtract in allowance of `operator`. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender/recipient via LSP1**.
:::
```solidity
function _transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance
of `to` by `+amount`.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to decrease the balance. |
| `to` | `address` | The address to increase the balance. |
| `amount` | `uint256` | The amount of tokens to transfer from `from` to `to`. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_beforeTokenTransfer
```solidity
function _beforeTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
function _afterTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient** by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
function _notifyTokenOperator(
address operator,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the operator `operator` about the `amount` tokens being authorized with.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable;
```
Attempt to notify the token sender `from` about the `amount` of tokens being transferred.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
function _notifyTokenReceiver(
address to,
bool force,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the token receiver `to` about the `amount` tokens being received.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
- we do not check that payable bool as in lsp7 standard we will always forward the value to the extension
### \_fallbackLSP17Extendable
:::info
The LSP7 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`.
:::
```solidity
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`](#_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.
Forwards the value if the extension is payable.
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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#datachanged)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)`
- Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d`
:::
```solidity
event OperatorAuthorizationChanged(
address indexed operator,
address indexed tokenOwner,
uint256 indexed amount,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` enables `operator` for `amount` tokens.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bool,bytes)`
- Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167`
:::
```solidity
event OperatorRevoked(
address indexed operator,
address indexed tokenOwner,
bool indexed notified,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from operating |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `notified` **`indexed`** | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### Transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `Transfer(address,address,address,uint256,bool,bytes)`
- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6`
:::
```solidity
event Transfer(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bool force,
bytes data
);
```
Emitted when the `from` transferred successfully `amount` of tokens to `to`.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. |
| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). |
| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). |
| `amount` | `uint256` | The amount of tokens transferred. |
| `force` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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.
### LSP7AmountExceedsAuthorizedAmount
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)`
- Error hash: `0xf3a6b691`
:::
```solidity
error LSP7AmountExceedsAuthorizedAmount(
address tokenOwner,
uint256 authorizedAmount,
address operator,
uint256 amount
);
```
reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than the `authorizedAmount`.
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `authorizedAmount` | `uint256` | - |
| `operator` | `address` | - |
| `amount` | `uint256` | - |
### LSP7AmountExceedsBalance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)`
- Error hash: `0x08d47949`
:::
```solidity
error LSP7AmountExceedsBalance(
uint256 balance,
address tokenOwner,
uint256 amount
);
```
reverts when sending an `amount` of tokens larger than the current `balance` of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `balance` | `uint256` | - |
| `tokenOwner` | `address` | - |
| `amount` | `uint256` | - |
### LSP7BatchCallFailed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7BatchCallFailed(uint256)`
- Error hash: `0xb774c284`
:::
```solidity
error LSP7BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP7CannotSendWithAddressZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotSendWithAddressZero()`
- Error hash: `0xd2d5ec30`
:::
```solidity
error LSP7CannotSendWithAddressZero();
```
reverts when trying to:
- mint tokens to the zero address.
- burn tokens from the zero address.
- transfer tokens from or to the zero address.
### LSP7CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotUseAddressZeroAsOperator()`
- Error hash: `0x6355e766`
:::
```solidity
error LSP7CannotUseAddressZeroAsOperator();
```
reverts when trying to set the zero address as an operator.
### LSP7DecreaseAllowanceNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreaseallowancenotauthorized)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreaseAllowanceNotAuthorized(address,address,address)`
- Error hash: `0x98ce2945`
:::
```solidity
error LSP7DecreaseAllowanceNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to decrease allowance is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7DecreasedAllowanceBelowZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreasedAllowanceBelowZero()`
- Error hash: `0x0ef76c35`
:::
```solidity
error LSP7DecreasedAllowanceBelowZero();
```
Reverts when trying to decrease an operator's allowance to more than its current allowance.
### LSP7InvalidTransferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7InvalidTransferBatch()`
- Error hash: `0x263eee8d`
:::
```solidity
error LSP7InvalidTransferBatch();
```
reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths.
### LSP7NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0xa608fbb6`
:::
```solidity
error LSP7NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x26c247f4`
:::
```solidity
error LSP7NotifyTokenReceiverIsEOA(address tokenReceiver);
```
reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7revokeoperatornotauthorized)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7RevokeOperatorNotAuthorized(address,address,address)`
- Error hash: `0x1a525b32`
:::
```solidity
error LSP7RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenContractCannotHoldValue()`
- Error hash: `0x388f5adc`
:::
```solidity
error LSP7TokenContractCannotHoldValue();
```
_LSP7 contract cannot receive native tokens._
Error occurs when sending native tokens to the LSP7 contract without sending any data. E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension.
### LSP7TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenOwnerCannotBeOperator()`
- Error hash: `0xdab75047`
:::
```solidity
error LSP7TokenOwnerCannotBeOperator();
```
reverts when trying to authorize or revoke the token's owner as an operator.
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OperatorAllowanceCannotBeIncreasedFromZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)`
- Error hash: `0xcba6e977`
:::
```solidity
error OperatorAllowanceCannotBeIncreasedFromZero(address operator);
```
Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an operator that does not have any allowance
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Compatibility.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/ILSP4Compatibility.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CompatibleERC20InitAbstract.sol
[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CompatibleERC20.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP7CappedSupply
:::info Standard Specifications
[`LSP-7-DigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md)
:::
:::info Solidity implementation
[`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
LSP7 token extension to add a max token supply cap.
## 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.
### fallback
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#fallback)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#receive)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP7 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP7 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizeOperator(address,uint256,bytes)`
- Function selector: `0xb49506fd`
:::
:::danger
To avoid front-running and Allowance Double-Spend Exploit when increasing or decreasing the authorized amount of an operator, it is advised to use the [`increaseAllowance`](#increaseallowance) and [`decreaseAllowance`](#decreaseallowance) functions. For more information, see: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/
:::
```solidity
function authorizeOperator(
address operator,
uint256 amount,
bytes operatorNotificationData
) external nonpayable;
```
Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The address to authorize as an operator. |
| `amount` | `uint256` | The allowance amount of tokens operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### authorizedAmountFor
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizedAmountFor(address,address)`
- Function selector: `0x65aeaa95`
:::
```solidity
function authorizedAmountFor(
address operator,
address tokenOwner
) external view returns (uint256);
```
Get the amount of tokens `operator` address has access to from `tokenOwner`. Operators can send and burn tokens on behalf of their owners.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `operator` | `address` | The operator's address to query the authorized amount for. |
| `tokenOwner` | `address` | The token owner that `operator` has allowance on. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------- |
| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. |
### balanceOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#balanceof)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [`decimals`](#decimals) function returns `18`), the amount returned should be divided by 1e18 to get a better picture of the actual balance of the `tokenOwner`. _Example:_ `balanceOf(someAddress) -> 42_000_000_000_000_000_000 / 1e18 = 42 tokens`
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | --------------------------------------------------------- |
| `tokenOwner` | `address` | The address of the token holder to query the balance for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------- |
| `0` | `uint256` | The amount of tokens owned by `tokenOwner`. |
### batchCalls
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### decimals
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decimals)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decimals()`
- Function selector: `0x313ce567`
:::
```solidity
function decimals() external view returns (uint8);
```
Returns the number of decimals used to get its user representation. If the asset contract has been set to be non-divisible via the `isNonDivisible_` parameter in the `constructor`, the decimals returned will be `0`. Otherwise `18` is the common value.
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------------------------------------------- |
| `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. |
### decreaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decreaseAllowance(address,address,uint256,bytes)`
- Function selector: `0x78381670`
:::
```solidity
function decreaseAllowance(
address operator,
address tokenOwner,
uint256 subtractedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Decrease the allowance of `operator` by -`subtractedAmount`_
Atomically decreases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The operator to decrease allowance for `msg.sender` |
| `tokenOwner` | `address` | The address of the token owner. |
| `subtractedAmount` | `uint256` | The amount to decrease by in the operator's allowance. |
| `operatorNotificationData` | `bytes` | - |
### getData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdata)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getOperatorsOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getOperatorsOf(address)`
- Function selector: `0xd72fc29a`
:::
```solidity
function getOperatorsOf(address tokenOwner) external view returns (address[]);
```
Returns all `operator` addresses that are allowed to transfer or burn on behalf of `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `tokenOwner` | `address` | The token owner to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ----------------------------------------------------------------------------------- |
| `0` | `address[]` | An array of operators allowed to transfer or burn tokens on behalf of `tokenOwner`. |
### increaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `increaseAllowance(address,uint256,bytes)`
- Function selector: `0x2bc1da82`
:::
```solidity
function increaseAllowance(
address operator,
uint256 addedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Increase the allowance of `operator` by +`addedAmount`_
Atomically increases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` | `address` | The operator to increase the allowance for `msg.sender` |
| `addedAmount` | `uint256` | The additional amount to add on top of the current operator's allowance |
| `operatorNotificationData` | `bytes` | - |
### owner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#owner)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `revokeOperator(address,address,bool,bytes)`
- Function selector: `0x30d0dc37`
:::
```solidity
function revokeOperator(
address operator,
address tokenOwner,
bool notify,
bytes operatorNotificationData
) external nonpayable;
```
Enables `tokenOwner` to remove `operator` for its tokens, disallowing it to send any amount of tokens on its behalf. This function also allows the `operator` to remove itself if it is the caller of this function
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | --------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenOwner` | `address` | The address of the token owner. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdata)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### tokenSupplyCap
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#tokensupplycap)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `tokenSupplyCap()`
- Function selector: `0x52058d8a`
:::
```solidity
function tokenSupplyCap() external view returns (uint256);
```
_The maximum supply amount of tokens allowed to exist is `_TOKEN_SUPPLY_CAP`._
Get the maximum number of tokens that can exist to circulate. Once [`totalSupply`](#totalsupply) reaches reaches [`totalSuuplyCap`](#totalsuuplycap), it is not possible to mint more tokens.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------ |
| `0` | `uint256` | The maximum number of tokens that can exist in the contract. |
### totalSupply
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transfer(address,address,uint256,bool,bytes)`
- Function selector: `0x760d9bba`
:::
```solidity
function transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) external nonpayable;
```
Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer has been completed (See [`authorizedAmountFor`](#authorizedamountfor)).
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | The recipient address. |
| `amount` | `uint256` | The amount of tokens to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])`
- Function selector: `0x2d7667c9`
:::
```solidity
function transferBatch(
address[] from,
address[] to,
uint256[] amount,
bool[] force,
bytes[] data
) external nonpayable;
```
Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the arrays of `from`, `to`, `amount`.
#### Parameters
| Name | Type | Description |
| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of receiving addresses. |
| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. |
| `force` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferownership)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
via this function once the digital asset contract has been deployed.
### \_updateOperator
```solidity
function _updateOperator(
address tokenOwner,
address operator,
uint256 allowance,
bool notified,
bytes operatorNotificationData
) internal nonpayable;
```
Changes token `amount` the `operator` has access to from `tokenOwner` tokens.
If the amount is zero the operator is removed from the list of operators, otherwise he is added to the list of operators.
If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- |
| `tokenOwner` | `address` | The address that will give `operator` an allowance for on its balance. |
| `operator` | `address` | @param operatorNotificationData The data to send to the universalReceiver function of the operator in case of notifying |
| `allowance` | `uint256` | The maximum amount of token that `operator` can spend from the `tokenOwner`'s balance. |
| `notified` | `bool` | Boolean indicating whether the operator has been notified about the change of allowance |
| `operatorNotificationData` | `bytes` | The data to send to the universalReceiver function of the operator in case of notifying |
### \_mint
```solidity
function _mint(
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Same as [`_mint`](#_mint) but allows to mint only if the [`totalSupply`](#totalsupply) does not exceed the [`tokenSupplyCap`](#tokensupplycap)
after `amount` of tokens have been minted.
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(address from, uint256 amount, bytes data) internal nonpayable;
```
Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to burn tokens from its balance. |
| `amount` | `uint256` | The amount of tokens to burn. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_spendAllowance
```solidity
function _spendAllowance(
address operator,
address tokenOwner,
uint256 amountToSpend
) internal nonpayable;
```
Spend `amountToSpend` from the `operator`'s authorized on behalf of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ------------------------------------------------------------------- |
| `operator` | `address` | The address of the operator to decrease the allowance of. |
| `tokenOwner` | `address` | The address that granted an allowance on its balance to `operator`. |
| `amountToSpend` | `uint256` | The amount of tokens to subtract in allowance of `operator`. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender/recipient via LSP1**.
:::
```solidity
function _transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance
of `to` by `+amount`.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to decrease the balance. |
| `to` | `address` | The address to increase the balance. |
| `amount` | `uint256` | The amount of tokens to transfer from `from` to `to`. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_beforeTokenTransfer
```solidity
function _beforeTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
function _afterTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient** by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
function _notifyTokenOperator(
address operator,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the operator `operator` about the `amount` tokens being authorized with.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable;
```
Attempt to notify the token sender `from` about the `amount` of tokens being transferred.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
function _notifyTokenReceiver(
address to,
bool force,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the token receiver `to` about the `amount` tokens being received.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
- we do not check that payable bool as in lsp7 standard we will always forward the value to the extension
### \_fallbackLSP17Extendable
:::info
The LSP7 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`.
:::
```solidity
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`](#_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.
Forwards the value if the extension is payable.
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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#datachanged)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)`
- Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d`
:::
```solidity
event OperatorAuthorizationChanged(
address indexed operator,
address indexed tokenOwner,
uint256 indexed amount,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` enables `operator` for `amount` tokens.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bool,bytes)`
- Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167`
:::
```solidity
event OperatorRevoked(
address indexed operator,
address indexed tokenOwner,
bool indexed notified,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from operating |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `notified` **`indexed`** | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### Transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `Transfer(address,address,address,uint256,bool,bytes)`
- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6`
:::
```solidity
event Transfer(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bool force,
bytes data
);
```
Emitted when the `from` transferred successfully `amount` of tokens to `to`.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. |
| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). |
| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). |
| `amount` | `uint256` | The amount of tokens transferred. |
| `force` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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.
### LSP7AmountExceedsAuthorizedAmount
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)`
- Error hash: `0xf3a6b691`
:::
```solidity
error LSP7AmountExceedsAuthorizedAmount(
address tokenOwner,
uint256 authorizedAmount,
address operator,
uint256 amount
);
```
reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than the `authorizedAmount`.
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `authorizedAmount` | `uint256` | - |
| `operator` | `address` | - |
| `amount` | `uint256` | - |
### LSP7AmountExceedsBalance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)`
- Error hash: `0x08d47949`
:::
```solidity
error LSP7AmountExceedsBalance(
uint256 balance,
address tokenOwner,
uint256 amount
);
```
reverts when sending an `amount` of tokens larger than the current `balance` of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `balance` | `uint256` | - |
| `tokenOwner` | `address` | - |
| `amount` | `uint256` | - |
### LSP7BatchCallFailed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7BatchCallFailed(uint256)`
- Error hash: `0xb774c284`
:::
```solidity
error LSP7BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP7CannotSendWithAddressZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotSendWithAddressZero()`
- Error hash: `0xd2d5ec30`
:::
```solidity
error LSP7CannotSendWithAddressZero();
```
reverts when trying to:
- mint tokens to the zero address.
- burn tokens from the zero address.
- transfer tokens from or to the zero address.
### LSP7CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotUseAddressZeroAsOperator()`
- Error hash: `0x6355e766`
:::
```solidity
error LSP7CannotUseAddressZeroAsOperator();
```
reverts when trying to set the zero address as an operator.
### LSP7CappedSupplyCannotMintOverCap
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cappedsupplycannotmintovercap)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CappedSupplyCannotMintOverCap()`
- Error hash: `0xeacbf0d1`
:::
```solidity
error LSP7CappedSupplyCannotMintOverCap();
```
_Cannot mint anymore as total supply reached the maximum cap._
Reverts when trying to mint tokens but the [`totalSupply`](#totalsupply) has reached the maximum [`tokenSupplyCap`](#tokensupplycap).
### LSP7CappedSupplyRequired
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cappedsupplyrequired)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CappedSupplyRequired()`
- Error hash: `0xacf1d8c5`
:::
```solidity
error LSP7CappedSupplyRequired();
```
_The `tokenSupplyCap` must be set and cannot be `0`._
Reverts when setting `0` for the [`tokenSupplyCap`](#tokensupplycap). The max token supply MUST be set to a number greater than 0.
### LSP7DecreaseAllowanceNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreaseallowancenotauthorized)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreaseAllowanceNotAuthorized(address,address,address)`
- Error hash: `0x98ce2945`
:::
```solidity
error LSP7DecreaseAllowanceNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to decrease allowance is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7DecreasedAllowanceBelowZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreasedAllowanceBelowZero()`
- Error hash: `0x0ef76c35`
:::
```solidity
error LSP7DecreasedAllowanceBelowZero();
```
Reverts when trying to decrease an operator's allowance to more than its current allowance.
### LSP7InvalidTransferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7InvalidTransferBatch()`
- Error hash: `0x263eee8d`
:::
```solidity
error LSP7InvalidTransferBatch();
```
reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths.
### LSP7NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0xa608fbb6`
:::
```solidity
error LSP7NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x26c247f4`
:::
```solidity
error LSP7NotifyTokenReceiverIsEOA(address tokenReceiver);
```
reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7revokeoperatornotauthorized)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7RevokeOperatorNotAuthorized(address,address,address)`
- Error hash: `0x1a525b32`
:::
```solidity
error LSP7RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenContractCannotHoldValue()`
- Error hash: `0x388f5adc`
:::
```solidity
error LSP7TokenContractCannotHoldValue();
```
_LSP7 contract cannot receive native tokens._
Error occurs when sending native tokens to the LSP7 contract without sending any data. E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension.
### LSP7TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenOwnerCannotBeOperator()`
- Error hash: `0xdab75047`
:::
```solidity
error LSP7TokenOwnerCannotBeOperator();
```
reverts when trying to authorize or revoke the token's owner as an operator.
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OperatorAllowanceCannotBeIncreasedFromZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)`
- Error hash: `0xcba6e977`
:::
```solidity
error OperatorAllowanceCannotBeIncreasedFromZero(address operator);
```
Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an operator that does not have any allowance
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Compatibility.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/ILSP4Compatibility.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CompatibleERC20InitAbstract.sol
[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CompatibleERC20.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP7Mintable
:::info Standard Specifications
[`LSP-7-DigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md)
:::
:::info Solidity implementation
[`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
> LSP7DigitalAsset deployable preset contract with a public [`mint`](#mint) function callable only by the contract [`owner`](#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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#constructor)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
constructor(
string name_,
string symbol_,
address newOwner_,
uint256 lsp4TokenType_,
bool isNonDivisible_
);
```
_Deploying a `LSP7Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._
#### Parameters
| Name | Type | Description |
| ----------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `name_` | `string` | The name of the token. |
| `symbol_` | `string` | The symbol of the token. |
| `newOwner_` | `address` | The owner of the token contract. |
| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection). |
| `isNonDivisible_` | `bool` | Specify if the LSP7 token is a fungible or non-fungible token. |
### fallback
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#fallback)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#receive)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP7 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP7 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizeOperator(address,uint256,bytes)`
- Function selector: `0xb49506fd`
:::
:::danger
To avoid front-running and Allowance Double-Spend Exploit when increasing or decreasing the authorized amount of an operator, it is advised to use the [`increaseAllowance`](#increaseallowance) and [`decreaseAllowance`](#decreaseallowance) functions. For more information, see: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/
:::
```solidity
function authorizeOperator(
address operator,
uint256 amount,
bytes operatorNotificationData
) external nonpayable;
```
Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The address to authorize as an operator. |
| `amount` | `uint256` | The allowance amount of tokens operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### authorizedAmountFor
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `authorizedAmountFor(address,address)`
- Function selector: `0x65aeaa95`
:::
```solidity
function authorizedAmountFor(
address operator,
address tokenOwner
) external view returns (uint256);
```
Get the amount of tokens `operator` address has access to from `tokenOwner`. Operators can send and burn tokens on behalf of their owners.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `operator` | `address` | The operator's address to query the authorized amount for. |
| `tokenOwner` | `address` | The token owner that `operator` has allowance on. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------- |
| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. |
### balanceOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#balanceof)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [`decimals`](#decimals) function returns `18`), the amount returned should be divided by 1e18 to get a better picture of the actual balance of the `tokenOwner`. _Example:_ `balanceOf(someAddress) -> 42_000_000_000_000_000_000 / 1e18 = 42 tokens`
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | --------------------------------------------------------- |
| `tokenOwner` | `address` | The address of the token holder to query the balance for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------- |
| `0` | `uint256` | The amount of tokens owned by `tokenOwner`. |
### batchCalls
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### decimals
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decimals)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decimals()`
- Function selector: `0x313ce567`
:::
```solidity
function decimals() external view returns (uint8);
```
Returns the number of decimals used to get its user representation. If the asset contract has been set to be non-divisible via the `isNonDivisible_` parameter in the `constructor`, the decimals returned will be `0`. Otherwise `18` is the common value.
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------------------------------------------- |
| `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. |
### decreaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `decreaseAllowance(address,address,uint256,bytes)`
- Function selector: `0x78381670`
:::
```solidity
function decreaseAllowance(
address operator,
address tokenOwner,
uint256 subtractedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Decrease the allowance of `operator` by -`subtractedAmount`_
Atomically decreases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------ |
| `operator` | `address` | The operator to decrease allowance for `msg.sender` |
| `tokenOwner` | `address` | The address of the token owner. |
| `subtractedAmount` | `uint256` | The amount to decrease by in the operator's allowance. |
| `operatorNotificationData` | `bytes` | - |
### getData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdata)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getOperatorsOf
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `getOperatorsOf(address)`
- Function selector: `0xd72fc29a`
:::
```solidity
function getOperatorsOf(address tokenOwner) external view returns (address[]);
```
Returns all `operator` addresses that are allowed to transfer or burn on behalf of `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `tokenOwner` | `address` | The token owner to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ----------------------------------------------------------------------------------- |
| `0` | `address[]` | An array of operators allowed to transfer or burn tokens on behalf of `tokenOwner`. |
### increaseAllowance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `increaseAllowance(address,uint256,bytes)`
- Function selector: `0x2bc1da82`
:::
```solidity
function increaseAllowance(
address operator,
uint256 addedAmount,
bytes operatorNotificationData
) external nonpayable;
```
_Increase the allowance of `operator` by +`addedAmount`_
Atomically increases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` | `address` | The operator to increase the allowance for `msg.sender` |
| `addedAmount` | `uint256` | The additional amount to add on top of the current operator's allowance |
| `operatorNotificationData` | `bytes` | - |
### mint
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#mint)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `mint(address,uint256,bool,bytes)`
- Function selector: `0x7580d920`
:::
```solidity
function mint(
address to,
uint256 amount,
bool force,
bytes data
) external nonpayable;
```
Public [`_mint`](#_mint) function only callable by the [`owner`](#owner).
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ----------- |
| `to` | `address` | - |
| `amount` | `uint256` | - |
| `force` | `bool` | - |
| `data` | `bytes` | - |
### owner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#owner)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `revokeOperator(address,address,bool,bytes)`
- Function selector: `0x30d0dc37`
:::
```solidity
function revokeOperator(
address operator,
address tokenOwner,
bool notify,
bytes operatorNotificationData
) external nonpayable;
```
Enables `tokenOwner` to remove `operator` for its tokens, disallowing it to send any amount of tokens on its behalf. This function also allows the `operator` to remove itself if it is the caller of this function
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | --------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenOwner` | `address` | The address of the token owner. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdata)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### totalSupply
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transfer(address,address,uint256,bool,bytes)`
- Function selector: `0x760d9bba`
:::
```solidity
function transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) external nonpayable;
```
Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer has been completed (See [`authorizedAmountFor`](#authorizedamountfor)).
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | The recipient address. |
| `amount` | `uint256` | The amount of tokens to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])`
- Function selector: `0x2d7667c9`
:::
```solidity
function transferBatch(
address[] from,
address[] to,
uint256[] amount,
bool[] force,
bytes[] data
) external nonpayable;
```
Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the arrays of `from`, `to`, `amount`.
#### Parameters
| Name | Type | Description |
| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of receiving addresses. |
| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. |
| `force` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transferownership)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed
via this function once the digital asset contract has been deployed.
### \_updateOperator
```solidity
function _updateOperator(
address tokenOwner,
address operator,
uint256 allowance,
bool notified,
bytes operatorNotificationData
) internal nonpayable;
```
Changes token `amount` the `operator` has access to from `tokenOwner` tokens.
If the amount is zero the operator is removed from the list of operators, otherwise he is added to the list of operators.
If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- |
| `tokenOwner` | `address` | The address that will give `operator` an allowance for on its balance. |
| `operator` | `address` | @param operatorNotificationData The data to send to the universalReceiver function of the operator in case of notifying |
| `allowance` | `uint256` | The maximum amount of token that `operator` can spend from the `tokenOwner`'s balance. |
| `notified` | `bool` | Boolean indicating whether the operator has been notified about the change of allowance |
| `operatorNotificationData` | `bytes` | The data to send to the universalReceiver function of the operator in case of notifying |
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Mints `amount` of tokens and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from`.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to mint tokens for. |
| `amount` | `uint256` | The amount of tokens to mint. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted [`Transfer`](#transfer) event, and sent in the LSP1 hook to the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(address from, uint256 amount, bytes data) internal nonpayable;
```
Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to burn tokens from its balance. |
| `amount` | `uint256` | The amount of tokens to burn. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_spendAllowance
```solidity
function _spendAllowance(
address operator,
address tokenOwner,
uint256 amountToSpend
) internal nonpayable;
```
Spend `amountToSpend` from the `operator`'s authorized on behalf of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ------------------------------------------------------------------- |
| `operator` | `address` | The address of the operator to decrease the allowance of. |
| `tokenOwner` | `address` | The address that granted an allowance on its balance to `operator`. |
| `amountToSpend` | `uint256` | The amount of tokens to subtract in allowance of `operator`. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender/recipient via LSP1**.
:::
```solidity
function _transfer(
address from,
address to,
uint256 amount,
bool force,
bytes data
) internal nonpayable;
```
Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance
of `to` by `+amount`.
Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address to decrease the balance. |
| `to` | `address` | The address to increase the balance. |
| `amount` | `uint256` | The amount of tokens to transfer from `from` to `to`. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. |
### \_beforeTokenTransfer
```solidity
function _beforeTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
function _afterTokenTransfer(
address from,
address to,
uint256 amount,
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 notifying sender/recipient** by overriding this function.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------ |
| `from` | `address` | The sender address |
| `to` | `address` | The recipient address |
| `amount` | `uint256` | The amount of token to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
function _notifyTokenOperator(
address operator,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the operator `operator` about the `amount` tokens being authorized with.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable;
```
Attempt to notify the token sender `from` about the `amount` of tokens being transferred.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
function _notifyTokenReceiver(
address to,
bool force,
bytes lsp1Data
) internal nonpayable;
```
Attempt to notify the token receiver `to` about the `amount` tokens being received.
This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
- we do not check that payable bool as in lsp7 standard we will always forward the value to the extension
### \_fallbackLSP17Extendable
:::info
The LSP7 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`.
:::
```solidity
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`](#_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.
Forwards the value if the extension is payable.
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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#datachanged)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)`
- Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d`
:::
```solidity
event OperatorAuthorizationChanged(
address indexed operator,
address indexed tokenOwner,
uint256 indexed amount,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` enables `operator` for `amount` tokens.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bool,bytes)`
- Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167`
:::
```solidity
event OperatorRevoked(
address indexed operator,
address indexed tokenOwner,
bool indexed notified,
bytes operatorNotificationData
);
```
Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`.
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from operating |
| `tokenOwner` **`indexed`** | `address` | The token owner |
| `notified` **`indexed`** | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### Transfer
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#transfer)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Event signature: `Transfer(address,address,address,uint256,bool,bytes)`
- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6`
:::
```solidity
event Transfer(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bool force,
bytes data
);
```
Emitted when the `from` transferred successfully `amount` of tokens to `to`.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. |
| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). |
| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). |
| `amount` | `uint256` | The amount of tokens transferred. |
| `force` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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.
### LSP7AmountExceedsAuthorizedAmount
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)`
- Error hash: `0xf3a6b691`
:::
```solidity
error LSP7AmountExceedsAuthorizedAmount(
address tokenOwner,
uint256 authorizedAmount,
address operator,
uint256 amount
);
```
reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than the `authorizedAmount`.
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `authorizedAmount` | `uint256` | - |
| `operator` | `address` | - |
| `amount` | `uint256` | - |
### LSP7AmountExceedsBalance
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)`
- Error hash: `0x08d47949`
:::
```solidity
error LSP7AmountExceedsBalance(
uint256 balance,
address tokenOwner,
uint256 amount
);
```
reverts when sending an `amount` of tokens larger than the current `balance` of the `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `balance` | `uint256` | - |
| `tokenOwner` | `address` | - |
| `amount` | `uint256` | - |
### LSP7BatchCallFailed
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7BatchCallFailed(uint256)`
- Error hash: `0xb774c284`
:::
```solidity
error LSP7BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP7CannotSendWithAddressZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotSendWithAddressZero()`
- Error hash: `0xd2d5ec30`
:::
```solidity
error LSP7CannotSendWithAddressZero();
```
reverts when trying to:
- mint tokens to the zero address.
- burn tokens from the zero address.
- transfer tokens from or to the zero address.
### LSP7CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7CannotUseAddressZeroAsOperator()`
- Error hash: `0x6355e766`
:::
```solidity
error LSP7CannotUseAddressZeroAsOperator();
```
reverts when trying to set the zero address as an operator.
### LSP7DecreaseAllowanceNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreaseallowancenotauthorized)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreaseAllowanceNotAuthorized(address,address,address)`
- Error hash: `0x98ce2945`
:::
```solidity
error LSP7DecreaseAllowanceNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to decrease allowance is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7DecreasedAllowanceBelowZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7DecreasedAllowanceBelowZero()`
- Error hash: `0x0ef76c35`
:::
```solidity
error LSP7DecreasedAllowanceBelowZero();
```
Reverts when trying to decrease an operator's allowance to more than its current allowance.
### LSP7InvalidTransferBatch
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7InvalidTransferBatch()`
- Error hash: `0x263eee8d`
:::
```solidity
error LSP7InvalidTransferBatch();
```
reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths.
### LSP7NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0xa608fbb6`
:::
```solidity
error LSP7NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x26c247f4`
:::
```solidity
error LSP7NotifyTokenReceiverIsEOA(address tokenReceiver);
```
reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP7RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7revokeoperatornotauthorized)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7RevokeOperatorNotAuthorized(address,address,address)`
- Error hash: `0x1a525b32`
:::
```solidity
error LSP7RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
address operator
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `operator` | `address` | - |
### LSP7TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenContractCannotHoldValue()`
- Error hash: `0x388f5adc`
:::
```solidity
error LSP7TokenContractCannotHoldValue();
```
_LSP7 contract cannot receive native tokens._
Error occurs when sending native tokens to the LSP7 contract without sending any data. E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension.
### LSP7TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `LSP7TokenOwnerCannotBeOperator()`
- Error hash: `0xdab75047`
:::
```solidity
error LSP7TokenOwnerCannotBeOperator();
```
reverts when trying to authorize or revoke the token's owner as an operator.
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OperatorAllowanceCannotBeIncreasedFromZero
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)`
- Error hash: `0xcba6e977`
:::
```solidity
error OperatorAllowanceCannotBeIncreasedFromZero(address operator);
```
Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an operator that does not have any allowance
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Compatibility.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`ILSP4Compatibility.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/ILSP4Compatibility.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`LSP7CompatibleERC20InitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CompatibleERC20InitAbstract.sol
[`LSP7CompatibleERC20.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CompatibleERC20.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP8IdentifiableDigitalAsset
:::info Standard Specifications
[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md)
:::
:::info Solidity implementation
[`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
> Implementation of a LSP8 Identifiable Digital Asset, a contract that represents a non-fungible token.
Standard implementation contract of the LSP8 standard. Minting and transferring are done by providing a unique `tokenId`. This implementation is agnostic to the way tokens are created. A supply mechanism has to be added in a derived contract using [`_mint`](#_mint) For a generic mechanism, see [`LSP7Mintable`](#lsp7mintable).
## 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.
### fallback
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#fallback)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#receive)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP8 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP8 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `authorizeOperator(address,bytes32,bytes)`
- Function selector: `0x86a10ddd`
:::
```solidity
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`](#isoperatorfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------- |
| `operator` | `address` | The address to authorize as an operator. |
| `tokenId` | `bytes32` | The token ID operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### balanceOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of token IDs owned by `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------- |
| `tokenOwner` | `address` | The address to query \* |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------------- |
| `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. |
### batchCalls
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### getData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatchfortokenids)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatchForTokenIds(bytes32[],bytes32[])`
- Function selector: `0x1d26fce6`
:::
```solidity
function getDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys
) external view returns (bytes[] dataValues);
```
_Retrieves data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ---------- | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------------------------------- |
| `dataValues` | `bytes[]` | An array of data values for each pair of `tokenId` and `dataKey`. |
### getDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatafortokenid)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataForTokenId(bytes32,bytes32)`
- Function selector: `0x16e023b3`
:::
```solidity
function getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) external view returns (bytes dataValue);
```
_Retrieves data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------- |
| `dataValue` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### getOperatorsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getOperatorsOf(bytes32)`
- Function selector: `0x49a6078d`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `tokenId` | `bytes32` | The token ID to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------------------------------------------------------------ |
| `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. |
### isOperatorFor
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `isOperatorFor(address,bytes32)`
- Function selector: `0x2a3654a4`
:::
```solidity
function isOperatorFor(
address operator,
bytes32 tokenId
) external view returns (bool);
```
Returns whether `operator` address is an operator for a given `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------- |
| `operator` | `address` | The address to query operator status for. |
| `tokenId` | `bytes32` | The token ID to check if `operator` is allowed to operate on. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------- |
| `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. |
### owner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `revokeOperator(address,bytes32,bool,bytes)`
- Function selector: `0xdb8c9663`
:::
```solidity
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`](#isoperatorfor).
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### setDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatchfortokenids)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatchForTokenIds(bytes32[],bytes32[],bytes[])`
- Function selector: `0xbe9f0e6f`
:::
```solidity
function setDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys,
bytes[] dataValues
) external nonpayable;
```
_Sets data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
| `dataValues` | `bytes[]` | An array of values to set for the given data keys. |
### setDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatafortokenid)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataForTokenId(bytes32,bytes32,bytes)`
- Function selector: `0xd6c1407c`
:::
```solidity
function setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) external nonpayable;
```
_Sets data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### supportsInterface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### tokenIdsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenIdsOf(address)`
- Function selector: `0xa3b261f2`
:::
```solidity
function tokenIdsOf(address tokenOwner) external view returns (bytes32[]);
```
Returns the list of token IDs that the `tokenOwner` address owns.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `tokenOwner` | `address` | The address that we want to get the list of token IDs for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------- |
| `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. |
### tokenOwnerOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenOwnerOf(bytes32)`
- Function selector: `0x217b2270`
:::
```solidity
function tokenOwnerOf(bytes32 tokenId) external view returns (address);
```
Returns the address that owns a given `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------ |
| `tokenId` | `bytes32` | The token ID to query the owner for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The owner address of the given `tokenId`. |
### totalSupply
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transfer(address,address,bytes32,bool,bytes)`
- Function selector: `0x511b6952`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address that owns the given `tokenId`. |
| `to` | `address` | The address that will receive the `tokenId`. |
| `tokenId` | `bytes32` | The token ID to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])`
- Function selector: `0x7e87632c`
:::
```solidity
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
| Name | Type | Description |
| --------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of recipient addresses. |
| `tokenId` | `bytes32[]` | An array of token IDs to transfer. |
| `force` | `bool[]` | 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. |
| `data` | `bytes[]` | Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
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
```solidity
function _isOperatorOrOwner(
address caller,
bytes32 tokenId
) internal view returns (bool);
```
verifies if the `caller` is operator or owner for the `tokenId`
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------- |
| `0` | `bool` | true if `caller` is either operator or owner |
### \_revokeOperator
```solidity
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
```solidity
function _clearOperators(
address tokenOwner,
bytes32 tokenId
) internal nonpayable;
```
revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ------------------------------------------------- |
| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. |
| `tokenId` | `bytes32` | The token to remove the associated operators for. |
### \_exists
```solidity
function _exists(bytes32 tokenId) internal view returns (bool);
```
Returns whether `tokenId` exists.
Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)).
### \_existsOrError
```solidity
function _existsOrError(bytes32 tokenId) internal view;
```
When `tokenId` does not exist then revert with an error.
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Create `tokenId` by minting it and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | @param tokenId The token ID to create (= mint). |
| `tokenId` | `bytes32` | The token ID to create (= mint). |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(bytes32 tokenId, bytes data) internal nonpayable;
```
Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1.
This will also clear all the operators allowed to transfer the `tokenId`.
The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver)
function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- |
| `tokenId` | `bytes32` | The token to burn. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender/recipient via LSP1**.
:::
:::danger
This internal function does not check if the sender is authorized or not to operate on the `tokenId`.
:::
```solidity
function _transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Change the owner of the `tokenId` from `from` to `to`.
Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | @param tokenId The token to transfer. |
| `tokenId` | `bytes32` | The token to transfer. |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### \_setDataForTokenId
```solidity
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
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### \_getDataForTokenId
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ------------ | :-----: | ----------------------------------------------------------------- |
| `dataValues` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### \_beforeTokenTransfer
```solidity
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
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 notifying sender/recipient via LSP1** by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (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`.
:::
```solidity
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`](#_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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,bytes32,bytes)`
- Event topic hash: `0x1b1b58aa2ec0cec2228b2d37124556d41f5a1f7b12f089171f896cc236671215`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator. |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bytes32,bool,bytes)`
- Event topic hash: `0xc78cd419d6136f9f1c1c6aec1d3fae098cffaf8bc86314a8f2685e32fe574e3c`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from the operator array ([`getOperatorsOf`](#getoperatorsof)). |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notified` | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### TokenIdDataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokeniddatachanged)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `TokenIdDataChanged(bytes32,bytes32,bytes)`
- Event topic hash: `0xa6e4251f855f750545fe414f120db91c76b88def14d120969e5bb2d3f05debbb`
:::
```solidity
event TokenIdDataChanged(
bytes32 indexed tokenId,
bytes32 indexed dataKey,
bytes dataValue
);
```
Emitted when setting data for `tokenId`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `tokenId` **`indexed`** | `bytes32` | The tokenId which data is set for. |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `Transfer(address,address,address,bytes32,bool,bytes)`
- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| `operator` | `address` | The address of operator that sent the `tokenId` |
| `from` **`indexed`** | `address` | The previous owner of the `tokenId` |
| `to` **`indexed`** | `address` | The new owner of `tokenId` |
| `tokenId` **`indexed`** | `bytes32` | The tokenId that was transferred |
| `force` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8batchcallfailed)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8BatchCallFailed(uint256)`
- Error hash: `0x234eb819`
:::
```solidity
error LSP8BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP8CannotSendToAddressZero
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotSendToAddressZero()`
- Error hash: `0x24ecef4d`
:::
```solidity
error LSP8CannotSendToAddressZero();
```
Reverts when trying to send token to the zero address.
### LSP8CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotUseAddressZeroAsOperator()`
- Error hash: `0x9577b8b3`
:::
```solidity
error LSP8CannotUseAddressZeroAsOperator();
```
Reverts when trying to set the zero address as an operator.
### LSP8InvalidTransferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8InvalidTransferBatch()`
- Error hash: `0x93a83119`
:::
```solidity
error LSP8InvalidTransferBatch();
```
Reverts when the parameters used for `transferBatch` have different lengths.
### LSP8NonExistentTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistentTokenId(bytes32)`
- Error hash: `0xae8f9a36`
:::
```solidity
error LSP8NonExistentTokenId(bytes32 tokenId);
```
Reverts when `tokenId` has not been minted.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
### LSP8NonExistingOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistingOperator(address,bytes32)`
- Error hash: `0x4aa31a8c`
:::
```solidity
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```
Reverts when `operator` is not an operator for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8NotTokenOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOperator(bytes32,address)`
- Error hash: `0x1294d2a9`
:::
```solidity
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```
Reverts when `caller` is not an allowed operator for `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotTokenOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOwner(address,bytes32,address)`
- Error hash: `0x5b271ea2`
:::
```solidity
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0x4349776d`
:::
```solidity
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x03173137`
:::
```solidity
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8OperatorAlreadyAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)`
- Error hash: `0xa7626b68`
:::
```solidity
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```
Reverts when `operator` is already authorized for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8revokeoperatornotauthorized)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8RevokeOperatorNotAuthorized(address,address,bytes32)`
- Error hash: `0x760b5acd`
:::
```solidity
error LSP8RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
bytes32 tokenId
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokencontractcannotholdvalue)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenContractCannotHoldValue()`
- Error hash: `0x61f49442`
:::
```solidity
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.
### LSP8TokenIdFormatNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformatnoteditable)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdFormatNotEditable()`
- Error hash: `0x3664800a`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdataemptyarray)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataEmptyArray()`
- Error hash: `0x80c98305`
:::
```solidity
error LSP8TokenIdsDataEmptyArray();
```
Reverts when empty arrays is passed to the function
### LSP8TokenIdsDataLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdatalengthmismatch)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataLengthMismatch()`
- Error hash: `0x2fa71dfe`
:::
```solidity
error LSP8TokenIdsDataLengthMismatch();
```
Reverts when the length of the token IDs data arrays is not equal
### LSP8TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerCannotBeOperator()`
- Error hash: `0x89fdad62`
:::
```solidity
error LSP8TokenOwnerCannotBeOperator();
```
Reverts when trying to authorize or revoke the token's owner as an operator.
### LSP8TokenOwnerChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownerchanged)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerChanged(bytes32,address,address)`
- Error hash: `0x5a9c31d3`
:::
```solidity
error LSP8TokenOwnerChanged(
bytes32 tokenId,
address oldOwner,
address newOwner
);
```
Reverts when the token owner changed inside the [`_beforeTokenTransfer`](#_beforetokentransfer) hook.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `oldOwner` | `address` | - |
| `newOwner` | `address` | - |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP8Burnable
:::info Standard Specifications
[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md)
:::
:::info Solidity implementation
[`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
LSP8 token extension that allows token holders to destroy both their own tokens and those that they have an allowance for as an operator.
## 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.
### fallback
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#fallback)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#receive)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP8 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP8 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `authorizeOperator(address,bytes32,bytes)`
- Function selector: `0x86a10ddd`
:::
```solidity
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`](#isoperatorfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------- |
| `operator` | `address` | The address to authorize as an operator. |
| `tokenId` | `bytes32` | The token ID operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### balanceOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of token IDs owned by `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------- |
| `tokenOwner` | `address` | The address to query \* |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------------- |
| `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. |
### batchCalls
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### burn
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#burn)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `burn(bytes32,bytes)`
- Function selector: `0x6c79b70b`
:::
```solidity
function burn(bytes32 tokenId, bytes data) external nonpayable;
```
_Burning tokenId `tokenId`. This tokenId will not be recoverable! (additional data sent: `data`)._
See internal [`_burn`](#_burn) function for details.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------- |
| `tokenId` | `bytes32` | The tokenId to burn. |
| `data` | `bytes` | Any extra data to be sent alongside burning the tokenId. |
### getData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatchfortokenids)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatchForTokenIds(bytes32[],bytes32[])`
- Function selector: `0x1d26fce6`
:::
```solidity
function getDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys
) external view returns (bytes[] dataValues);
```
_Retrieves data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ---------- | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------------------------------- |
| `dataValues` | `bytes[]` | An array of data values for each pair of `tokenId` and `dataKey`. |
### getDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatafortokenid)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataForTokenId(bytes32,bytes32)`
- Function selector: `0x16e023b3`
:::
```solidity
function getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) external view returns (bytes dataValue);
```
_Retrieves data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------- |
| `dataValue` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### getOperatorsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getOperatorsOf(bytes32)`
- Function selector: `0x49a6078d`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `tokenId` | `bytes32` | The token ID to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------------------------------------------------------------ |
| `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. |
### isOperatorFor
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `isOperatorFor(address,bytes32)`
- Function selector: `0x2a3654a4`
:::
```solidity
function isOperatorFor(
address operator,
bytes32 tokenId
) external view returns (bool);
```
Returns whether `operator` address is an operator for a given `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------- |
| `operator` | `address` | The address to query operator status for. |
| `tokenId` | `bytes32` | The token ID to check if `operator` is allowed to operate on. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------- |
| `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. |
### owner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `revokeOperator(address,bytes32,bool,bytes)`
- Function selector: `0xdb8c9663`
:::
```solidity
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`](#isoperatorfor).
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### setDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatchfortokenids)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatchForTokenIds(bytes32[],bytes32[],bytes[])`
- Function selector: `0xbe9f0e6f`
:::
```solidity
function setDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys,
bytes[] dataValues
) external nonpayable;
```
_Sets data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
| `dataValues` | `bytes[]` | An array of values to set for the given data keys. |
### setDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatafortokenid)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataForTokenId(bytes32,bytes32,bytes)`
- Function selector: `0xd6c1407c`
:::
```solidity
function setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) external nonpayable;
```
_Sets data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### supportsInterface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### tokenIdsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenIdsOf(address)`
- Function selector: `0xa3b261f2`
:::
```solidity
function tokenIdsOf(address tokenOwner) external view returns (bytes32[]);
```
Returns the list of token IDs that the `tokenOwner` address owns.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `tokenOwner` | `address` | The address that we want to get the list of token IDs for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------- |
| `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. |
### tokenOwnerOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenOwnerOf(bytes32)`
- Function selector: `0x217b2270`
:::
```solidity
function tokenOwnerOf(bytes32 tokenId) external view returns (address);
```
Returns the address that owns a given `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------ |
| `tokenId` | `bytes32` | The token ID to query the owner for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The owner address of the given `tokenId`. |
### totalSupply
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transfer(address,address,bytes32,bool,bytes)`
- Function selector: `0x511b6952`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address that owns the given `tokenId`. |
| `to` | `address` | The address that will receive the `tokenId`. |
| `tokenId` | `bytes32` | The token ID to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])`
- Function selector: `0x7e87632c`
:::
```solidity
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
| Name | Type | Description |
| --------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of recipient addresses. |
| `tokenId` | `bytes32[]` | An array of token IDs to transfer. |
| `force` | `bool[]` | 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. |
| `data` | `bytes[]` | Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
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
```solidity
function _isOperatorOrOwner(
address caller,
bytes32 tokenId
) internal view returns (bool);
```
verifies if the `caller` is operator or owner for the `tokenId`
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------- |
| `0` | `bool` | true if `caller` is either operator or owner |
### \_revokeOperator
```solidity
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
```solidity
function _clearOperators(
address tokenOwner,
bytes32 tokenId
) internal nonpayable;
```
revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ------------------------------------------------- |
| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. |
| `tokenId` | `bytes32` | The token to remove the associated operators for. |
### \_exists
```solidity
function _exists(bytes32 tokenId) internal view returns (bool);
```
Returns whether `tokenId` exists.
Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)).
### \_existsOrError
```solidity
function _existsOrError(bytes32 tokenId) internal view;
```
When `tokenId` does not exist then revert with an error.
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Create `tokenId` by minting it and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | @param tokenId The token ID to create (= mint). |
| `tokenId` | `bytes32` | The token ID to create (= mint). |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(bytes32 tokenId, bytes data) internal nonpayable;
```
Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1.
This will also clear all the operators allowed to transfer the `tokenId`.
The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver)
function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- |
| `tokenId` | `bytes32` | The token to burn. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender/recipient via LSP1**.
:::
:::danger
This internal function does not check if the sender is authorized or not to operate on the `tokenId`.
:::
```solidity
function _transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Change the owner of the `tokenId` from `from` to `to`.
Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | @param tokenId The token to transfer. |
| `tokenId` | `bytes32` | The token to transfer. |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### \_setDataForTokenId
```solidity
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
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### \_getDataForTokenId
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ------------ | :-----: | ----------------------------------------------------------------- |
| `dataValues` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### \_beforeTokenTransfer
```solidity
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
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 notifying sender/recipient via LSP1** by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (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`.
:::
```solidity
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`](#_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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,bytes32,bytes)`
- Event topic hash: `0x1b1b58aa2ec0cec2228b2d37124556d41f5a1f7b12f089171f896cc236671215`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator. |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bytes32,bool,bytes)`
- Event topic hash: `0xc78cd419d6136f9f1c1c6aec1d3fae098cffaf8bc86314a8f2685e32fe574e3c`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from the operator array ([`getOperatorsOf`](#getoperatorsof)). |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notified` | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### TokenIdDataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokeniddatachanged)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `TokenIdDataChanged(bytes32,bytes32,bytes)`
- Event topic hash: `0xa6e4251f855f750545fe414f120db91c76b88def14d120969e5bb2d3f05debbb`
:::
```solidity
event TokenIdDataChanged(
bytes32 indexed tokenId,
bytes32 indexed dataKey,
bytes dataValue
);
```
Emitted when setting data for `tokenId`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `tokenId` **`indexed`** | `bytes32` | The tokenId which data is set for. |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `Transfer(address,address,address,bytes32,bool,bytes)`
- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| `operator` | `address` | The address of operator that sent the `tokenId` |
| `from` **`indexed`** | `address` | The previous owner of the `tokenId` |
| `to` **`indexed`** | `address` | The new owner of `tokenId` |
| `tokenId` **`indexed`** | `bytes32` | The tokenId that was transferred |
| `force` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8batchcallfailed)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8BatchCallFailed(uint256)`
- Error hash: `0x234eb819`
:::
```solidity
error LSP8BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP8CannotSendToAddressZero
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotSendToAddressZero()`
- Error hash: `0x24ecef4d`
:::
```solidity
error LSP8CannotSendToAddressZero();
```
Reverts when trying to send token to the zero address.
### LSP8CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotUseAddressZeroAsOperator()`
- Error hash: `0x9577b8b3`
:::
```solidity
error LSP8CannotUseAddressZeroAsOperator();
```
Reverts when trying to set the zero address as an operator.
### LSP8InvalidTransferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8InvalidTransferBatch()`
- Error hash: `0x93a83119`
:::
```solidity
error LSP8InvalidTransferBatch();
```
Reverts when the parameters used for `transferBatch` have different lengths.
### LSP8NonExistentTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistentTokenId(bytes32)`
- Error hash: `0xae8f9a36`
:::
```solidity
error LSP8NonExistentTokenId(bytes32 tokenId);
```
Reverts when `tokenId` has not been minted.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
### LSP8NonExistingOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistingOperator(address,bytes32)`
- Error hash: `0x4aa31a8c`
:::
```solidity
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```
Reverts when `operator` is not an operator for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8NotTokenOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOperator(bytes32,address)`
- Error hash: `0x1294d2a9`
:::
```solidity
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```
Reverts when `caller` is not an allowed operator for `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotTokenOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOwner(address,bytes32,address)`
- Error hash: `0x5b271ea2`
:::
```solidity
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0x4349776d`
:::
```solidity
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x03173137`
:::
```solidity
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8OperatorAlreadyAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)`
- Error hash: `0xa7626b68`
:::
```solidity
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```
Reverts when `operator` is already authorized for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8revokeoperatornotauthorized)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8RevokeOperatorNotAuthorized(address,address,bytes32)`
- Error hash: `0x760b5acd`
:::
```solidity
error LSP8RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
bytes32 tokenId
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokencontractcannotholdvalue)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenContractCannotHoldValue()`
- Error hash: `0x61f49442`
:::
```solidity
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.
### LSP8TokenIdFormatNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformatnoteditable)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdFormatNotEditable()`
- Error hash: `0x3664800a`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdataemptyarray)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataEmptyArray()`
- Error hash: `0x80c98305`
:::
```solidity
error LSP8TokenIdsDataEmptyArray();
```
Reverts when empty arrays is passed to the function
### LSP8TokenIdsDataLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdatalengthmismatch)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataLengthMismatch()`
- Error hash: `0x2fa71dfe`
:::
```solidity
error LSP8TokenIdsDataLengthMismatch();
```
Reverts when the length of the token IDs data arrays is not equal
### LSP8TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerCannotBeOperator()`
- Error hash: `0x89fdad62`
:::
```solidity
error LSP8TokenOwnerCannotBeOperator();
```
Reverts when trying to authorize or revoke the token's owner as an operator.
### LSP8TokenOwnerChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownerchanged)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerChanged(bytes32,address,address)`
- Error hash: `0x5a9c31d3`
:::
```solidity
error LSP8TokenOwnerChanged(
bytes32 tokenId,
address oldOwner,
address newOwner
);
```
Reverts when the token owner changed inside the [`_beforeTokenTransfer`](#_beforetokentransfer) hook.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `oldOwner` | `address` | - |
| `newOwner` | `address` | - |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP8CappedSupply
:::info Standard Specifications
[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md)
:::
:::info Solidity implementation
[`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
LSP8 token extension to add a max token supply cap.
## 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.
### fallback
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#fallback)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#receive)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP8 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP8 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `authorizeOperator(address,bytes32,bytes)`
- Function selector: `0x86a10ddd`
:::
```solidity
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`](#isoperatorfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------- |
| `operator` | `address` | The address to authorize as an operator. |
| `tokenId` | `bytes32` | The token ID operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### balanceOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of token IDs owned by `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------- |
| `tokenOwner` | `address` | The address to query \* |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------------- |
| `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. |
### batchCalls
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### getData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatchfortokenids)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatchForTokenIds(bytes32[],bytes32[])`
- Function selector: `0x1d26fce6`
:::
```solidity
function getDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys
) external view returns (bytes[] dataValues);
```
_Retrieves data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ---------- | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------------------------------- |
| `dataValues` | `bytes[]` | An array of data values for each pair of `tokenId` and `dataKey`. |
### getDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatafortokenid)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataForTokenId(bytes32,bytes32)`
- Function selector: `0x16e023b3`
:::
```solidity
function getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) external view returns (bytes dataValue);
```
_Retrieves data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------- |
| `dataValue` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### getOperatorsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getOperatorsOf(bytes32)`
- Function selector: `0x49a6078d`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `tokenId` | `bytes32` | The token ID to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------------------------------------------------------------ |
| `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. |
### isOperatorFor
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `isOperatorFor(address,bytes32)`
- Function selector: `0x2a3654a4`
:::
```solidity
function isOperatorFor(
address operator,
bytes32 tokenId
) external view returns (bool);
```
Returns whether `operator` address is an operator for a given `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------- |
| `operator` | `address` | The address to query operator status for. |
| `tokenId` | `bytes32` | The token ID to check if `operator` is allowed to operate on. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------- |
| `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. |
### owner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `revokeOperator(address,bytes32,bool,bytes)`
- Function selector: `0xdb8c9663`
:::
```solidity
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`](#isoperatorfor).
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### setDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatchfortokenids)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatchForTokenIds(bytes32[],bytes32[],bytes[])`
- Function selector: `0xbe9f0e6f`
:::
```solidity
function setDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys,
bytes[] dataValues
) external nonpayable;
```
_Sets data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
| `dataValues` | `bytes[]` | An array of values to set for the given data keys. |
### setDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatafortokenid)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataForTokenId(bytes32,bytes32,bytes)`
- Function selector: `0xd6c1407c`
:::
```solidity
function setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) external nonpayable;
```
_Sets data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### supportsInterface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### tokenIdsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenIdsOf(address)`
- Function selector: `0xa3b261f2`
:::
```solidity
function tokenIdsOf(address tokenOwner) external view returns (bytes32[]);
```
Returns the list of token IDs that the `tokenOwner` address owns.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `tokenOwner` | `address` | The address that we want to get the list of token IDs for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------- |
| `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. |
### tokenOwnerOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenOwnerOf(bytes32)`
- Function selector: `0x217b2270`
:::
```solidity
function tokenOwnerOf(bytes32 tokenId) external view returns (address);
```
Returns the address that owns a given `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------ |
| `tokenId` | `bytes32` | The token ID to query the owner for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The owner address of the given `tokenId`. |
### tokenSupplyCap
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokensupplycap)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenSupplyCap()`
- Function selector: `0x52058d8a`
:::
```solidity
function tokenSupplyCap() external view returns (uint256);
```
_The maximum supply amount of tokens allowed to exist is `_TOKEN_SUPPLY_CAP`._
Get the maximum number of tokens that can exist to circulate. Once [`totalSupply`](#totalsupply) reaches reaches [`totalSuuplyCap`](#totalsuuplycap), it is not possible to mint more tokens.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------ |
| `0` | `uint256` | The maximum number of tokens that can exist in the contract. |
### totalSupply
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transfer(address,address,bytes32,bool,bytes)`
- Function selector: `0x511b6952`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address that owns the given `tokenId`. |
| `to` | `address` | The address that will receive the `tokenId`. |
| `tokenId` | `bytes32` | The token ID to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])`
- Function selector: `0x7e87632c`
:::
```solidity
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
| Name | Type | Description |
| --------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of recipient addresses. |
| `tokenId` | `bytes32[]` | An array of token IDs to transfer. |
| `force` | `bool[]` | 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. |
| `data` | `bytes[]` | Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
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
```solidity
function _isOperatorOrOwner(
address caller,
bytes32 tokenId
) internal view returns (bool);
```
verifies if the `caller` is operator or owner for the `tokenId`
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------- |
| `0` | `bool` | true if `caller` is either operator or owner |
### \_revokeOperator
```solidity
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
```solidity
function _clearOperators(
address tokenOwner,
bytes32 tokenId
) internal nonpayable;
```
revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ------------------------------------------------- |
| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. |
| `tokenId` | `bytes32` | The token to remove the associated operators for. |
### \_exists
```solidity
function _exists(bytes32 tokenId) internal view returns (bool);
```
Returns whether `tokenId` exists.
Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)).
### \_existsOrError
```solidity
function _existsOrError(bytes32 tokenId) internal view;
```
When `tokenId` does not exist then revert with an error.
### \_mint
```solidity
function _mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Same as [`_mint`](#_mint) but allows to mint only if newly minted `tokenId` does not increase the [`totalSupply`](#totalsupply)
over the [`tokenSupplyCap`](#tokensupplycap).
after a new `tokenId` has of tokens have been minted.
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(bytes32 tokenId, bytes data) internal nonpayable;
```
Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1.
This will also clear all the operators allowed to transfer the `tokenId`.
The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver)
function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- |
| `tokenId` | `bytes32` | The token to burn. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender/recipient via LSP1**.
:::
:::danger
This internal function does not check if the sender is authorized or not to operate on the `tokenId`.
:::
```solidity
function _transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Change the owner of the `tokenId` from `from` to `to`.
Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | @param tokenId The token to transfer. |
| `tokenId` | `bytes32` | The token to transfer. |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### \_setDataForTokenId
```solidity
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
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### \_getDataForTokenId
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ------------ | :-----: | ----------------------------------------------------------------- |
| `dataValues` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### \_beforeTokenTransfer
```solidity
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
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 notifying sender/recipient via LSP1** by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (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`.
:::
```solidity
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`](#_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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,bytes32,bytes)`
- Event topic hash: `0x1b1b58aa2ec0cec2228b2d37124556d41f5a1f7b12f089171f896cc236671215`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator. |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bytes32,bool,bytes)`
- Event topic hash: `0xc78cd419d6136f9f1c1c6aec1d3fae098cffaf8bc86314a8f2685e32fe574e3c`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from the operator array ([`getOperatorsOf`](#getoperatorsof)). |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notified` | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### TokenIdDataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokeniddatachanged)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `TokenIdDataChanged(bytes32,bytes32,bytes)`
- Event topic hash: `0xa6e4251f855f750545fe414f120db91c76b88def14d120969e5bb2d3f05debbb`
:::
```solidity
event TokenIdDataChanged(
bytes32 indexed tokenId,
bytes32 indexed dataKey,
bytes dataValue
);
```
Emitted when setting data for `tokenId`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `tokenId` **`indexed`** | `bytes32` | The tokenId which data is set for. |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `Transfer(address,address,address,bytes32,bool,bytes)`
- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| `operator` | `address` | The address of operator that sent the `tokenId` |
| `from` **`indexed`** | `address` | The previous owner of the `tokenId` |
| `to` **`indexed`** | `address` | The new owner of `tokenId` |
| `tokenId` **`indexed`** | `bytes32` | The tokenId that was transferred |
| `force` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8batchcallfailed)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8BatchCallFailed(uint256)`
- Error hash: `0x234eb819`
:::
```solidity
error LSP8BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP8CannotSendToAddressZero
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotSendToAddressZero()`
- Error hash: `0x24ecef4d`
:::
```solidity
error LSP8CannotSendToAddressZero();
```
Reverts when trying to send token to the zero address.
### LSP8CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotUseAddressZeroAsOperator()`
- Error hash: `0x9577b8b3`
:::
```solidity
error LSP8CannotUseAddressZeroAsOperator();
```
Reverts when trying to set the zero address as an operator.
### LSP8CappedSupplyCannotMintOverCap
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cappedsupplycannotmintovercap)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CappedSupplyCannotMintOverCap()`
- Error hash: `0xe8ba2291`
:::
```solidity
error LSP8CappedSupplyCannotMintOverCap();
```
_Cannot mint anymore as total supply reached the maximum cap._
Reverts when trying to mint tokens but the [`totalSupply`](#totalsupply) has reached the maximum [`tokenSupplyCap`](#tokensupplycap).
### LSP8CappedSupplyRequired
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cappedsupplyrequired)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CappedSupplyRequired()`
- Error hash: `0x38d9fc30`
:::
```solidity
error LSP8CappedSupplyRequired();
```
_The `tokenSupplyCap` must be set and cannot be `0`._
Reverts when setting `0` for the [`tokenSupplyCap`](#tokensupplycap). The max token supply MUST be set to a number greater than 0.
### LSP8InvalidTransferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8InvalidTransferBatch()`
- Error hash: `0x93a83119`
:::
```solidity
error LSP8InvalidTransferBatch();
```
Reverts when the parameters used for `transferBatch` have different lengths.
### LSP8NonExistentTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistentTokenId(bytes32)`
- Error hash: `0xae8f9a36`
:::
```solidity
error LSP8NonExistentTokenId(bytes32 tokenId);
```
Reverts when `tokenId` has not been minted.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
### LSP8NonExistingOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistingOperator(address,bytes32)`
- Error hash: `0x4aa31a8c`
:::
```solidity
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```
Reverts when `operator` is not an operator for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8NotTokenOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOperator(bytes32,address)`
- Error hash: `0x1294d2a9`
:::
```solidity
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```
Reverts when `caller` is not an allowed operator for `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotTokenOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOwner(address,bytes32,address)`
- Error hash: `0x5b271ea2`
:::
```solidity
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0x4349776d`
:::
```solidity
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x03173137`
:::
```solidity
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8OperatorAlreadyAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)`
- Error hash: `0xa7626b68`
:::
```solidity
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```
Reverts when `operator` is already authorized for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8revokeoperatornotauthorized)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8RevokeOperatorNotAuthorized(address,address,bytes32)`
- Error hash: `0x760b5acd`
:::
```solidity
error LSP8RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
bytes32 tokenId
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokencontractcannotholdvalue)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenContractCannotHoldValue()`
- Error hash: `0x61f49442`
:::
```solidity
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.
### LSP8TokenIdFormatNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformatnoteditable)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdFormatNotEditable()`
- Error hash: `0x3664800a`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdataemptyarray)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataEmptyArray()`
- Error hash: `0x80c98305`
:::
```solidity
error LSP8TokenIdsDataEmptyArray();
```
Reverts when empty arrays is passed to the function
### LSP8TokenIdsDataLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdatalengthmismatch)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataLengthMismatch()`
- Error hash: `0x2fa71dfe`
:::
```solidity
error LSP8TokenIdsDataLengthMismatch();
```
Reverts when the length of the token IDs data arrays is not equal
### LSP8TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerCannotBeOperator()`
- Error hash: `0x89fdad62`
:::
```solidity
error LSP8TokenOwnerCannotBeOperator();
```
Reverts when trying to authorize or revoke the token's owner as an operator.
### LSP8TokenOwnerChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownerchanged)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerChanged(bytes32,address,address)`
- Error hash: `0x5a9c31d3`
:::
```solidity
error LSP8TokenOwnerChanged(
bytes32 tokenId,
address oldOwner,
address newOwner
);
```
Reverts when the token owner changed inside the [`_beforeTokenTransfer`](#_beforetokentransfer) hook.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `oldOwner` | `address` | - |
| `newOwner` | `address` | - |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP8Enumerable
:::info Standard Specifications
[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md)
:::
:::info Solidity implementation
[`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
LSP8 extension that enables to enumerate over all the `tokenIds` ever minted.
## 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.
### fallback
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#fallback)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#receive)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP8 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP8 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `authorizeOperator(address,bytes32,bytes)`
- Function selector: `0x86a10ddd`
:::
```solidity
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`](#isoperatorfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------- |
| `operator` | `address` | The address to authorize as an operator. |
| `tokenId` | `bytes32` | The token ID operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### balanceOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of token IDs owned by `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------- |
| `tokenOwner` | `address` | The address to query \* |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------------- |
| `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. |
### batchCalls
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### getData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatchfortokenids)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatchForTokenIds(bytes32[],bytes32[])`
- Function selector: `0x1d26fce6`
:::
```solidity
function getDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys
) external view returns (bytes[] dataValues);
```
_Retrieves data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ---------- | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------------------------------- |
| `dataValues` | `bytes[]` | An array of data values for each pair of `tokenId` and `dataKey`. |
### getDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatafortokenid)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataForTokenId(bytes32,bytes32)`
- Function selector: `0x16e023b3`
:::
```solidity
function getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) external view returns (bytes dataValue);
```
_Retrieves data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------- |
| `dataValue` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### getOperatorsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getOperatorsOf(bytes32)`
- Function selector: `0x49a6078d`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `tokenId` | `bytes32` | The token ID to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------------------------------------------------------------ |
| `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. |
### isOperatorFor
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `isOperatorFor(address,bytes32)`
- Function selector: `0x2a3654a4`
:::
```solidity
function isOperatorFor(
address operator,
bytes32 tokenId
) external view returns (bool);
```
Returns whether `operator` address is an operator for a given `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------- |
| `operator` | `address` | The address to query operator status for. |
| `tokenId` | `bytes32` | The token ID to check if `operator` is allowed to operate on. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------- |
| `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. |
### owner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `revokeOperator(address,bytes32,bool,bytes)`
- Function selector: `0xdb8c9663`
:::
```solidity
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`](#isoperatorfor).
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### setDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatchfortokenids)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatchForTokenIds(bytes32[],bytes32[],bytes[])`
- Function selector: `0xbe9f0e6f`
:::
```solidity
function setDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys,
bytes[] dataValues
) external nonpayable;
```
_Sets data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
| `dataValues` | `bytes[]` | An array of values to set for the given data keys. |
### setDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatafortokenid)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataForTokenId(bytes32,bytes32,bytes)`
- Function selector: `0xd6c1407c`
:::
```solidity
function setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) external nonpayable;
```
_Sets data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### supportsInterface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### tokenAt
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenat)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenAt(uint256)`
- Function selector: `0x92a91a3a`
:::
```solidity
function tokenAt(uint256 index) external view returns (bytes32);
```
_Retrieving the `tokenId` for `msg.sender` located in its list at index number `index`._
Returns a token id at index. See [`totalSupply`](#totalsupply) to get total number of minted tokens.
#### Parameters
| Name | Type | Description |
| ------- | :-------: | -------------------------------------------------------- |
| `index` | `uint256` | The index to search to search in the enumerable mapping. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------- |
| `0` | `bytes32` | TokenId or `bytes32(0)` if no tokenId exist at `index`. |
### tokenIdsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenIdsOf(address)`
- Function selector: `0xa3b261f2`
:::
```solidity
function tokenIdsOf(address tokenOwner) external view returns (bytes32[]);
```
Returns the list of token IDs that the `tokenOwner` address owns.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `tokenOwner` | `address` | The address that we want to get the list of token IDs for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------- |
| `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. |
### tokenOwnerOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenOwnerOf(bytes32)`
- Function selector: `0x217b2270`
:::
```solidity
function tokenOwnerOf(bytes32 tokenId) external view returns (address);
```
Returns the address that owns a given `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------ |
| `tokenId` | `bytes32` | The token ID to query the owner for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The owner address of the given `tokenId`. |
### totalSupply
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transfer(address,address,bytes32,bool,bytes)`
- Function selector: `0x511b6952`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address that owns the given `tokenId`. |
| `to` | `address` | The address that will receive the `tokenId`. |
| `tokenId` | `bytes32` | The token ID to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])`
- Function selector: `0x7e87632c`
:::
```solidity
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
| Name | Type | Description |
| --------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of recipient addresses. |
| `tokenId` | `bytes32[]` | An array of token IDs to transfer. |
| `force` | `bool[]` | 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. |
| `data` | `bytes[]` | Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
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
```solidity
function _isOperatorOrOwner(
address caller,
bytes32 tokenId
) internal view returns (bool);
```
verifies if the `caller` is operator or owner for the `tokenId`
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------- |
| `0` | `bool` | true if `caller` is either operator or owner |
### \_revokeOperator
```solidity
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
```solidity
function _clearOperators(
address tokenOwner,
bytes32 tokenId
) internal nonpayable;
```
revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ------------------------------------------------- |
| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. |
| `tokenId` | `bytes32` | The token to remove the associated operators for. |
### \_exists
```solidity
function _exists(bytes32 tokenId) internal view returns (bool);
```
Returns whether `tokenId` exists.
Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)).
### \_existsOrError
```solidity
function _existsOrError(bytes32 tokenId) internal view;
```
When `tokenId` does not exist then revert with an error.
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Create `tokenId` by minting it and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | @param tokenId The token ID to create (= mint). |
| `tokenId` | `bytes32` | The token ID to create (= mint). |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(bytes32 tokenId, bytes data) internal nonpayable;
```
Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1.
This will also clear all the operators allowed to transfer the `tokenId`.
The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver)
function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- |
| `tokenId` | `bytes32` | The token to burn. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender/recipient via LSP1**.
:::
:::danger
This internal function does not check if the sender is authorized or not to operate on the `tokenId`.
:::
```solidity
function _transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Change the owner of the `tokenId` from `from` to `to`.
Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | @param tokenId The token to transfer. |
| `tokenId` | `bytes32` | The token to transfer. |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### \_setDataForTokenId
```solidity
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
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### \_getDataForTokenId
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ------------ | :-----: | ----------------------------------------------------------------- |
| `dataValues` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### \_beforeTokenTransfer
```solidity
function _beforeTokenTransfer(
address from,
address to,
bytes32 tokenId,
bytes data
) internal nonpayable;
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------- |
| `from` | `address` | The address sending the `tokenId` (`address(0)` when `tokenId` is being minted). |
| `to` | `address` | @param tokenId The bytes32 identifier of the token being transferred. |
| `tokenId` | `bytes32` | The bytes32 identifier of the token being transferred. |
| `data` | `bytes` | The data sent alongside the the token transfer. |
### \_afterTokenTransfer
```solidity
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 notifying sender/recipient via LSP1** by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (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`.
:::
```solidity
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`](#_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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,bytes32,bytes)`
- Event topic hash: `0x1b1b58aa2ec0cec2228b2d37124556d41f5a1f7b12f089171f896cc236671215`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator. |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bytes32,bool,bytes)`
- Event topic hash: `0xc78cd419d6136f9f1c1c6aec1d3fae098cffaf8bc86314a8f2685e32fe574e3c`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from the operator array ([`getOperatorsOf`](#getoperatorsof)). |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notified` | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### TokenIdDataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokeniddatachanged)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `TokenIdDataChanged(bytes32,bytes32,bytes)`
- Event topic hash: `0xa6e4251f855f750545fe414f120db91c76b88def14d120969e5bb2d3f05debbb`
:::
```solidity
event TokenIdDataChanged(
bytes32 indexed tokenId,
bytes32 indexed dataKey,
bytes dataValue
);
```
Emitted when setting data for `tokenId`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `tokenId` **`indexed`** | `bytes32` | The tokenId which data is set for. |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `Transfer(address,address,address,bytes32,bool,bytes)`
- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| `operator` | `address` | The address of operator that sent the `tokenId` |
| `from` **`indexed`** | `address` | The previous owner of the `tokenId` |
| `to` **`indexed`** | `address` | The new owner of `tokenId` |
| `tokenId` **`indexed`** | `bytes32` | The tokenId that was transferred |
| `force` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8batchcallfailed)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8BatchCallFailed(uint256)`
- Error hash: `0x234eb819`
:::
```solidity
error LSP8BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP8CannotSendToAddressZero
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotSendToAddressZero()`
- Error hash: `0x24ecef4d`
:::
```solidity
error LSP8CannotSendToAddressZero();
```
Reverts when trying to send token to the zero address.
### LSP8CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotUseAddressZeroAsOperator()`
- Error hash: `0x9577b8b3`
:::
```solidity
error LSP8CannotUseAddressZeroAsOperator();
```
Reverts when trying to set the zero address as an operator.
### LSP8InvalidTransferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8InvalidTransferBatch()`
- Error hash: `0x93a83119`
:::
```solidity
error LSP8InvalidTransferBatch();
```
Reverts when the parameters used for `transferBatch` have different lengths.
### LSP8NonExistentTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistentTokenId(bytes32)`
- Error hash: `0xae8f9a36`
:::
```solidity
error LSP8NonExistentTokenId(bytes32 tokenId);
```
Reverts when `tokenId` has not been minted.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
### LSP8NonExistingOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistingOperator(address,bytes32)`
- Error hash: `0x4aa31a8c`
:::
```solidity
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```
Reverts when `operator` is not an operator for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8NotTokenOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOperator(bytes32,address)`
- Error hash: `0x1294d2a9`
:::
```solidity
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```
Reverts when `caller` is not an allowed operator for `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotTokenOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOwner(address,bytes32,address)`
- Error hash: `0x5b271ea2`
:::
```solidity
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0x4349776d`
:::
```solidity
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x03173137`
:::
```solidity
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8OperatorAlreadyAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)`
- Error hash: `0xa7626b68`
:::
```solidity
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```
Reverts when `operator` is already authorized for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8revokeoperatornotauthorized)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8RevokeOperatorNotAuthorized(address,address,bytes32)`
- Error hash: `0x760b5acd`
:::
```solidity
error LSP8RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
bytes32 tokenId
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokencontractcannotholdvalue)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenContractCannotHoldValue()`
- Error hash: `0x61f49442`
:::
```solidity
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.
### LSP8TokenIdFormatNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformatnoteditable)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdFormatNotEditable()`
- Error hash: `0x3664800a`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdataemptyarray)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataEmptyArray()`
- Error hash: `0x80c98305`
:::
```solidity
error LSP8TokenIdsDataEmptyArray();
```
Reverts when empty arrays is passed to the function
### LSP8TokenIdsDataLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdatalengthmismatch)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataLengthMismatch()`
- Error hash: `0x2fa71dfe`
:::
```solidity
error LSP8TokenIdsDataLengthMismatch();
```
Reverts when the length of the token IDs data arrays is not equal
### LSP8TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerCannotBeOperator()`
- Error hash: `0x89fdad62`
:::
```solidity
error LSP8TokenOwnerCannotBeOperator();
```
Reverts when trying to authorize or revoke the token's owner as an operator.
### LSP8TokenOwnerChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownerchanged)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerChanged(bytes32,address,address)`
- Error hash: `0x5a9c31d3`
:::
```solidity
error LSP8TokenOwnerChanged(
bytes32 tokenId,
address oldOwner,
address newOwner
);
```
Reverts when the token owner changed inside the [`_beforeTokenTransfer`](#_beforetokentransfer) hook.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `oldOwner` | `address` | - |
| `newOwner` | `address` | - |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP8Mintable
:::info Standard Specifications
[`LSP-8-IdentifiableDigitalAsset`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md)
:::
:::info Solidity implementation
[`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
> LSP8IdentifiableDigitalAsset deployable preset contract with a public [`mint`](#mint) function callable only by the contract [`owner`](#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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#constructor)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
constructor(
string name_,
string symbol_,
address newOwner_,
uint256 lsp4TokenType_,
uint256 lsp8TokenIdFormat_
);
```
_Deploying a `LSP8Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `name_` | `string` | The name of the token. |
| `symbol_` | `string` | The symbol of the token. |
| `newOwner_` | `address` | The owner of the token contract. |
| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection). |
| `lsp8TokenIdFormat_` | `uint256` | The format of tokenIds (= NFTs) that this contract will create. |
### fallback
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#fallback)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
### receive
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#receive)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
:::
```solidity
receive() external payable;
```
_LSP8 contract cannot receive native tokens._
Reverts whenever someone tries to send native tokens to a LSP8 contract.
### authorizeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#authorizeoperator)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `authorizeOperator(address,bytes32,bytes)`
- Function selector: `0x86a10ddd`
:::
```solidity
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`](#isoperatorfor). Notify the operator based on the LSP1-UniversalReceiver standard
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | ----------------------------------------------- |
| `operator` | `address` | The address to authorize as an operator. |
| `tokenId` | `bytes32` | The token ID operator has access to. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### balanceOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#balanceof)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `balanceOf(address)`
- Function selector: `0x70a08231`
:::
```solidity
function balanceOf(address tokenOwner) external view returns (uint256);
```
Get the number of token IDs owned by `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------- |
| `tokenOwner` | `address` | The address to query \* |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------------- |
| `0` | `uint256` | The total number of token IDs that `tokenOwner` owns. |
### batchCalls
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#batchcalls)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### getData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdata)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatch)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### getDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatabatchfortokenids)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataBatchForTokenIds(bytes32[],bytes32[])`
- Function selector: `0x1d26fce6`
:::
```solidity
function getDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys
) external view returns (bytes[] dataValues);
```
_Retrieves data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ---------- | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------------------------------- |
| `dataValues` | `bytes[]` | An array of data values for each pair of `tokenId` and `dataKey`. |
### getDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getdatafortokenid)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getDataForTokenId(bytes32,bytes32)`
- Function selector: `0x16e023b3`
:::
```solidity
function getDataForTokenId(
bytes32 tokenId,
bytes32 dataKey
) external view returns (bytes dataValue);
```
_Retrieves data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------- |
| `dataValue` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### getOperatorsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#getoperatorsof)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `getOperatorsOf(bytes32)`
- Function selector: `0x49a6078d`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `tokenId` | `bytes32` | The token ID to get the operators for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------------------------------------------------------------ |
| `0` | `address[]` | An array of operators allowed to transfer or burn a specific `tokenId`. Requirements - `tokenId` must exist. |
### isOperatorFor
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#isoperatorfor)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `isOperatorFor(address,bytes32)`
- Function selector: `0x2a3654a4`
:::
```solidity
function isOperatorFor(
address operator,
bytes32 tokenId
) external view returns (bool);
```
Returns whether `operator` address is an operator for a given `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------- |
| `operator` | `address` | The address to query operator status for. |
| `tokenId` | `bytes32` | The token ID to check if `operator` is allowed to operate on. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------- |
| `0` | `bool` | `true` if `operator` is an operator for `tokenId`, `false` otherwise. |
### mint
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#mint)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `mint(address,bytes32,bool,bytes)`
- Function selector: `0xaf255b61`
:::
```solidity
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`](#_mint) function only callable by the [`owner`](#owner).
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------ |
| `to` | `address` | The address that will receive the minted `tokenId`. |
| `tokenId` | `bytes32` | The tokenId to mint. |
| `force` | `bool` | Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting. |
| `data` | `bytes` | Any addition data to be sent alongside the minting. |
### owner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#owner)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#renounceownership)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#revokeoperator)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `revokeOperator(address,bytes32,bool,bytes)`
- Function selector: `0xdb8c9663`
:::
```solidity
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`](#isoperatorfor).
#### Parameters
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------- |
| `operator` | `address` | The address to revoke as an operator. |
| `tokenId` | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notify` | `bool` | Boolean indicating whether to notify the operator or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### setData
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdata)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
:::caution 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**.
:::
```solidity
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`](#owner).
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatch)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
:::caution 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**.
:::
```solidity
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`](#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`](#owner) of the contract.
**Emitted events:**
- [`DataChanged`](#datachanged) event **for each data key/value pair set**.
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### setDataBatchForTokenIds
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatabatchfortokenids)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataBatchForTokenIds(bytes32[],bytes32[],bytes[])`
- Function selector: `0xbe9f0e6f`
:::
```solidity
function setDataBatchForTokenIds(
bytes32[] tokenIds,
bytes32[] dataKeys,
bytes[] dataValues
) external nonpayable;
```
_Sets data in batch for multiple `tokenId` and `dataKey` pairs._
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ----------------------------------------------------- |
| `tokenIds` | `bytes32[]` | An array of token IDs. |
| `dataKeys` | `bytes32[]` | An array of data keys corresponding to the token IDs. |
| `dataValues` | `bytes[]` | An array of values to set for the given data keys. |
### setDataForTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#setdatafortokenid)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `setDataForTokenId(bytes32,bytes32,bytes)`
- Function selector: `0xd6c1407c`
:::
```solidity
function setDataForTokenId(
bytes32 tokenId,
bytes32 dataKey,
bytes dataValue
) external nonpayable;
```
_Sets data for a specific `tokenId` and `dataKey`._
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### supportsInterface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#supportsinterface)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
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
| Name | Type | Description |
| ------------- | :------: | ----------- |
| `interfaceId` | `bytes4` | - |
#### Returns
| Name | Type | Description |
| ---- | :----: | ----------- |
| `0` | `bool` | - |
### tokenIdsOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenidsof)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenIdsOf(address)`
- Function selector: `0xa3b261f2`
:::
```solidity
function tokenIdsOf(address tokenOwner) external view returns (bytes32[]);
```
Returns the list of token IDs that the `tokenOwner` address owns.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------- |
| `tokenOwner` | `address` | The address that we want to get the list of token IDs for. |
#### Returns
| Name | Type | Description |
| ---- | :---------: | ------------------------------------------------------- |
| `0` | `bytes32[]` | An array of `bytes32[] tokenIds` owned by `tokenOwner`. |
### tokenOwnerOf
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokenownerof)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `tokenOwnerOf(bytes32)`
- Function selector: `0x217b2270`
:::
```solidity
function tokenOwnerOf(bytes32 tokenId) external view returns (address);
```
Returns the address that owns a given `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ------------------------------------ |
| `tokenId` | `bytes32` | The token ID to query the owner for. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------- |
| `0` | `address` | The owner address of the given `tokenId`. |
### totalSupply
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#totalsupply)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `totalSupply()`
- Function selector: `0x18160ddd`
:::
```solidity
function totalSupply() external view returns (uint256);
```
Returns the number of existing tokens that have been minted in this contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------ |
| `0` | `uint256` | The number of existing tokens. |
### transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transfer(address,address,bytes32,bool,bytes)`
- Function selector: `0x511b6952`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The address that owns the given `tokenId`. |
| `to` | `address` | The address that will receive the `tokenId`. |
| `tokenId` | `bytes32` | The token ID to transfer. |
| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. |
### transferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferbatch)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferBatch(address[],address[],bytes32[],bool[],bytes[])`
- Function selector: `0x7e87632c`
:::
```solidity
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
| Name | Type | Description |
| --------- | :---------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address[]` | An array of sending addresses. |
| `to` | `address[]` | An array of recipient addresses. |
| `tokenId` | `bytes32[]` | An array of token IDs to transfer. |
| `force` | `bool[]` | 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. |
| `data` | `bytes[]` | Any additional data the caller wants included in the emitted event, and sent in the hooks to the `from` and `to` addresses. |
### transferOwnership
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transferownership)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `newOwner` | `address` | - |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
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
```solidity
function _isOperatorOrOwner(
address caller,
bytes32 tokenId
) internal view returns (bool);
```
verifies if the `caller` is operator or owner for the `tokenId`
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------- |
| `0` | `bool` | true if `caller` is either operator or owner |
### \_revokeOperator
```solidity
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
```solidity
function _clearOperators(
address tokenOwner,
bytes32 tokenId
) internal nonpayable;
```
revoke all the current operators for a specific `tokenId` token which belongs to `tokenOwner`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ------------------------------------------------- |
| `tokenOwner` | `address` | The address that is the owner of the `tokenId`. |
| `tokenId` | `bytes32` | The token to remove the associated operators for. |
### \_exists
```solidity
function _exists(bytes32 tokenId) internal view returns (bool);
```
Returns whether `tokenId` exists.
Tokens start existing when they are minted ([`_mint`](#_mint)), and stop existing when they are burned ([`_burn`](#_burn)).
### \_existsOrError
```solidity
function _existsOrError(bytes32 tokenId) internal view;
```
When `tokenId` does not exist then revert with an error.
### \_mint
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the recipient via LSP1**.
:::
```solidity
function _mint(
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Create `tokenId` by minting it and transfers it to `to`.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as `from` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `to` | `address` | @param tokenId The token ID to create (= mint). |
| `tokenId` | `bytes32` | The token ID to create (= mint). |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hook of the `to` address. |
### \_burn
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender via LSP1**.
:::
:::tip Hint
In dApps, you can know which addresses are burning tokens by listening for the `Transfer` event and filter with the zero address as `to`.
:::
```solidity
function _burn(bytes32 tokenId, bytes data) internal nonpayable;
```
Burn a specific `tokenId`, removing the `tokenId` from the [`tokenIdsOf`](#tokenidsof) the caller and decreasing its [`balanceOf`](#balanceof) by -1.
This will also clear all the operators allowed to transfer the `tokenId`.
The owner of the `tokenId` will be notified about the `tokenId` being transferred through its LSP1 [`universalReceiver`](#universalreceiver)
function, if it is a contract that supports the LSP1 interface. Its [`universalReceiver`](#universalreceiver) function will receive
all the parameters in the calldata packed encoded.
**Emitted events:**
- [`Transfer`](#transfer) event with `address(0)` as the `to` address.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------------------------------------------------------------------------------------- |
| `tokenId` | `bytes32` | The token to burn. |
| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the LSP1 hook on the token owner's address. |
### \_transfer
:::info
Any logic in the:
- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances and ownership of `tokenId`s.
- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances and ownership of `tokenId`s, **but before notifying the sender/recipient via LSP1**.
:::
:::danger
This internal function does not check if the sender is authorized or not to operate on the `tokenId`.
:::
```solidity
function _transfer(
address from,
address to,
bytes32 tokenId,
bool force,
bytes data
) internal nonpayable;
```
Change the owner of the `tokenId` from `from` to `to`.
Both the sender and recipient will be notified of the `tokenId` being transferred through their LSP1 [`universalReceiver`](#universalreceiver)
function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive
all the parameters in the calldata packed encoded.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------- |
| `from` | `address` | The sender address. |
| `to` | `address` | @param tokenId The token to transfer. |
| `tokenId` | `bytes32` | The token to transfer. |
| `force` | `bool` | When set to `true`, `to` may be any address. When set to `false`, `to` must be a contract that supports the LSP1 standard. |
| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. |
### \_setDataForTokenId
```solidity
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
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### \_getDataForTokenId
```solidity
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
| Name | Type | Description |
| --------- | :-------: | ---------------------------------- |
| `tokenId` | `bytes32` | The unique identifier for a token. |
| `dataKey` | `bytes32` | The key for the data to retrieve. |
#### Returns
| Name | Type | Description |
| ------------ | :-----: | ----------------------------------------------------------------- |
| `dataValues` | `bytes` | The data value associated with the given `tokenId` and `dataKey`. |
### \_beforeTokenTransfer
```solidity
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 notifying sender/recipient by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_afterTokenTransfer
```solidity
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 notifying sender/recipient via LSP1** by overriding this function.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------- |
| `from` | `address` | The sender address |
| `to` | `address` | @param tokenId The tokenId to transfer |
| `tokenId` | `bytes32` | The tokenId to transfer |
| `data` | `bytes` | The data sent alongside the transfer |
### \_notifyTokenOperator
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. |
### \_notifyTokenSender
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------------------------------------------------ |
| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. |
### \_notifyTokenReceiver
```solidity
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`](#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
| Name | Type | Description |
| ---------- | :-------: | --------------------------------------------------------------------------------------------------- |
| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. |
| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. |
| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. |
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (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`.
:::
```solidity
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`](#_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`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and
32 bytes of the [`msg.value`](#msg.value)
## Events
### DataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#datachanged)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### OperatorAuthorizationChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorauthorizationchanged)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorAuthorizationChanged(address,address,bytes32,bytes)`
- Event topic hash: `0x1b1b58aa2ec0cec2228b2d37124556d41f5a1f7b12f089171f896cc236671215`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | -------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address authorized as an operator. |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` address has access on behalf of `tokenOwner`. |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OperatorRevoked
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#operatorrevoked)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OperatorRevoked(address,address,bytes32,bool,bytes)`
- Event topic hash: `0xc78cd419d6136f9f1c1c6aec1d3fae098cffaf8bc86314a8f2685e32fe574e3c`
:::
```solidity
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
| Name | Type | Description |
| -------------------------- | :-------: | ---------------------------------------------------------------------------------- |
| `operator` **`indexed`** | `address` | The address revoked from the operator array ([`getOperatorsOf`](#getoperatorsof)). |
| `tokenOwner` **`indexed`** | `address` | The owner of the `tokenId`. |
| `tokenId` **`indexed`** | `bytes32` | The tokenId `operator` is revoked from operating on. |
| `notified` | `bool` | Bool indicating whether the operator has been notified or not |
| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownershiptransferred)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### TokenIdDataChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#tokeniddatachanged)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `TokenIdDataChanged(bytes32,bytes32,bytes)`
- Event topic hash: `0xa6e4251f855f750545fe414f120db91c76b88def14d120969e5bb2d3f05debbb`
:::
```solidity
event TokenIdDataChanged(
bytes32 indexed tokenId,
bytes32 indexed dataKey,
bytes dataValue
);
```
Emitted when setting data for `tokenId`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `tokenId` **`indexed`** | `bytes32` | The tokenId which data is set for. |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Transfer
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#transfer)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Event signature: `Transfer(address,address,address,bytes32,bool,bytes)`
- Event topic hash: `0xb333c813a7426a7a11e2b190cad52c44119421594b47f6f32ace6d8c7207b2bf`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------- |
| `operator` | `address` | The address of operator that sent the `tokenId` |
| `from` **`indexed`** | `address` | The previous owner of the `tokenId` |
| `to` **`indexed`** | `address` | The new owner of `tokenId` |
| `tokenId` **`indexed`** | `bytes32` | The tokenId that was transferred |
| `force` | `bool` | If the token transfer enforces the `to` recipient address to be a contract that implements the LSP1 standard or not. |
| `data` | `bytes` | Any additional data the caller included by the caller during the transfer, and sent in the hooks to the `from` and `to` addresses. |
## Errors
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### InvalidExtensionAddress
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidextensionaddress)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidExtensionAddress(bytes)`
- Error hash: `0x42bfe79f`
:::
```solidity
error InvalidExtensionAddress(bytes storedData);
```
reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
#### Parameters
| Name | Type | Description |
| ------------ | :-----: | ----------- |
| `storedData` | `bytes` | - |
### InvalidFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#invalidfunctionselector)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `InvalidFunctionSelector(bytes)`
- Error hash: `0xe5099ee3`
:::
```solidity
error InvalidFunctionSelector(bytes data);
```
reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
#### Parameters
| Name | Type | Description |
| ------ | :-----: | ----------- |
| `data` | `bytes` | - |
### LSP4TokenNameNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokennamenoteditable)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenNameNotEditable()`
- Error hash: `0x85c169bd`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokensymbolnoteditable)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenSymbolNotEditable()`
- Error hash: `0x76755b38`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP4TokenTypeNotEditable()`
- Error hash: `0x4ef6d7fb`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8batchcallfailed)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8BatchCallFailed(uint256)`
- Error hash: `0x234eb819`
:::
```solidity
error LSP8BatchCallFailed(uint256 callIndex);
```
_Batch call failed._
Reverts when a batch call failed.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ----------- |
| `callIndex` | `uint256` | - |
### LSP8CannotSendToAddressZero
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotsendtoaddresszero)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotSendToAddressZero()`
- Error hash: `0x24ecef4d`
:::
```solidity
error LSP8CannotSendToAddressZero();
```
Reverts when trying to send token to the zero address.
### LSP8CannotUseAddressZeroAsOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8cannotuseaddresszeroasoperator)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8CannotUseAddressZeroAsOperator()`
- Error hash: `0x9577b8b3`
:::
```solidity
error LSP8CannotUseAddressZeroAsOperator();
```
Reverts when trying to set the zero address as an operator.
### LSP8InvalidTransferBatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8invalidtransferbatch)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8InvalidTransferBatch()`
- Error hash: `0x93a83119`
:::
```solidity
error LSP8InvalidTransferBatch();
```
Reverts when the parameters used for `transferBatch` have different lengths.
### LSP8NonExistentTokenId
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistenttokenid)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistentTokenId(bytes32)`
- Error hash: `0xae8f9a36`
:::
```solidity
error LSP8NonExistentTokenId(bytes32 tokenId);
```
Reverts when `tokenId` has not been minted.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
### LSP8NonExistingOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nonexistingoperator)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NonExistingOperator(address,bytes32)`
- Error hash: `0x4aa31a8c`
:::
```solidity
error LSP8NonExistingOperator(address operator, bytes32 tokenId);
```
Reverts when `operator` is not an operator for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8NotTokenOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenoperator)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOperator(bytes32,address)`
- Error hash: `0x1294d2a9`
:::
```solidity
error LSP8NotTokenOperator(bytes32 tokenId, address caller);
```
Reverts when `caller` is not an allowed operator for `tokenId`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotTokenOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8nottokenowner)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotTokenOwner(address,bytes32,address)`
- Error hash: `0x5b271ea2`
:::
```solidity
error LSP8NotTokenOwner(address tokenOwner, bytes32 tokenId, address caller);
```
Reverts when `caller` is not the `tokenOwner` of the `tokenId`.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
| `caller` | `address` | - |
### LSP8NotifyTokenReceiverContractMissingLSP1Interface
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceivercontractmissinglsp1interface)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverContractMissingLSP1Interface(address)`
- Error hash: `0x4349776d`
:::
```solidity
error LSP8NotifyTokenReceiverContractMissingLSP1Interface(
address tokenReceiver
);
```
Reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8NotifyTokenReceiverIsEOA
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8notifytokenreceiveriseoa)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8NotifyTokenReceiverIsEOA(address)`
- Error hash: `0x03173137`
:::
```solidity
error LSP8NotifyTokenReceiverIsEOA(address tokenReceiver);
```
Reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------- |
| `tokenReceiver` | `address` | - |
### LSP8OperatorAlreadyAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8operatoralreadyauthorized)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8OperatorAlreadyAuthorized(address,bytes32)`
- Error hash: `0xa7626b68`
:::
```solidity
error LSP8OperatorAlreadyAuthorized(address operator, bytes32 tokenId);
```
Reverts when `operator` is already authorized for the `tokenId`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `operator` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8RevokeOperatorNotAuthorized
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8revokeoperatornotauthorized)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8RevokeOperatorNotAuthorized(address,address,bytes32)`
- Error hash: `0x760b5acd`
:::
```solidity
error LSP8RevokeOperatorNotAuthorized(
address caller,
address tokenOwner,
bytes32 tokenId
);
```
Reverts when the call to revoke operator is not authorized.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------- |
| `caller` | `address` | - |
| `tokenOwner` | `address` | - |
| `tokenId` | `bytes32` | - |
### LSP8TokenContractCannotHoldValue
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokencontractcannotholdvalue)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenContractCannotHoldValue()`
- Error hash: `0x61f49442`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidalreadyminted)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdAlreadyMinted(bytes32)`
- Error hash: `0x34c7b511`
:::
```solidity
error LSP8TokenIdAlreadyMinted(bytes32 tokenId);
```
Reverts when `tokenId` has already been minted.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
### LSP8TokenIdFormatNotEditable
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformatnoteditable)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdFormatNotEditable()`
- Error hash: `0x3664800a`
:::
```solidity
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
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdataemptyarray)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataEmptyArray()`
- Error hash: `0x80c98305`
:::
```solidity
error LSP8TokenIdsDataEmptyArray();
```
Reverts when empty arrays is passed to the function
### LSP8TokenIdsDataLengthMismatch
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidsdatalengthmismatch)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenIdsDataLengthMismatch()`
- Error hash: `0x2fa71dfe`
:::
```solidity
error LSP8TokenIdsDataLengthMismatch();
```
Reverts when the length of the token IDs data arrays is not equal
### LSP8TokenOwnerCannotBeOperator
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownercannotbeoperator)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerCannotBeOperator()`
- Error hash: `0x89fdad62`
:::
```solidity
error LSP8TokenOwnerCannotBeOperator();
```
Reverts when trying to authorize or revoke the token's owner as an operator.
### LSP8TokenOwnerChanged
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenownerchanged)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `LSP8TokenOwnerChanged(bytes32,address,address)`
- Error hash: `0x5a9c31d3`
:::
```solidity
error LSP8TokenOwnerChanged(
bytes32 tokenId,
address oldOwner,
address newOwner
);
```
Reverts when the token owner changed inside the [`_beforeTokenTransfer`](#_beforetokentransfer) hook.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------- |
| `tokenId` | `bytes32` | - |
| `oldOwner` | `address` | - |
| `newOwner` | `address` | - |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecallernottheowner)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
### OwnableCannotSetZeroAddressAsOwner
:::note References
- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#ownablecannotsetzeroaddressasowner)
- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol)
- Error signature: `OwnableCannotSetZeroAddressAsOwner()`
- Error hash: `0x1ad8836c`
:::
```solidity
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.
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# LSP9Vault
:::info Standard Specifications
[`LSP-9-Vault`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md)
:::
:::info Solidity implementation
[`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
:::
> Implementation of LSP9Vault built on top of [ERC725], [LSP-1-UniversalReceiver]
Could be owned by an EOA or by a contract and is able to receive and send assets. Also allows for registering received assets by leveraging the key-value storage.
## 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
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#constructor)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
:::
```solidity
constructor(address newOwner);
```
_Deploying a LSP9Vault contract with owner set to address `initialOwner`._
Sets `initialOwner` as the contract owner and the `SupportedStandards:LSP9Vault` Data Key. The `constructor` also allows funding the contract on deployment.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when funding the contract on deployment.
- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set as the contract [`owner`](#owner).
- [`DataChanged`](#datachanged) event when setting the [`_LSP9_SUPPORTED_STANDARDS_KEY`](#_lsp9_supported_standards_key).
- [`UniversalReceiver`](#universalreceiver) event when notifying the `initialOwner`.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------ |
| `newOwner` | `address` | The new owner of the contract. |
### fallback
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#fallback)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
:::
```solidity
fallback(bytes calldata callData) external payable returns (bytes memory);
```
_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._
Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
forwarding the function call to the extension address mapped to the function being called.
This function is executed when:
- Sending data of length less than 4 bytes to the contract.
- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
- Receiving native tokens with some calldata.
1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
2. If the data sent to this function is of length less than 4 bytes (not a function selector), return.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens and extension function selector is not found or not payable.
### receive
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#receive)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
:::
```solidity
receive() external payable;
```
Executed:
- When receiving some native tokens without any additional data.
- On empty calls to the contract.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) when receiving native tokens.
### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#renounce_ownership_confirmation_delay)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()`
- Function selector: `0xead3fbdf`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()
external
view
returns (uint256);
```
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#renounce_ownership_confirmation_period)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()`
- Function selector: `0x01bfba61`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()
external
view
returns (uint256);
```
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### VERSION
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#version)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### acceptOwnership
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#acceptownership)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `acceptOwnership()`
- Function selector: `0x79ba5097`
:::
```solidity
function acceptOwnership() external nonpayable;
```
_`msg.sender` is accepting ownership of contract: `address(this)`._
Transfer ownership of the contract from the current [`owner()`](#owner) to the [`pendingOwner()`](#pendingowner). Once this function is called:
- The current [`owner()`](#owner) will lose access to the functions restricted to the [`owner()`](#owner) only.
- The [`pendingOwner()`](#pendingowner) will gain access to the functions restricted to the [`owner()`](#owner) only.
**Requirements:**
- Only the [`pendingOwner`](#pendingowner) can call this function.
- When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification].
- When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].
### batchCalls
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#batchcalls)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### execute
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#execute)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `execute(uint256,address,uint256,bytes)`
- Function selector: `0x44c028fe`
:::
:::info
The `operationType` 4 `DELEGATECALL` is disabled by default in the LSP9 Vault.
:::
```solidity
function execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) external payable returns (bytes);
```
_Calling address `target` using `operationType`, transferring `value` wei and data: `data`._
Generic executor function to:
- send native tokens to any address.
- interact with any contract by passing an abi-encoded function call in the `data` parameter.
- deploy a contract by providing its creation bytecode in the `data` parameter.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully.
- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`.
- If the operation type is `STATICCALL` (3), `value` transfer is disallowed and must be 0.
**Emitted events:**
- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0) and `STATICCALL` (3).
- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2).
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 |
| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) |
| `value` | `uint256` | The amount of native tokens to transfer (in Wei) |
| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------- |
| `0` | `bytes` | - |
### executeBatch
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#executebatch)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])`
- Function selector: `0x31858452`
:::
:::info
The `operationType` 4 `DELEGATECALL` is disabled by default in the LSP9 Vault.
:::
```solidity
function executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) external payable returns (bytes[]);
```
_Calling multiple addresses `targets` using `operationsType`, transferring `values` wei and data: `datas`._
Batch executor function that behaves the same as [`execute`](#execute) but allowing multiple operations in the same transaction.
**Requirements:**
- The length of the parameters provided must be equal.
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully.
- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`.
- If the operation type is `STATICCALL` (3), `value` transfer is disallowed and must be 0.
**Emitted events:**
- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0) and `STATICCALL` (3). (each iteration)
- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). (each iteration)
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
#### Parameters
| Name | Type | Description |
| ---------------- | :---------: | --------------------------------------------------------------------------------------------------------------- |
| `operationsType` | `uint256[]` | The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4` |
| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). |
| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei). |
| `datas` | `bytes[]` | The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `bytes[]` | - |
### getData
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#getdata)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#getdatabatch)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### owner
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#owner)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### pendingOwner
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#pendingowner)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `pendingOwner()`
- Function selector: `0xe30c3978`
:::
:::info
If no ownership transfer is in progress, the pendingOwner will be `address(0).`.
:::
```solidity
function pendingOwner() external view returns (address);
```
The address that ownership of the contract is transferred to. This address may use [`acceptOwnership()`](#acceptownership) to gain ownership of the contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#renounceownership)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
:::danger
Leaves the contract without an owner. Once ownership of the contract has been renounced, any functions that are restricted to be called by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.
:::
```solidity
function renounceOwnership() external nonpayable;
```
_`msg.sender` is renouncing ownership of contract `address(this)`._
Renounce ownership of the contract in a 2-step process.
1. The first call will initiate the process of renouncing ownership.
2. The second call is used as a confirmation and will leave the contract without an owner.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
### setData
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#setdata)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
```solidity
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:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#setdatabatch)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
```solidity
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`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
**Emitted events:**
- [`DataChanged`](#datachanged) event. (on each iteration of setting data)
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#supportsinterface)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
_Checking if this contract supports the interface defined by the `bytes4` interface ID `interfaceId`._
Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`.
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ------------------------------------------------------ |
| `interfaceId` | `bytes4` | The interface ID to check if the contract supports it. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------------------------------- |
| `0` | `bool` | `true` if this contract implements the interface defined by `interfaceId`, `false` otherwise. |
### transferOwnership
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#transferownership)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
function transferOwnership(address newOwner) external nonpayable;
```
_Transfer ownership initiated by `newOwner`._
Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the [`universalReceiver()`](#universalreceiver) function on the `newOwner` contract.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted].
- Pending owner cannot accept ownership in the same tx via the LSP1 hook.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------------------------- |
| `newOwner` | `address` | The address of the new owner. |
### universalReceiver
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#universalreceiver)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Function signature: `universalReceiver(bytes32,bytes)`
- Function selector: `0x6bb56a14`
:::
```solidity
function universalReceiver(
bytes32 typeId,
bytes receivedData
) external payable returns (bytes returnedValues);
```
_Notifying the contract by calling its `universalReceiver` function with the following information: typeId: `typeId`; data: `data`._
Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps:
1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY].
- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId.
- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.
2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId.
- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------- |
| `typeId` | `bytes32` | The type of call received. |
| `receivedData` | `bytes` | The data received. |
#### Returns
| Name | Type | Description |
| ---------------- | :-----: | ------------------------------------------------------------------------------------------------------- |
| `returnedValues` | `bytes` | The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call. |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_execute
:::caution Warning
Providing operation type DELEGATECALL (4) as argument will result in custom error [`ERC725X_UnknownOperationType(4)`](#erc725x_unknownoperationtype)
:::
```solidity
function _execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes);
```
This function overrides the [`ERC725XCore`](#erc725xcore) internal [`_execute`](#_execute) function to disable operation type DELEGATECALL (4).
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ------------------------------------------------------------------------------------------------------ |
| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3. |
| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2). |
| `value` | `uint256` | The amount of native tokens to transfer (in Wei). |
| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
### \_executeBatch
```solidity
function _executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) internal nonpayable returns (bytes[]);
```
check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)).
### \_executeCall
```solidity
function _executeCall(
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level call (operation type = 0)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------- |
| `target` | `address` | The address on which call is executed |
| `value` | `uint256` | The value to be sent with the call |
| `data` | `bytes` | The data to be sent with the call |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ---------------------- |
| `result` | `bytes` | The data from the call |
### \_executeStaticCall
```solidity
function _executeStaticCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level staticcall (operation type = 3)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `target` | `address` | The address on which staticcall is executed |
| `data` | `bytes` | The data to be sent with the staticcall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ------------------------------------- |
| `result` | `bytes` | The data returned from the staticcall |
### \_executeDelegateCall
:::caution Warning
The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function _executeDelegateCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level delegatecall (operation type = 4)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | --------------------------------------------- |
| `target` | `address` | The address on which delegatecall is executed |
| `data` | `bytes` | The data to be sent with the delegatecall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | --------------------------------------- |
| `result` | `bytes` | The data returned from the delegatecall |
### \_deployCreate
```solidity
function _deployCreate(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE` opcode (operation type = 1)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_deployCreate2
```solidity
function _deployCreate2(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE2` opcode (operation type = 2)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
Write a `dataValue` to the underlying ERC725Y storage, represented as a mapping of
`bytes32` data keys mapped to their `bytes` data values.
```solidity
mapping(bytes32 => bytes) _store
```
**Emitted events:**
- [`DataChanged`](#datachanged) event emitted after a successful `setData` call.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to write the associated `bytes` value to the store. |
| `dataValue` | `bytes` | The `bytes` value to associate with the given `dataKey` in the ERC725Y storage. |
### \_transferOwnership
```solidity
function _transferOwnership(address newOwner) internal nonpayable;
```
Set the pending owner of the contract and cancel any renounce ownership process that was previously started.
**Requirements:**
- `newOwner` cannot be the address of the contract itself.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------- |
| `newOwner` | `address` | The address of the new pending owner. |
### \_acceptOwnership
```solidity
function _acceptOwnership() internal nonpayable;
```
Set the pending owner of the contract as the new owner.
### \_renounceOwnership
```solidity
function _renounceOwnership() internal nonpayable;
```
Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed.
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
### \_fallbackLSP17Extendable
:::tip Hint
This function does not forward to the extension contract the `msg.value` received by the contract that inherits `LSP17Extendable`.
If you would like to forward the `msg.value` to the extension contract, you can override the code of this internal function as follow:
```solidity
(bool success, bytes memory result) = extension.call{value: msg.value}(
abi.encodePacked(callData, msg.sender, msg.value)
);
```
:::
```solidity
function _fallbackLSP17Extendable(
bytes callData
) internal nonpayable returns (bytes);
```
Forwards the call to an extension mapped to a function selector.
Calls [`_getExtensionAndForwardValue`](#_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.
Forwards the value if the extension is payable.
Reverts if there is no extension for the function being called, except for the `bytes4(0)` function selector, which passes even if there is no extension for it.
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`](#msg.sender) and 32 bytes of the `msg.value`.
### \_validateAndIdentifyCaller
```solidity
function _validateAndIdentifyCaller() internal view returns (bool isURD);
```
Internal method restricting the call to the owner of the contract and the UniversalReceiverDelegate
## Events
### ContractCreated
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#contractcreated)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `ContractCreated(uint256,address,uint256,bytes32)`
- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3`
:::
```solidity
event ContractCreated(
uint256 indexed operationType,
address indexed contractAddress,
uint256 value,
bytes32 indexed salt
);
```
_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._
Emitted when a new contract was created and deployed.
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (`CREATE` or `CREATE2`). |
| `contractAddress` **`indexed`** | `address` | The created contract address. |
| `value` | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. |
| `salt` **`indexed`** | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. |
### DataChanged
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#datachanged)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Executed
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#executed)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `Executed(uint256,address,uint256,bytes4)`
- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e`
:::
```solidity
event Executed(
uint256 indexed operationType,
address indexed target,
uint256 value,
bytes4 indexed selector
);
```
_Called address `target` using `operationType` with `value` wei and `data`._
Emitted when calling an address `target` (EOA or contract) with `value`.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `target` address (`CALL`, `STATICALL` or `DELEGATECALL`). |
| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). |
| `value` | `uint256` | The amount of native tokens transferred along the call (in Wei). |
| `selector` **`indexed`** | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. |
### OwnershipRenounced
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#ownershiprenounced)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `OwnershipRenounced()`
- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce`
:::
```solidity
event OwnershipRenounced();
```
_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._
Emitted when the ownership of the contract has been renounced.
### OwnershipTransferStarted
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#ownershiptransferstarted)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `OwnershipTransferStarted(address,address)`
- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700`
:::
```solidity
event OwnershipTransferStarted(
address indexed previousOwner,
address indexed newOwner
);
```
_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._
Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------- |
| `previousOwner` **`indexed`** | `address` | The address of the previous owner. |
| `newOwner` **`indexed`** | `address` | The address of the new owner. |
### OwnershipTransferred
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#ownershiptransferred)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### RenounceOwnershipStarted
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#renounceownershipstarted)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `RenounceOwnershipStarted()`
- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7`
:::
```solidity
event RenounceOwnershipStarted();
```
_Ownership renouncement initiated._
Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process.
### UniversalReceiver
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#universalreceiver)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)`
- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2`
:::
```solidity
event UniversalReceiver(
address indexed from,
uint256 indexed value,
bytes32 indexed typeId,
bytes receivedData,
bytes returnedValue
);
```
\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId`
- Data received: `receivedData`.\*
Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData`
#### Parameters
| Name | Type | Description |
| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the [`universalReceiver(...)`](#universalreceiver) function. |
| `value` **`indexed`** | `uint256` | The amount sent to the [`universalReceiver(...)`](#universalreceiver) function. |
| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. |
| `receivedData` | `bytes` | Any arbitrary data that was sent to the [`universalReceiver(...)`](#universalreceiver) function. |
| `returnedValue` | `bytes` | The value returned by the [`universalReceiver(...)`](#universalreceiver) function. |
## Errors
### ERC725X_ContractDeploymentFailed
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_contractdeploymentfailed)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_ContractDeploymentFailed()`
- Error hash: `0x0b07489b`
:::
```solidity
error ERC725X_ContractDeploymentFailed();
```
Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_CreateOperationsRequireEmptyRecipientAddress
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_createoperationsrequireemptyrecipientaddress)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()`
- Error hash: `0x3041824a`
:::
```solidity
error ERC725X_CreateOperationsRequireEmptyRecipientAddress();
```
Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_ExecuteParametersEmptyArray
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_executeparametersemptyarray)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_ExecuteParametersEmptyArray()`
- Error hash: `0xe9ad2b5f`
:::
```solidity
error ERC725X_ExecuteParametersEmptyArray();
```
Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array.
### ERC725X_ExecuteParametersLengthMismatch
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_executeparameterslengthmismatch)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_ExecuteParametersLengthMismatch()`
- Error hash: `0x3ff55f4d`
:::
```solidity
error ERC725X_ExecuteParametersLengthMismatch();
```
Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function.
### ERC725X_InsufficientBalance
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_insufficientbalance)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_InsufficientBalance(uint256,uint256)`
- Error hash: `0x0df9a8f8`
:::
```solidity
error ERC725X_InsufficientBalance(uint256 balance, uint256 value);
```
Reverts when trying to send more native tokens `value` than available in current `balance`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. |
| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. |
### ERC725X_MsgValueDisallowedInStaticCall
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_msgvaluedisallowedinstaticcall)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_MsgValueDisallowedInStaticCall()`
- Error hash: `0x72f2bc6a`
:::
```solidity
error ERC725X_MsgValueDisallowedInStaticCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation.
### ERC725X_NoContractBytecodeProvided
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_nocontractbytecodeprovided)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_NoContractBytecodeProvided()`
- Error hash: `0xb81cd8d9`
:::
```solidity
error ERC725X_NoContractBytecodeProvided();
```
Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_UnknownOperationType
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725x_unknownoperationtype)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725X_UnknownOperationType(uint256)`
- Error hash: `0x7583b3bc`
:::
```solidity
error ERC725X_UnknownOperationType(uint256 operationTypeProvided);
```
Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ |
| `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. |
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### ERC725Y_MsgValueDisallowed
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#erc725y_msgvaluedisallowed)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `ERC725Y_MsgValueDisallowed()`
- Error hash: `0xf36ba737`
:::
```solidity
error ERC725Y_MsgValueDisallowed();
```
Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function.
### LSP14CallerNotPendingOwner
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#lsp14callernotpendingowner)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `LSP14CallerNotPendingOwner(address)`
- Error hash: `0x451e4528`
:::
```solidity
error LSP14CallerNotPendingOwner(address caller);
```
Reverts when the `caller` that is trying to accept ownership of the contract is not the pending owner.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `caller` | `address` | The address that tried to accept ownership. |
### LSP14CannotTransferOwnershipToSelf
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#lsp14cannottransferownershiptoself)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `LSP14CannotTransferOwnershipToSelf()`
- Error hash: `0xe052a6f8`
:::
```solidity
error LSP14CannotTransferOwnershipToSelf();
```
_Cannot transfer ownership to the address of the contract itself._
Reverts when trying to transfer ownership to the `address(this)`.
### LSP14MustAcceptOwnershipInSeparateTransaction
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#lsp14mustacceptownershipinseparatetransaction)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()`
- Error hash: `0x5758dd07`
:::
```solidity
error LSP14MustAcceptOwnershipInSeparateTransaction();
```
_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._
Reverts when pending owner accept ownership in the same transaction of transferring ownership.
### LSP14NotInRenounceOwnershipInterval
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#lsp14notinrenounceownershipinterval)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `LSP14NotInRenounceOwnershipInterval(uint256,uint256)`
- Error hash: `0x1b080942`
:::
```solidity
error LSP14NotInRenounceOwnershipInterval(
uint256 renounceOwnershipStart,
uint256 renounceOwnershipEnd
);
```
_Cannot confirm ownership renouncement yet. The ownership renouncement is allowed from: `renounceOwnershipStart` until: `renounceOwnershipEnd`._
Reverts when trying to renounce ownership before the initial confirmation delay.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ----------------------------------------------------------------------- |
| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. |
| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. |
### LSP1DelegateNotAllowedToSetDataKey
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#lsp1delegatenotallowedtosetdatakey)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `LSP1DelegateNotAllowedToSetDataKey(bytes32)`
- Error hash: `0x199611f1`
:::
```solidity
error LSP1DelegateNotAllowedToSetDataKey(bytes32 dataKey);
```
_The `LSP1UniversalReceiverDelegate` is not allowed to set the following data key: `dataKey`._
Reverts when the Vault version of [LSP1UniversalReceiverDelegate] sets @lukso/lsp1-contracts/6/17 Data Keys.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------------------------------------------------------- |
| `dataKey` | `bytes32` | The data key that the Vault version of [LSP1UniversalReceiverDelegate] is not allowed to set. |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
### OwnableCallerNotTheOwner
:::note References
- Specification details: [**LSP-9-Vault**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md#ownablecallernottheowner)
- Solidity implementation: [`LSP9Vault.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp9-contracts/contracts/LSP9Vault.sol)
- Error signature: `OwnableCallerNotTheOwner(address)`
- Error hash: `0xbf1169c5`
:::
```solidity
error OwnableCallerNotTheOwner(address callerAddress);
```
Reverts when only the owner is allowed to call the function.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ---------------------------------------- |
| `callerAddress` | `address` | The address that tried to make the call. |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
# UniversalProfile
:::info Standard Specifications
[`UniversalProfile`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-3-Profile-Metadata.md)
[`UniversalProfile`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-3-Profile-Metadata.md)
:::
:::info Solidity implementation
[`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
:::
> implementation of a LUKSO's Universal Profile based on LSP3
Implementation of the ERC725Account + LSP1 universalReceiver
## 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
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#constructor)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
:::
```solidity
constructor(address initialOwner);
```
_Deploying a UniversalProfile contract with owner set to address `initialOwner`._
Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3Profile` data key in the ERC725Y data key/value store.
- The `constructor` is payable and allows funding the contract on deployment.
- The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when funding the contract on deployment.
- [`OwnershipTransferred`](#ownershiptransferred) event when `initialOwner` is set as the contract [`owner`](#owner).
- [`DataChanged`](#datachanged) event when setting the [`_LSP3_SUPPORTED_STANDARDS_KEY`](#_lsp3_supported_standards_key).
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ------------------------- |
| `initialOwner` | `address` | the owner of the contract |
### fallback
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#fallback)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
:::
```solidity
fallback() external payable;
```
### receive
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#receive)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
:::
```solidity
receive() external payable;
```
### RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_delay)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()`
- Function selector: `0xead3fbdf`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY()
external
view
returns (uint256);
```
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounce_ownership_confirmation_period)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()`
- Function selector: `0x01bfba61`
:::
```solidity
function RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD()
external
view
returns (uint256);
```
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `uint256` | - |
### VERSION
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#version)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`
:::
```solidity
function VERSION() external view returns (string);
```
_Contract version._
#### Returns
| Name | Type | Description |
| ---- | :------: | ----------- |
| `0` | `string` | - |
### acceptOwnership
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `acceptOwnership()`
- Function selector: `0x79ba5097`
:::
```solidity
function acceptOwnership() external nonpayable;
```
_`msg.sender` is accepting ownership of contract: `address(this)`._
Transfer ownership of the contract from the current [`owner()`](#owner) to the [`pendingOwner()`](#pendingowner). Once this function is called:
- The current [`owner()`](#owner) will lose access to the functions restricted to the [`owner()`](#owner) only.
- The [`pendingOwner()`](#pendingowner) will gain access to the functions restricted to the [`owner()`](#owner) only.
**Requirements:**
- Only the [`pendingOwner`](#pendingowner) can call this function.
- When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification].
- When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].
### batchCalls
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#batchcalls)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `batchCalls(bytes[])`
- Function selector: `0x6963d438`
:::
:::info
It's not possible to send value along the functions call due to the use of `delegatecall`.
:::
```solidity
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
| Name | Type | Description |
| ------ | :-------: | -------------------------------------------------------------------- |
| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. |
#### Returns
| Name | Type | Description |
| --------- | :-------: | ---------------------------------------------------------------- |
| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. |
### execute
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#execute)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `execute(uint256,address,uint256,bytes)`
- Function selector: `0x44c028fe`
:::
```solidity
function execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) external payable returns (bytes);
```
_Calling address `target` using `operationType`, transferring `value` wei and data: `data`._
Generic executor function to:
- send native tokens to any address.
- interact with any contract by passing an abi-encoded function call in the `data` parameter.
- deploy a contract by providing its creation bytecode in the `data` parameter.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully.
- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`.
- If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.
**Emitted events:**
- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4).
- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2).
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `operationType` | `uint256` | The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4 |
| `target` | `address` | The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2) |
| `value` | `uint256` | The amount of native tokens to transfer (in Wei) |
| `data` | `bytes` | The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------- |
| `0` | `bytes` | - |
### executeBatch
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#executebatch)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `executeBatch(uint256[],address[],uint256[],bytes[])`
- Function selector: `0x31858452`
:::
:::caution Warning
- The `msg.value` should not be trusted for any method called within the batch with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) external payable returns (bytes[]);
```
_Calling multiple addresses `targets` using `operationsType`, transferring `values` wei and data: `datas`._
Batch executor function that behaves the same as [`execute`](#execute) but allowing multiple operations in the same transaction.
**Requirements:**
- The length of the parameters provided must be equal.
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- If a `value` is provided, the contract must have at least this amount in its balance to execute successfully.
- If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`.
- If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.
**Emitted events:**
- [`Executed`](#executed) event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration)
- [`ContractCreated`](#contractcreated) event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration)
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
#### Parameters
| Name | Type | Description |
| ---------------- | :---------: | --------------------------------------------------------------------------------------------------------------- |
| `operationsType` | `uint256[]` | The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4` |
| `targets` | `address[]` | The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2). |
| `values` | `uint256[]` | The list of native token amounts to transfer (in Wei). |
| `datas` | `bytes[]` | The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `bytes[]` | - |
### getData
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#getdata)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `getData(bytes32)`
- Function selector: `0x54f6127f`
:::
```solidity
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
| Name | Type | Description |
| --------- | :-------: | --------------------------------------------- |
| `dataKey` | `bytes32` | The data key for which to retrieve the value. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ---------------------------------------------------- |
| `dataValue` | `bytes` | The bytes value stored under the specified data key. |
### getDataBatch
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#getdatabatch)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `getDataBatch(bytes32[])`
- Function selector: `0xdedff9c6`
:::
```solidity
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
| Name | Type | Description |
| ---------- | :---------: | ------------------------------------------ |
| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve |
#### Returns
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------- |
| `dataValues` | `bytes[]` | The array of data stored at multiple keys |
### isValidSignature
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#isvalidsignature)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `isValidSignature(bytes32,bytes)`
- Function selector: `0x1626ba7e`
:::
:::caution Warning
This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP0ERC725Account and prevent signatures from the same EOA to be replayed across different LSP0ERC725Accounts.
:::
```solidity
function isValidSignature(
bytes32 dataHash,
bytes signature
) external view returns (bytes4 returnedStatus);
```
_Achieves the goal of [EIP-1271] by validating signatures of smart contracts according to their own logic._
Handles two cases:
1. If the owner is an EOA, recovers an address from the hash and the signature provided:
- Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature.
- If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid.
2. If the owner is a smart contract, it forwards the call of [`isValidSignature()`](#isvalidsignature) to the owner contract:
- If the contract fails or returns the `_ERC1271_FAILVALUE`, the [`isValidSignature()`](#isvalidsignature) on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid.
- If the [`isValidSignature()`](#isvalidsignature) on the owner returned the `_ERC1271_SUCCESSVALUE`, the [`isValidSignature()`](#isvalidsignature) on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------ |
| `dataHash` | `bytes32` | The hash of the data to be validated. |
| `signature` | `bytes` | A signature that can validate the previous parameter (Hash). |
#### Returns
| Name | Type | Description |
| ---------------- | :------: | ----------------------------------------------------------------- |
| `returnedStatus` | `bytes4` | A `bytes4` value that indicates if the signature is valid or not. |
### owner
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#owner)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `owner()`
- Function selector: `0x8da5cb5b`
:::
```solidity
function owner() external view returns (address);
```
Returns the address of the current owner.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### pendingOwner
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#pendingowner)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `pendingOwner()`
- Function selector: `0xe30c3978`
:::
:::info
If no ownership transfer is in progress, the pendingOwner will be `address(0).`.
:::
```solidity
function pendingOwner() external view returns (address);
```
The address that ownership of the contract is transferred to. This address may use [`acceptOwnership()`](#acceptownership) to gain ownership of the contract.
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------- |
| `0` | `address` | - |
### renounceOwnership
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounceownership)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `renounceOwnership()`
- Function selector: `0x715018a6`
:::
:::danger
Leaves the contract without an owner. Once ownership of the contract has been renounced, any functions that are restricted to be called by the owner or an address allowed by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.
:::
```solidity
function renounceOwnership() external nonpayable;
```
_`msg.sender` is renouncing ownership of contract `address(this)`._
Renounce ownership of the contract in a 2-step process.
1. The first call will initiate the process of renouncing ownership.
2. The second call is used as a confirmation and will leave the contract without an owner.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
### setData
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#setdata)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `setData(bytes32,bytes)`
- Function selector: `0x7f23690c`
:::
```solidity
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:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------ |
| `dataKey` | `bytes32` | The data key for which to set a new value. |
| `dataValue` | `bytes` | The new bytes value to set. |
### setDataBatch
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#setdatabatch)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `setDataBatch(bytes32[],bytes[])`
- Function selector: `0x97902421`
:::
```solidity
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`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) event when receiving native tokens.
- [`DataChanged`](#datachanged) event. (on each iteration of setting data)
#### Parameters
| Name | Type | Description |
| ------------ | :---------: | ---------------------------------------------------- |
| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. |
| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. |
### supportsInterface
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#supportsinterface)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`
:::
```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool);
```
_Checking if this contract supports the interface defined by the `bytes4` interface ID `interfaceId`._
Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`.
#### Parameters
| Name | Type | Description |
| ------------- | :------: | ------------------------------------------------------ |
| `interfaceId` | `bytes4` | The interface ID to check if the contract supports it. |
#### Returns
| Name | Type | Description |
| ---- | :----: | --------------------------------------------------------------------------------------------- |
| `0` | `bool` | `true` if this contract implements the interface defined by `interfaceId`, `false` otherwise. |
### transferOwnership
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `transferOwnership(address)`
- Function selector: `0xf2fde38b`
:::
```solidity
function transferOwnership(address pendingNewOwner) external nonpayable;
```
_Transfer ownership initiated by `newOwner`._
Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the [`universalReceiver()`](#universalreceiver) function on the `newOwner` contract.
**Requirements:**
- Can be only called by the [`owner`](#owner) or by an authorised address that pass the verification check performed on the owner.
- When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted].
- Pending owner cannot accept ownership in the same tx via the LSP1 hook.
#### Parameters
| Name | Type | Description |
| ----------------- | :-------: | ----------- |
| `pendingNewOwner` | `address` | - |
### universalReceiver
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#universalreceiver)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Function signature: `universalReceiver(bytes32,bytes)`
- Function selector: `0x6bb56a14`
:::
```solidity
function universalReceiver(
bytes32 typeId,
bytes receivedData
) external payable returns (bytes returnedValues);
```
_Notifying the contract by calling its `universalReceiver` function with the following information: typeId: `typeId`; data: `data`._
Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps:
1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY].
- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId.
- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.
2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
- If there is an address stored under the data key, check if this address supports the LSP1 interfaceId.
- If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. This function delegates internally the handling of native tokens to the [`universalReceiver`](#universalreceiver) function itself passing `_TYPEID_LSP0_VALUE_RECEIVED` as typeId and the calldata as received data.
**Emitted events:**
- [`UniversalReceiver`](#universalreceiver) when receiving native tokens.
- [`UniversalReceiver`](#universalreceiver) event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------- |
| `typeId` | `bytes32` | The type of call received. |
| `receivedData` | `bytes` | The data received. |
#### Returns
| Name | Type | Description |
| ---------------- | :-----: | ------------------------------------------------------------------------------------------------------- |
| `returnedValues` | `bytes` | The ABI encoded return value of the LSP1UniversalReceiverDelegate call and the LSP1TypeIdDelegate call. |
## 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
```solidity
function _checkOwner() internal view;
```
Throws if the sender is not the owner.
### \_setOwner
```solidity
function _setOwner(address newOwner) internal nonpayable;
```
Changes the owner if `newOwner` and oldOwner are different
This pattern is useful in inheritance.
### \_execute
```solidity
function _execute(
uint256 operationType,
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes);
```
check the `operationType` provided and perform the associated low-level opcode after checking for requirements (see [`execute`](#execute)).
### \_executeBatch
```solidity
function _executeBatch(
uint256[] operationsType,
address[] targets,
uint256[] values,
bytes[] datas
) internal nonpayable returns (bytes[]);
```
check each `operationType` provided in the batch and perform the associated low-level opcode after checking for requirements (see [`executeBatch`](#executebatch)).
### \_executeCall
```solidity
function _executeCall(
address target,
uint256 value,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level call (operation type = 0)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------- |
| `target` | `address` | The address on which call is executed |
| `value` | `uint256` | The value to be sent with the call |
| `data` | `bytes` | The data to be sent with the call |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ---------------------- |
| `result` | `bytes` | The data from the call |
### \_executeStaticCall
```solidity
function _executeStaticCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level staticcall (operation type = 3)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `target` | `address` | The address on which staticcall is executed |
| `data` | `bytes` | The data to be sent with the staticcall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | ------------------------------------- |
| `result` | `bytes` | The data returned from the staticcall |
### \_executeDelegateCall
:::caution Warning
The `msg.value` should not be trusted for any method called with `operationType`: `DELEGATECALL` (4).
:::
```solidity
function _executeDelegateCall(
address target,
bytes data
) internal nonpayable returns (bytes result);
```
Perform low-level delegatecall (operation type = 4)
#### Parameters
| Name | Type | Description |
| -------- | :-------: | --------------------------------------------- |
| `target` | `address` | The address on which delegatecall is executed |
| `data` | `bytes` | The data to be sent with the delegatecall |
#### Returns
| Name | Type | Description |
| -------- | :-----: | --------------------------------------- |
| `result` | `bytes` | The data returned from the delegatecall |
### \_deployCreate
```solidity
function _deployCreate(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE` opcode (operation type = 1)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_deployCreate2
```solidity
function _deployCreate2(
uint256 value,
bytes creationCode
) internal nonpayable returns (bytes newContract);
```
Deploy a contract using the `CREATE2` opcode (operation type = 2)
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------------------------------------------------------------------------------------------------- |
| `value` | `uint256` | The value to be sent to the contract created |
| `creationCode` | `bytes` | The contract creation bytecode to deploy appended with the constructor argument(s) and a bytes32 salt |
#### Returns
| Name | Type | Description |
| ------------- | :-----: | -------------------------------------------- |
| `newContract` | `bytes` | The address of the contract created as bytes |
### \_getData
```solidity
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.
```solidity
mapping(bytes32 => bytes) _store
```
#### Parameters
| Name | Type | Description |
| --------- | :-------: | ----------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. |
#### Returns
| Name | Type | Description |
| ----------- | :-----: | ----------------------------------------------------------------------------- |
| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. |
### \_setData
```solidity
function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable;
```
Write a `dataValue` to the underlying ERC725Y storage, represented as a mapping of
`bytes32` data keys mapped to their `bytes` data values.
```solidity
mapping(bytes32 => bytes) _store
```
**Emitted events:**
- [`DataChanged`](#datachanged) event emitted after a successful `setData` call.
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------------------------- |
| `dataKey` | `bytes32` | A bytes32 data key to write the associated `bytes` value to the store. |
| `dataValue` | `bytes` | The `bytes` value to associate with the given `dataKey` in the ERC725Y storage. |
### \_transferOwnership
```solidity
function _transferOwnership(address newOwner) internal nonpayable;
```
Set the pending owner of the contract and cancel any renounce ownership process that was previously started.
**Requirements:**
- `newOwner` cannot be the address of the contract itself.
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ------------------------------------- |
| `newOwner` | `address` | The address of the new pending owner. |
### \_acceptOwnership
```solidity
function _acceptOwnership() internal nonpayable;
```
Set the pending owner of the contract as the new owner.
### \_renounceOwnership
```solidity
function _renounceOwnership() internal nonpayable;
```
Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed.
### \_supportsInterfaceInERC165Extension
```solidity
function _supportsInterfaceInERC165Extension(
bytes4 interfaceId
) internal view returns (bool);
```
Returns whether the interfaceId being checked is supported in the extension of the
[`supportsInterface`](#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
```solidity
function _getExtensionAndForwardValue(
bytes4 functionSelector
) internal view returns (address, bool);
```
Returns the extension address and the boolean indicating whether to forward the value received to the extension, stored under the following data key:
- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
- If no extension is stored, returns the address(0).
- If the stored value is 20 bytes, return false for the boolean
### \_fallbackLSP17Extendable
:::tip Hint
If you would like to forward the `msg.value` to the extension contract, you should store an additional `0x01` byte after the address of the extension under the corresponding LSP17 data key.
:::
```solidity
function _fallbackLSP17Extendable(
bytes callData
) internal nonpayable returns (bytes);
```
Forwards the call to an extension mapped to a function selector.
Calls [`_getExtensionAndForwardValue`](#_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.
Forwards the value sent with the call to the extension if the function selector is mapped to a payable extension.
Reverts if there is no extension for the function being called, except for the `bytes4(0)` function selector, which passes even if there is no extension for it.
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`](#msg.sender) and 32 bytes of the `msg.value`.
### \_verifyCall
```solidity
function _verifyCall(
address logicVerifier
) internal nonpayable returns (bool verifyAfter);
```
Calls [`lsp20VerifyCall`](#lsp20verifycall) function on the logicVerifier.
### \_verifyCallResult
```solidity
function _verifyCallResult(
address logicVerifier,
bytes callResult
) internal nonpayable;
```
Calls [`lsp20VerifyCallResult`](#lsp20verifycallresult) function on the logicVerifier.
### \_revertWithLSP20DefaultError
```solidity
function _revertWithLSP20DefaultError(
bool postCall,
bytes returnedData
) internal pure;
```
## Events
### ContractCreated
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#contractcreated)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `ContractCreated(uint256,address,uint256,bytes32)`
- Event topic hash: `0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3`
:::
```solidity
event ContractCreated(
uint256 indexed operationType,
address indexed contractAddress,
uint256 value,
bytes32 indexed salt
);
```
_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._
Emitted when a new contract was created and deployed.
#### Parameters
| Name | Type | Description |
| ------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The opcode used to deploy the contract (`CREATE` or `CREATE2`). |
| `contractAddress` **`indexed`** | `address` | The created contract address. |
| `value` | `uint256` | The amount of native tokens (in Wei) sent to fund the created contract on deployment. |
| `salt` **`indexed`** | `bytes32` | The salt used to deterministically deploy the contract (`CREATE2` only). If `CREATE` opcode is used, the salt value will be `bytes32(0)`. |
### DataChanged
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#datachanged)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `DataChanged(bytes32,bytes)`
- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2`
:::
```solidity
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
| Name | Type | Description |
| ----------------------- | :-------: | -------------------------------------------- |
| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. |
| `dataValue` | `bytes` | The value to set for the given data key. |
### Executed
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#executed)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `Executed(uint256,address,uint256,bytes4)`
- Event topic hash: `0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e`
:::
```solidity
event Executed(
uint256 indexed operationType,
address indexed target,
uint256 value,
bytes4 indexed selector
);
```
_Called address `target` using `operationType` with `value` wei and `data`._
Emitted when calling an address `target` (EOA or contract) with `value`.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------------------------------------------------------------------------- |
| `operationType` **`indexed`** | `uint256` | The low-level call opcode used to call the `target` address (`CALL`, `STATICALL` or `DELEGATECALL`). |
| `target` **`indexed`** | `address` | The address to call. `target` will be unused if a contract is created (operation types 1 and 2). |
| `value` | `uint256` | The amount of native tokens transferred along the call (in Wei). |
| `selector` **`indexed`** | `bytes4` | The first 4 bytes (= function selector) of the data sent with the call. |
### OwnershipRenounced
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#ownershiprenounced)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `OwnershipRenounced()`
- Event topic hash: `0xd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce`
:::
```solidity
event OwnershipRenounced();
```
_Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is `address(0)`._
Emitted when the ownership of the contract has been renounced.
### OwnershipTransferStarted
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferstarted)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `OwnershipTransferStarted(address,address)`
- Event topic hash: `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700`
:::
```solidity
event OwnershipTransferStarted(
address indexed previousOwner,
address indexed newOwner
);
```
_The transfer of ownership of the contract was initiated. Pending new owner set to: `newOwner`._
Emitted when [`transferOwnership(..)`](#transferownership) was called and the first step of transferring ownership completed successfully which leads to [`pendingOwner`](#pendingowner) being updated.
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ---------------------------------- |
| `previousOwner` **`indexed`** | `address` | The address of the previous owner. |
| `newOwner` **`indexed`** | `address` | The address of the new owner. |
### OwnershipTransferred
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#ownershiptransferred)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `OwnershipTransferred(address,address)`
- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0`
:::
```solidity
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```
#### Parameters
| Name | Type | Description |
| ----------------------------- | :-------: | ----------- |
| `previousOwner` **`indexed`** | `address` | - |
| `newOwner` **`indexed`** | `address` | - |
### RenounceOwnershipStarted
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#renounceownershipstarted)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `RenounceOwnershipStarted()`
- Event topic hash: `0x81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e7`
:::
```solidity
event RenounceOwnershipStarted();
```
_Ownership renouncement initiated._
Emitted when starting the [`renounceOwnership(..)`](#renounceownership) 2-step process.
### UniversalReceiver
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#universalreceiver)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Event signature: `UniversalReceiver(address,uint256,bytes32,bytes,bytes)`
- Event topic hash: `0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2`
:::
```solidity
event UniversalReceiver(
address indexed from,
uint256 indexed value,
bytes32 indexed typeId,
bytes receivedData,
bytes returnedValue
);
```
\*Address `from` called the `universalReceiver(...)` function while sending `value` LYX. Notification type (typeId): `typeId`
- Data received: `receivedData`.\*
Emitted when the [`universalReceiver`](#universalreceiver) function was called with a specific `typeId` and some `receivedData`
#### Parameters
| Name | Type | Description |
| ---------------------- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from` **`indexed`** | `address` | The address of the EOA or smart contract that called the [`universalReceiver(...)`](#universalreceiver) function. |
| `value` **`indexed`** | `uint256` | The amount sent to the [`universalReceiver(...)`](#universalreceiver) function. |
| `typeId` **`indexed`** | `bytes32` | A `bytes32` unique identifier (= _"hook"_)that describe the type of notification, information or transaction received by the contract. Can be related to a specific standard or a hook. |
| `receivedData` | `bytes` | Any arbitrary data that was sent to the [`universalReceiver(...)`](#universalreceiver) function. |
| `returnedValue` | `bytes` | The value returned by the [`universalReceiver(...)`](#universalreceiver) function. |
## Errors
### ERC725X_ContractDeploymentFailed
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_contractdeploymentfailed)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_ContractDeploymentFailed()`
- Error hash: `0x0b07489b`
:::
```solidity
error ERC725X_ContractDeploymentFailed();
```
Reverts when contract deployment failed via [`execute`](#execute) or [`executeBatch`](#executebatch) functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_CreateOperationsRequireEmptyRecipientAddress
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_createoperationsrequireemptyrecipientaddress)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_CreateOperationsRequireEmptyRecipientAddress()`
- Error hash: `0x3041824a`
:::
```solidity
error ERC725X_CreateOperationsRequireEmptyRecipientAddress();
```
Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via [`execute`](#execute) or [`executeBatch`](#executebatch) functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_ExecuteParametersEmptyArray
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparametersemptyarray)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_ExecuteParametersEmptyArray()`
- Error hash: `0xe9ad2b5f`
:::
```solidity
error ERC725X_ExecuteParametersEmptyArray();
```
Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array.
### ERC725X_ExecuteParametersLengthMismatch
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_executeparameterslengthmismatch)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_ExecuteParametersLengthMismatch()`
- Error hash: `0x3ff55f4d`
:::
```solidity
error ERC725X_ExecuteParametersLengthMismatch();
```
Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function.
### ERC725X_InsufficientBalance
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_insufficientbalance)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_InsufficientBalance(uint256,uint256)`
- Error hash: `0x0df9a8f8`
:::
```solidity
error ERC725X_InsufficientBalance(uint256 balance, uint256 value);
```
Reverts when trying to send more native tokens `value` than available in current `balance`.
#### Parameters
| Name | Type | Description |
| --------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `balance` | `uint256` | The balance of native tokens of the ERC725X smart contract. |
| `value` | `uint256` | The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`. |
### ERC725X_MsgValueDisallowedInDelegateCall
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedindelegatecall)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_MsgValueDisallowedInDelegateCall()`
- Error hash: `0x5ac83135`
:::
```solidity
error ERC725X_MsgValueDisallowedInDelegateCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting.
### ERC725X_MsgValueDisallowedInStaticCall
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_msgvaluedisallowedinstaticcall)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_MsgValueDisallowedInStaticCall()`
- Error hash: `0x72f2bc6a`
:::
```solidity
error ERC725X_MsgValueDisallowedInStaticCall();
```
Reverts when trying to send native tokens (`value` / `values[]` parameter of [`execute`](#execute) or [`executeBatch`](#executebatch) functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation.
### ERC725X_NoContractBytecodeProvided
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_nocontractbytecodeprovided)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_NoContractBytecodeProvided()`
- Error hash: `0xb81cd8d9`
:::
```solidity
error ERC725X_NoContractBytecodeProvided();
```
Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via [`execute`](#execute) or [`executeBatch`](#executebatch). This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`).
### ERC725X_UnknownOperationType
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725x_unknownoperationtype)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725X_UnknownOperationType(uint256)`
- Error hash: `0x7583b3bc`
:::
```solidity
error ERC725X_UnknownOperationType(uint256 operationTypeProvided);
```
Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | ------------------------------------------------------------------------------------------------------ |
| `operationTypeProvided` | `uint256` | The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. |
### ERC725Y_DataKeysValuesEmptyArray
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725y_datakeysvaluesemptyarray)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725Y_DataKeysValuesEmptyArray()`
- Error hash: `0x97da5f95`
:::
```solidity
error ERC725Y_DataKeysValuesEmptyArray();
```
Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array.
### ERC725Y_DataKeysValuesLengthMismatch
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#erc725y_datakeysvalueslengthmismatch)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()`
- Error hash: `0x3bcc8979`
:::
```solidity
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`](#setdatabatch) function.
### LSP14CallerNotPendingOwner
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14callernotpendingowner)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP14CallerNotPendingOwner(address)`
- Error hash: `0x451e4528`
:::
```solidity
error LSP14CallerNotPendingOwner(address caller);
```
Reverts when the `caller` that is trying to accept ownership of the contract is not the pending owner.
#### Parameters
| Name | Type | Description |
| -------- | :-------: | ------------------------------------------- |
| `caller` | `address` | The address that tried to accept ownership. |
### LSP14CannotTransferOwnershipToSelf
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14cannottransferownershiptoself)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP14CannotTransferOwnershipToSelf()`
- Error hash: `0xe052a6f8`
:::
```solidity
error LSP14CannotTransferOwnershipToSelf();
```
_Cannot transfer ownership to the address of the contract itself._
Reverts when trying to transfer ownership to the `address(this)`.
### LSP14MustAcceptOwnershipInSeparateTransaction
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14mustacceptownershipinseparatetransaction)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP14MustAcceptOwnershipInSeparateTransaction()`
- Error hash: `0x5758dd07`
:::
```solidity
error LSP14MustAcceptOwnershipInSeparateTransaction();
```
_Cannot accept ownership in the same transaction with [`transferOwnership(...)`](#transferownership)._
Reverts when pending owner accept ownership in the same transaction of transferring ownership.
### LSP14NotInRenounceOwnershipInterval
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp14notinrenounceownershipinterval)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP14NotInRenounceOwnershipInterval(uint256,uint256)`
- Error hash: `0x1b080942`
:::
```solidity
error LSP14NotInRenounceOwnershipInterval(
uint256 renounceOwnershipStart,
uint256 renounceOwnershipEnd
);
```
_Cannot confirm ownership renouncement yet. The ownership renouncement is allowed from: `renounceOwnershipStart` until: `renounceOwnershipEnd`._
Reverts when trying to renounce ownership before the initial confirmation delay.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ----------------------------------------------------------------------- |
| `renounceOwnershipStart` | `uint256` | The start timestamp when one can confirm the renouncement of ownership. |
| `renounceOwnershipEnd` | `uint256` | The end timestamp when one can confirm the renouncement of ownership. |
### LSP20CallVerificationFailed
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp20callverificationfailed)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP20CallVerificationFailed(bool,bytes4)`
- Error hash: `0x9d6741e3`
:::
```solidity
error LSP20CallVerificationFailed(bool postCall, bytes4 returnedStatus);
```
reverts when the call to the owner does not return the LSP20 success value
#### Parameters
| Name | Type | Description |
| ---------------- | :------: | ------------------------------------------------------- |
| `postCall` | `bool` | True if the execution call was done, False otherwise |
| `returnedStatus` | `bytes4` | The bytes4 decoded data returned by the logic verifier. |
### LSP20CallingVerifierFailed
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp20callingverifierfailed)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP20CallingVerifierFailed(bool)`
- Error hash: `0x8c6a8ae3`
:::
```solidity
error LSP20CallingVerifierFailed(bool postCall);
```
reverts when the call to the owner fail with no revert reason
#### Parameters
| Name | Type | Description |
| ---------- | :----: | ---------------------------------------------------- |
| `postCall` | `bool` | True if the execution call was done, False otherwise |
### LSP20EOACannotVerifyCall
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp20eoacannotverifycall)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `LSP20EOACannotVerifyCall(address)`
- Error hash: `0x0c392301`
:::
```solidity
error LSP20EOACannotVerifyCall(address logicVerifier);
```
Reverts when the logic verifier is an Externally Owned Account (EOA) that cannot return the LSP20 success value.
#### Parameters
| Name | Type | Description |
| --------------- | :-------: | --------------------------------- |
| `logicVerifier` | `address` | The address of the logic verifier |
### NoExtensionFoundForFunctionSelector
:::note References
- Specification details: [**UniversalProfile**](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#noextensionfoundforfunctionselector)
- Solidity implementation: [`UniversalProfile.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol)
- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)`
- Error hash: `0xbb370b2b`
:::
```solidity
error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
```
reverts when there is no extension for the function selector being called with
#### Parameters
| Name | Type | Description |
| ------------------ | :------: | ----------- |
| `functionSelector` | `bytes4` | - |
[ERC-165]: https://eips.ethereum.org/EIPS/eip-165
[ERC-173]: https://eips.ethereum.org/EIPS/eip-173
[ERC-191]: https://eips.ethereum.org/EIPS/eip-191
[ERC-725X]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725X
[ERC-725Y]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md#ERC725Y
[ERC-725]: https://github.com/ERC725Alliance/ERC725/blob/main/docs/ERC-725.md
[ERC-1271]: https://eips.ethereum.org/EIPS/eip-1271
[EIP-1271]: https://eips.ethereum.org/EIPS/eip-1271
[LSP-0-ERC725Account]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-0-ERC725Account.md
[LSP-1-UniversalReceiver]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-1-UniversalReceiver.md
[LSP-2-ERC725YJSONSchema]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-2-ERC725YJSONSchema.md
[LSP-3-Profile-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-3-Profile-Metadata.md
[LSP-4-DigitalAsset-Metadata]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-4-DigitalAsset-Metadata.md
[LSP-5-ReceivedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-5-ReceivedAssets.md
[LSP-6-KeyManager]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-6-KeyManager.md
[LSP-7-DigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-7-DigitalAsset.md
[LSP-8-IdentifiableDigitalAsset]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md
[LSP-9-Vault.md]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-9-Vault.md.md
[LSP-10-ReceivedVaults]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-10-ReceivedVaults.md
[LSP-11-BasicSocialRecovery]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-11-BasicSocialRecovery.md
[LSP-12-IssuedAssets]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-12-IssuedAssets.md
[LSP-14-Ownable2Step]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-14-Ownable2Step.md
[LSP-15-TransactionRelayServiceAPI]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-15-TransactionRelayServiceAPI.md
[LSP-16-UniversalFactory]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-16-UniversalFactory.md
[LSP-17-ContractExtension]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-17-ContractExtension.md
[LSP-20-CallVerification]: https://github.com/lukso-network/LIPs/tree/main/LSPs/LSP-20-CallVerification.md
[ERC725]: https://docs.lukso.tech/standards/erc725
[UniversalProfile]: https://docs.lukso.tech/standards/accounts/introduction
[LSP0ERC725Account]: https://docs.lukso.tech/standards/accounts/lsp0-erc725account
[LSP1UniversalReceiver]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver
[LSP1UniversalReceiverDelegate]: https://docs.lukso.tech/standards/accounts/lsp1-universal-receiver-delegate
[LSP2ERC725YJSONSchema]: https://docs.lukso.tech/standards/metadata/lsp2-json-schema
[LSP4DigitalAssetMetadata]: https://docs.lukso.tech/standards/tokens/LSP4-Digital-Asset-Metadata
[LSP5ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp5-received-assets
[LSP6KeyManager]: https://docs.lukso.tech/standards/access-control/lsp6-key-manager
[LSP7DigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP7-Digital-Asset
[LSP8IdentifiableDigitalAsset]: https://docs.lukso.tech/standards/tokens/LSP8-Identifiable-Digital-Asset
[LSP10ReceivedVaults]: https://docs.lukso.tech/standards/metadata/lsp10-received-vaults
[LSP14Ownable2Step]: https://docs.lukso.tech/standards/access-control/lsp14-ownable-2-step
[LSP17ContractExtension]: https://docs.lukso.tech/standards/accounts/lsp17-contract-extension
[LSP20CallVerification]: https://docs.lukso.tech/standards/accounts/lsp20-call-verification
[_LSP17_EXTENSION_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md#lsp17extendable-specification
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md#specification-1
[LSP0OwnershipTransferStarted]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#transferownership
[LSP0OwnershipTransferred_SenderNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[LSP0OwnershipTransferred_RecipientNotification]: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#acceptownership
[`ERC725.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725.sol
[`ERC725Init.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Init.sol
[`ERC725InitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725InitAbstract.sol
[`IERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725X.sol
[`ERC725X.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725X.sol
[`ERC725XCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725XCore.sol
[`ERC725XInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInit.sol
[`ERC725XInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725XInitAbstract.sol
[`IERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/interfaces/IERC725Y.sol
[`ERC725Y.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725Y.sol
[`ERC725YCore.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/ERC725YCore.sol
[`ERC725YInit.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInit.sol
[`ERC725YInitAbstract.sol`]: https://github.com/ERC725Alliance/ERC725/blob/main/implementations/contracts/ERC725YInitAbstract.soll
[`OwnableUnset.sol`]: https://github.com/ERC725Alliance/ERC725/blob/v7.0.0/implementations/contracts/custom/OwnableUnset.sol
[`Create2.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Create2.sol
[`ECDSA.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/cryptography/ECDSA.sol
[`ERC165Checker.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165Checker.sol
[`Address.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/Address.sol
[`ERC165.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/introspection/ERC165.sol
[`EnumerableSet.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.6/contracts/utils/structs/EnumerableSet.so
[`Initializable.sol`]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.9.6/contracts/proxy/utils/Initializable.sol
[`BytesLib.sol`]: https://github.com/GNSPS/solidity-bytes-utils/blob/v0.8.4/contracts/BytesLib.sol
[`LSP0ERC725AccountCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol
[`LSP0Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Utils.sol
[`LSP0ERC725AccountInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol
[`ILSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/ILSP0ERC725Account.sol
[`LSP0ERC725Account.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725Account.sol
[`LSP0ERC725AccountInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol
[`LSP0Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp0-contracts/contracts/LSP0Constants.sol
[`UniversalProfileInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol
[`UniversalProfile.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfile.sol
[`UniversalProfileInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/universalprofile-contracts/contracts/UniversalProfileInit.sol
[`LSP1UniversalReceiverDelegateUP.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol
[`LSP1UniversalReceiverDelegateVault.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol
[`LSP1Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/blob/main/packages/lsp1delegate-contracts/contracts/LSP1Errors.sol
[`LSP1Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Utils.sol
[`ILSP1UniversalReceiver.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol
[`LSP1Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/LSP1Constants.sol
[`LSP4DigitalAssetMetadataInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol
[`LSP4DigitalAssetMetadata.sol`]: chttps://github.com/code-423n4/2023-06-lukso/tree/main/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol
[`LSP4Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Constants.sol
[`LSP4Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp4-contracts/contracts/LSP4Errors.sol
[`LSP6SetDataModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol
[`LSP6KeyManagerCore.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerCore.sol
[`LSP6ExecuteModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol
[`LSP6Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Utils.sol
[`LSP6Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Constants.sol
[`ILSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/ILSP6KeyManager.sol
[`LSP6Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Errors.sol
[`LSP6OwnershipModule.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol
[`LSP6KeyManagerInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol
[`LSP6KeyManager.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol
[`LSP6KeyManagerInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManagerInit.sol
[`ILSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/ILSP7DigitalAsset.sol
[`LSP7DigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol
[`LSP7CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol
[`LSP7CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol
[`LSP7DigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol
[`LSP7MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol
[`LSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7Mintable.sol
[`LSP7Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Errors.sol
[`LSP7MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/LSP7MintableInit.sol
[`ILSP7Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/presets/ILSP7Mintable.sol
[`LSP7Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7Burnable.sol
[`LSP7BurnableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol
[`LSP7Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp7-contracts/contracts/LSP7Constants.sol
[`ILSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol
[`LSP8EnumerableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol
[`LSP8Enumerable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol
[`LSP8CappedSupplyInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol
[`LSP8CappedSupply.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol
[`LSP8IdentifiableDigitalAssetInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol
[`LSP8MintableInitAbstract.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol
[`LSP8IdentifiableDigitalAsset.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol
[`LSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8Mintable.sol
[`LSP8Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Errors.sol
[`LSP8MintableInit.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/LSP8MintableInit.sol
[`LSP8Burnable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/extensions/LSP8Burnable.sol
[`ILSP8Mintable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/presets/ILSP8Mintable.sol
[`LSP8Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp8-contracts/contracts/LSP8Constants.s
[`LSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Ownable2Step.sol
[`ILSP14Ownable2Step.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/ILSP14Ownable2Step.sol
[`LSP14Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Constants.sol
[`LSP14Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp14-contracts/contracts/LSP14Errors.sol
[`LSP17Extendable.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol
[`LSP17Extension.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extension.sol
[`LSP17Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Constants.sol
[`LSP17Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Errors.sol
[`LSP17Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Utils.sol
[`LSP20CallVerification.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20CallVerification.sol
[`ILSP20CallVerifier.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/ILSP20CallVerifier.sol
[`LSP20Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Constants.sol
[`LSP20Errors.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp20-contracts/contracts/LSP20Errors.sol
[`LSP2Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol
[`LSP5Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol
[`LSP5Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Constants.sol
[`LSP10Utils.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol
[`LSP10Constants.sol`]: https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Constants.sol
---
---
title: ⛓ Deployed Implementation Contracts
description: List of base implementation and factory contracts addresses deployed on LUKSO Mainnet.
---
import { BaseContractsTable, FactoryContractsTable } from "@site/src/components/DeployedContractsTable"
# Deployed Implementation Contracts on LUKSO Mainnet
:::success Deployment Guides
Check our guide [**_🏭 Deploy Universal Profile + its Key Manager with LSP23 Factory_**](../learn/universal-profile/advanced-guides/deploy-up-with-lsp23.md) if you are looking for a script to deploy with the LSP23 Factory using _ethers.js_.
:::
Below is a list of contracts deployed on the LUKSO Mainnet for production usage. These contracts are deployed with `CREATE2` using the Nick Factory, so that they can be re-deployed at different addresses across multiple chains.
## 🏭 Factory contracts
The LSP23 Linked Contract Factory is used to deploy a full Universal Profile (with its Key Manager) and setup the main controller permissions. It is used by the UP Browser Extension and can be leveraged by any other dApp to deploy UPs.
## 📑 Implementation contracts
Below are the base implementation contracts deployed on mainnet.
They contain all the core logic of the:
- **Universal Profile** 🆙
- **LSP6 Key Manager** 🔐
- **LSP1 Universal Receiver Delegate** 📣
- **LSP7 Digital Asset** (Mintable preset where the `owner()` can call the `mint(...)` function)
- **LSP8 Identifiable Digital Asset** (Mintable preset where the `owner()` can call the `mint(...)` function)
Proxies pointing to these implementations must be initialized via the `initialize(...)` function to work.
The Universal Profile and Key Manager contracts of each users are deployed as EIP1167 minimal proxy, with their bytecode pointing to these implementation contracts. Finally, each Universal Profile has its **default** Universal Receiver Delegate contract linked to its 🆙 contract via the [`LSP1UniversalReceiverDelegate`](/standards/accounts/lsp1-universal-receiver-delegate.md#lsp1universalreceiverdelegate-singleton) data key.
You can inspect these details via our [_erc725-inspect_](https://erc725-inspect.lukso.tech/inspector?address=0x0F4180da178ed1C71398a57ca8Cb177F69591f1f&network=mainnet) tool.
---
---
title: Interfaces IDs
---
import InterfaceIdsTable from "./\_interface_ids_table.mdx";
# Interfaces IDs
:::caution
Interface IDs are not the most secure way to ensure that a contract implements a specific set of functions, as they are manually set and can be set to any value.
:::
**Interfaces IDs** help check if a contract supports a specific interface, e.g., its meta-interface. They are helpful if we want to interact with a contract but don't know if it supports an interface such as **[ERC725Y](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md#erc725y)**, **[LSP1UniversalReceiver](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md)**, etc.
The **supportsInterface** function from the **[ERC165](https://eips.ethereum.org/EIPS/eip-165)** standard returns `true` if the standard is supported, `false` otherwise.
The interface IDs of each LSP standards can be easily imported in your code from the [`@lukso/lsp-smart-contracts` NPM package](https://www.npmjs.com/package/@lukso/lsp-smart-contracts). They are accessible as follow:
```js
import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts';
const LSP0_INTERFACE_ID = INTERFACE_IDS.LSP0ERC725Account;
```
Note on importing INTERFACE_IDS in Hardhat Typescript projects
If you are trying to import the `INTERFACE_IDS` within a Hardhat Typescript project, use the following import syntax:
```ts
import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts/constants';
// This will raise an error if you have ES Lint enabled,
// but will allow you to import the constants in a Hardhat + Typescript based project.
const LSP0_INTERFACE_ID = INTERFACE_IDS.LSP0ERC725Account;
```
This is due to the current issue that it is not possible to import ES Modules in Hardhat Typescript projects.
---
---
title: Introduction
sidebar_position: 1
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {ContractCardsGallery} from '@site/src/components/ContractCardsGallery';
# Smart Contracts
**Welcome to the LUKSO Smart Contracts documentation!**
You will find on this page all the documentation and resources related to the `@lukso/lsp-smart-contracts`, the reference implementation in Solidity of the **[LSPs (LUKSO Standard Proposals)](../standards/introduction.md)**.
Each LSP standard and features are implemented in separate contracts under their own package. This allows developers to *"pick and choose"* the contracts for the requirements and behaviours they need for their protocols and applications. The `@lukso/lsp-smart-contracts` package also contains all the LSPs implementations listed below.
This modular design also helps in making the codebase easier to navigate and understand for developers using it.
## Installation
### with npm, yarn or pnpm
To get all the LSP smart contracts, install the `@lukso/lsp-smart-contracts`.
```bash
npm install @lukso/lsp-smart-contracts
```
```bash
yarn add @lukso/lsp-smart-contracts
```
```bash
pnpm add @lukso/lsp-smart-contracts
```
You can also install individual package based on the LSP that you need (see table above). For instance, if you only need the LSP7 Digital Asset contract implementation for your project, simply install the `@lukso/lsp7-contracts` package.
```bash
npm install @lukso/lsp7-contracts
```
```bash
yarn add @lukso/lsp7-contracts
```
```bash
pnpm add @lukso/lsp7-contracts
```
### with Foundry
Currently, the monorepo structure of the LSP Smart Contracts create issues when installing via Foundry and forge. As a workaround, it is recommend to use the following method:
1. install the smart contract package with your preferred package manager as shown above (npm, yarn or pnpm).
```bash
npm i @lukso/lsp7-contracts
```
2. add the following in your `remappings.txt` or `foundry.toml`.
```txt title="remappings.txt"
@lukso/=node_modules/@lukso/
```
This will install the LUKSO LSP Solidity contracts in your `node_modules/` folder and forge will remap your `import @lukso/...` statements in your `.sol` files by locating the LSP contracts in the `node_modules/` folder.
## Overview
Overall the contracts can be divided by their usage.
## Types of contracts
:::info
If you are using base contracts and are deploying proxies for your application, it is recommended to use a factory pattern to deploy and initialize the proxies to avoid potential front-running issues.
The **LSP16 Universal Factory** or **LSP23 Linked Contract Deployment** can help you achieve this.
:::
The `@lukso/lsp-smart-contracts` repository contains two types of contracts:
| Type | Description | Example |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| **Standard contracts** | One contract deployed per user. Deployed and initialized via a `constructor`. | `LSP0ERC725Account.sol` |
| **Base contracts** | Deploy one contract for all users. To be used as base contract behind proxies. Initialized via a `initialize(...)` function. | `LSP0ERC725AccountInit.sol` |
## LSP Recipes
Some of the LSP standards do not have a contract implementation as they represent **Metadata-Standards** to be used in the implementation contracts.
Each contracts are not just related to one specific section. They could be used in different fashion and combination, with the **Universal Profile**, **Digital Asset**, and **NFT 2.0** contracts.
For instance, the **Universal Profile Browser extension** comprises a set of contracts allow a better representation of the identity on the blockchain and better control over it.
## Further Information
- [UniversalProfile & Identity Section](https://youtu.be/SbTo_e3l_Lk?t=1727)
- [NFT 2.0 Section](https://youtu.be/hg1Ow6u9QVk)
- [LSP Smart Contracts - Detailed Architecture Diagram](https://twitter.com/gpersoon/status/1676588871255990272) by [@gpersoon](https://twitter.com/gpersoon)
---
# LSP10Utils
:::info Standard Specifications
[`LSP-10-ReceivedVaults`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-10-ReceivedVaults.md)
:::
:::info Solidity implementation
[`LSP10Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp10-contracts/contracts/LSP10Utils.sol)
:::
> LSP10 Utility library.
LSP5Utils is a library of functions that can be used to register and manage vaults received by an ERC725Y smart contract. Based on the LSP10 Received Vaults standard.
## 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.
### generateReceivedVaultKeys
:::caution Warning
This function returns empty arrays when encountering errors. Otherwise the arrays will contain 3 data keys and 3 data values.
:::
```solidity
function generateReceivedVaultKeys(
address receiver,
address vaultAddress
) internal view returns (bytes32[] lsp10DataKeys, bytes[] lsp10DataValues);
```
Generate an array of data keys/values pairs to be set on the receiver address after receiving vaults.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ------------------------------------------------------------------------------ |
| `receiver` | `address` | The address receiving the vault and where the LSP10 data keys should be added. |
| `vaultAddress` | `address` | The address of the vault being received. |
#### Returns
| Name | Type | Description |
| ----------------- | :---------: | --------------------------------------------------------------------- |
| `lsp10DataKeys` | `bytes32[]` | An array data keys used to update the [LSP-10-ReceivedAssets] data. |
| `lsp10DataValues` | `bytes[]` | An array data values used to update the [LSP-10-ReceivedAssets] data. |
### generateSentVaultKeys
:::caution Warning
Returns empty arrays when encountering errors. Otherwise the arrays must have at least 3 data keys and 3 data values.
:::
```solidity
function generateSentVaultKeys(
address sender,
address vaultAddress
) internal view returns (bytes32[] lsp10DataKeys, bytes[] lsp10DataValues);
```
Generate an array of data key/value pairs to be set on the sender address after sending vaults.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ------------------------------------------------------------------------------ |
| `sender` | `address` | The address sending the vault and where the LSP10 data keys should be updated. |
| `vaultAddress` | `address` | The address of the vault that is being sent. |
#### Returns
| Name | Type | Description |
| ----------------- | :---------: | --------------------------------------------------------------------- |
| `lsp10DataKeys` | `bytes32[]` | An array data keys used to update the [LSP-10-ReceivedAssets] data. |
| `lsp10DataValues` | `bytes[]` | An array data values used to update the [LSP-10-ReceivedAssets] data. |
### getLSP10ArrayLengthBytes
```solidity
function getLSP10ArrayLengthBytes(contract IERC725Y erc725YContract) internal view returns (bytes);
```
Get the raw bytes value stored under the `_LSP10_VAULTS_ARRAY_KEY`.
#### Parameters
| Name | Type | Description |
| ----------------- | :-----------------: | ----------------------------------------------- |
| `erc725YContract` | `contract IERC725Y` | The contract to query the ERC725Y storage from. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------------------- |
| `0` | `bytes` | The raw bytes value stored under this data key. |
---
# LSP17Utils
:::info Standard Specifications
[`LSP-17-ContractExtension`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md)
:::
:::info Solidity implementation
[`LSP17Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp17contractextension-contracts/contracts/LSP17Extendable.sol)
:::
> LSP17 Utility library to check an extension
## 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.
### isExtension
```solidity
function isExtension(
uint256 parametersLengthWithOffset,
uint256 msgDataLength
) internal pure returns (bool);
```
Returns whether the call is a normal call or an extension call by checking if
the `parametersLengthWithOffset` with an additional of 52 bytes supposed msg.sender
and msg.value appended is equal to the msgDataLength
---
# LSP1Utils
:::info Standard Specifications
[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md)
:::
:::info Solidity implementation
[`LSP1Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol)
:::
> LSP1 Utility library.
LSP1Utils is a library of utility functions that can be used to notify the `universalReceiver` function of a contract that implements LSP1 and retrieve information related to LSP1 `typeId`. Based on LSP1 Universal Receiver standard.
## 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.
### notifyUniversalReceiver
```solidity
function notifyUniversalReceiver(
address lsp1Implementation,
bytes32 typeId,
bytes data
) internal nonpayable;
```
Notify a contract at `lsp1Implementation` address by calling its `universalReceiver` function if this contract
supports the LSP1 interface.
#### Parameters
| Name | Type | Description |
| -------------------- | :-------: | -------------------------------------------------------------------------------------------------- |
| `lsp1Implementation` | `address` | The address of the contract to notify. |
| `typeId` | `bytes32` | A `bytes32` typeId. |
| `data` | `bytes` | Any optional data to send to the `universalReceiver` function to the `lsp1Implementation` address. |
### getLSP1DelegateValue
```solidity
function getLSP1DelegateValue(
mapping(bytes32 => bytes) erc725YStorage
) internal view returns (bytes);
```
_Retrieving the value stored under the ERC725Y data key `LSP1UniversalReceiverDelegate`._
Query internally the ERC725Y storage of a `ERC725Y` smart contract to retrieve
the value set under the `LSP1UniversalReceiverDelegate` data key.
#### Parameters
| Name | Type | Description |
| ---------------- | :-------------------------: | ----------------------------------------------------------- |
| `erc725YStorage` | `mapping(bytes32 => bytes)` | A reference to the ERC725Y storage mapping of the contract. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | -------------------------------------------------------------------------- |
| `0` | `bytes` | The bytes value stored under the `LSP1UniversalReceiverDelegate` data key. |
### getLSP1DelegateValueForTypeId
```solidity
function getLSP1DelegateValueForTypeId(
mapping(bytes32 => bytes) erc725YStorage,
bytes32 typeId
) internal view returns (bytes);
```
_Retrieving the value stored under the ERC725Y data key `LSP1UniversalReceiverDelegate:` for a specific `typeId`._
Query internally the ERC725Y storage of a `ERC725Y` smart contract to retrieve
the value set under the `LSP1UniversalReceiverDelegate:` data key for a specific LSP1 `typeId`.
#### Parameters
| Name | Type | Description |
| ---------------- | :-------------------------: | ----------------------------------------------------------- |
| `erc725YStorage` | `mapping(bytes32 => bytes)` | A reference to the ERC725Y storage mapping of the contract. |
| `typeId` | `bytes32` | A bytes32 LSP1 `typeId`; |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ------------------------------------------------------------------------------------ |
| `0` | `bytes` | The bytes value stored under the `LSP1UniversalReceiverDelegate:` data key. |
---
# LSP2Utils
:::info Standard Specifications
[`LSP-2-ERC725YJSONSchema`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md)
:::
:::info Solidity implementation
[`LSP2Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp2-contracts/contracts/LSP2Utils.sol)
:::
> LSP2 Utility library.
LSP2Utils is a library of utility functions that can be used to encode data key of different key type defined on the LSP2 standard. Based on LSP2 ERC725Y JSON Schema standard.
## 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.
### generateSingletonKey
```solidity
function generateSingletonKey(string keyName) internal pure returns (bytes32);
```
Generates a data key of keyType Singleton by hashing the string `keyName`. As:
```
keccak256("keyName")
```
#### Parameters
| Name | Type | Description |
| --------- | :------: | ---------------------------------------------------- |
| `keyName` | `string` | The string to hash to generate a Singleton data key. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type Singleton. |
### generateArrayKey
```solidity
function generateArrayKey(string arrayKeyName) internal pure returns (bytes32);
```
Generates a data key of keyType Array by hashing `arrayKeyName`. As:
```
keccak256("arrayKeyName[]")
```
#### Parameters
| Name | Type | Description |
| -------------- | :------: | ---------------------------------------------------------------------- |
| `arrayKeyName` | `string` | The string that will be used to generate a data key of key type Array. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type Array. |
### generateArrayElementKeyAtIndex
```solidity
function generateArrayElementKeyAtIndex(
bytes32 arrayKey,
uint128 index
) internal pure returns (bytes32);
```
Generates an Array data key at a specific `index` by concatenating together the first 16 bytes of `arrayKey`
with the 16 bytes of `index`. As:
```
arrayKey[index]
```
#### Parameters
| Name | Type | Description |
| ---------- | :-------: | ----------------------------------------------------------------------------------- |
| `arrayKey` | `bytes32` | The Array data key from which to generate the Array data key at a specific `index`. |
| `index` | `uint128` | The index number in the `arrayKey`. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type Array at a specific `index`. |
### generateMappingKey
```solidity
function generateMappingKey(
string firstWord,
string lastWord
) internal pure returns (bytes32);
```
Generates a data key of key type Mapping that map `firstWord` to `lastWord`. This is done by hashing two strings words `firstWord` and `lastWord`. As:
```
bytes10(firstWordHash):0000:bytes20(lastWordHash)
```
#### Parameters
| Name | Type | Description |
| ----------- | :------: | ---------------------------------------------------- |
| `firstWord` | `string` | The word to retrieve the first 10 bytes of its hash. |
| `lastWord` | `string` | The word to retrieve the first 10 bytes of its hash. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific `lastWord`. |
### generateMappingKey
```solidity
function generateMappingKey(
string firstWord,
address addr
) internal pure returns (bytes32);
```
Generates a data key of key type Mapping that map `firstWord` to an address `addr`.
This is done by hashing the string word `firstWord` and concatenating its first 10 bytes with `addr`. As:
```
bytes10(firstWordHash):0000:
```
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ---------------------------------------------------- |
| `firstWord` | `string` | The word to retrieve the first 10 bytes of its hash. |
| `addr` | `address` | An address to map `firstWord` to. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific address `addr`. |
### generateMappingKey
```solidity
function generateMappingKey(
bytes10 keyPrefix,
bytes20 bytes20Value
) internal pure returns (bytes32);
```
Generate a data key of key type Mapping that map a 10 bytes `keyPrefix` to a `bytes20Value`. As:
```
keyPrefix:bytes20Value
```
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ---------------------------------------------------- |
| `keyPrefix` | `bytes10` | The first part of the data key of key type Mapping. |
| `bytes20Value` | `bytes20` | The second part of the data key of key type Mapping. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type Mapping that map a `keyPrefix` to a specific `bytes20Value`. |
### generateMappingWithGroupingKey
```solidity
function generateMappingWithGroupingKey(
string firstWord,
string secondWord,
address addr
) internal pure returns (bytes32);
```
Generate a data key of key type MappingWithGrouping by using two strings `firstWord`
mapped to a `secondWord` mapped itself to a specific address `addr`. As:
```
bytes6(keccak256("firstWord")):bytes4(keccak256("secondWord")):0000:
```
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ---------------------------------------------------------------- |
| `firstWord` | `string` | The word to retrieve the first 6 bytes of its hash. |
| `secondWord` | `string` | The word to retrieve the first 4 bytes of its hash. |
| `addr` | `address` | The address that makes the last part of the MappingWithGrouping. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type MappingWithGrouping that map a `firstWord` to a `secondWord` to a specific address `addr`. |
### generateMappingWithGroupingKey
```solidity
function generateMappingWithGroupingKey(
bytes6 keyPrefix,
bytes4 mapPrefix,
bytes20 subMapKey
) internal pure returns (bytes32);
```
Generate a data key of key type MappingWithGrouping that map a `keyPrefix` to an other `mapPrefix` to a specific `subMapKey`. As:
```
keyPrefix:mapPrefix:0000:subMapKey
```
#### Parameters
| Name | Type | Description |
| ----------- | :-------: | ------------------------------------------------------------------------- |
| `keyPrefix` | `bytes6` | The first part (6 bytes) of the data key of keyType MappingWithGrouping. |
| `mapPrefix` | `bytes4` | The second part (4 bytes) of the data key of keyType MappingWithGrouping. |
| `subMapKey` | `bytes20` | The last part (bytes20) of the data key of keyType MappingWithGrouping. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ----------------------------------------------------------------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` to a `mapPrefix` to a specific `subMapKey`. |
### generateMappingWithGroupingKey
```solidity
function generateMappingWithGroupingKey(
bytes10 keyPrefix,
bytes20 bytes20Value
) internal pure returns (bytes32);
```
Generate a data key of key type MappingWithGrouping that map a 10 bytes `keyPrefix` to a specific `bytes20Value`. As:
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | -------------------------------------------------------------- |
| `keyPrefix` | `bytes10` | The first part of the data key of keyType MappingWithGrouping. |
| `bytes20Value` | `bytes20` | The last of the data key of keyType MappingWithGrouping. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | --------------------------------------------------------------------------------------- |
| `0` | `bytes32` | The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` |
### generateJSONURLValue
```solidity
function generateJSONURLValue(
string hashFunction,
string json,
string url
) internal pure returns (bytes);
```
Generate a JSONURL value content.
#### Parameters
| Name | Type | Description |
| -------------- | :------: | ---------------------------------------- |
| `hashFunction` | `string` | The function used to hash the JSON file. |
| `json` | `string` | Bytes value of the JSON file. |
| `url` | `string` | The URL where the JSON file is hosted. |
### generateASSETURLValue
```solidity
function generateASSETURLValue(
string hashFunction,
string assetBytes,
string url
) internal pure returns (bytes);
```
Generate a ASSETURL value content.
#### Parameters
| Name | Type | Description |
| -------------- | :------: | ---------------------------------------- |
| `hashFunction` | `string` | The function used to hash the JSON file. |
| `assetBytes` | `string` | Bytes value of the JSON file. |
| `url` | `string` | The URL where the JSON file is hosted. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------- |
| `0` | `bytes` | The encoded value as an `ASSETURL`. |
### isCompactBytesArray
```solidity
function isCompactBytesArray(
bytes compactBytesArray
) internal pure returns (bool);
```
Verify if `data` is a valid array of value encoded as a `CompactBytesArray` according to the LSP2 `CompactBytesArray` valueType specification.
#### Parameters
| Name | Type | Description |
| ------------------- | :-----: | -------------------------- |
| `compactBytesArray` | `bytes` | The bytes value to verify. |
#### Returns
| Name | Type | Description |
| ---- | :----: | ------------------------------------------------------------------------------- |
| `0` | `bool` | `true` if the `data` is correctly encoded CompactBytesArray, `false` otherwise. |
### isValidLSP2ArrayLengthValue
```solidity
function isValidLSP2ArrayLengthValue(
bytes arrayLength
) internal pure returns (bool);
```
Validates if the bytes `arrayLength` are exactly 16 bytes long, and are of the exact size of an LSP2 Array length value
#### Parameters
| Name | Type | Description |
| ------------- | :-----: | ------------------------------------- |
| `arrayLength` | `bytes` | Plain bytes that should be validated. |
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------------------- |
| `0` | `bool` | `true` if the value is 16 bytes long, `false` otherwise. |
### removeLastElementFromArrayAndMap
```solidity
function removeLastElementFromArrayAndMap(
bytes32 arrayKey,
uint128 newArrayLength,
bytes32 removedElementIndexKey,
bytes32 removedElementMapKey
) internal pure returns (bytes32[] dataKeys, bytes[] dataValues);
```
Generates Data Key/Value pairs for removing the last element from an LSP2 Array and a mapping Data Key.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-------: | ------------------------------------------------------------- |
| `arrayKey` | `bytes32` | The Data Key of Key Type Array. |
| `newArrayLength` | `uint128` | The new Array Length for the `arrayKey`. |
| `removedElementIndexKey` | `bytes32` | The Data Key of Key Type Array Index for the removed element. |
| `removedElementMapKey` | `bytes32` | The Data Key of a mapping to be removed. |
### removeElementFromArrayAndMap
:::info
The function assumes that the Data Value stored under the mapping Data Key is of length 20 where the last 16 bytes are the index of the element in the array.
:::
```solidity
function removeElementFromArrayAndMap(contract IERC725Y erc725YContract, bytes32 arrayKey, uint128 newArrayLength, bytes32 removedElementIndexKey, uint128 removedElementIndex, bytes32 removedElementMapKey) internal view returns (bytes32[] dataKeys, bytes[] dataValues);
```
Generates Data Key/Value pairs for removing an element from an LSP2 Array and a mapping Data Key.
#### Parameters
| Name | Type | Description |
| ------------------------ | :-----------------: | ------------------------------------------------------------- |
| `erc725YContract` | `contract IERC725Y` | The ERC725Y contract. |
| `arrayKey` | `bytes32` | The Data Key of Key Type Array. |
| `newArrayLength` | `uint128` | The new Array Length for the `arrayKey`. |
| `removedElementIndexKey` | `bytes32` | The Data Key of Key Type Array Index for the removed element. |
| `removedElementIndex` | `uint128` | the index of the removed element. |
| `removedElementMapKey` | `bytes32` | The Data Key of a mapping to be removed. |
---
# LSP5Utils
:::info Standard Specifications
[`LSP-5-ReceivedAssets`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md)
:::
:::info Solidity implementation
[`LSP5Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp5-contracts/contracts/LSP5Utils.sol)
:::
> LSP5 Utility library.
LSP5Utils is a library of functions that can be used to register and manage assets under an ERC725Y smart contract. Based on the LSP5 Received Assets standard.
## 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.
### generateReceivedAssetKeys
:::caution Warning
Returns empty arrays when encountering errors. Otherwise the arrays must have 3 data keys and 3 data values.
:::
```solidity
function generateReceivedAssetKeys(
address receiver,
address assetAddress,
bytes4 assetInterfaceId
) internal view returns (bytes32[] lsp5DataKeys, bytes[] lsp5DataValues);
```
Generate an array of data key/value pairs to be set on the receiver address after receiving assets.
#### Parameters
| Name | Type | Description |
| ------------------ | :-------: | ----------------------------------------------------------------------------- |
| `receiver` | `address` | The address receiving the asset and where the LSP5 data keys should be added. |
| `assetAddress` | `address` | The address of the asset being received (_e.g: an LSP7 or LSP8 token_). |
| `assetInterfaceId` | `bytes4` | The interfaceID of the asset being received. |
#### Returns
| Name | Type | Description |
| ---------------- | :---------: | -------------------------------------------------------------------- |
| `lsp5DataKeys` | `bytes32[]` | An array Data Keys used to update the [LSP-5-ReceivedAssets] data. |
| `lsp5DataValues` | `bytes[]` | An array Data Values used to update the [LSP-5-ReceivedAssets] data. |
### generateSentAssetKeys
:::caution Warning
Returns empty arrays when encountering errors. Otherwise the arrays must have at least 3 data keys and 3 data values.
:::
```solidity
function generateSentAssetKeys(
address sender,
address assetAddress
) internal view returns (bytes32[] lsp5DataKeys, bytes[] lsp5DataValues);
```
Generate an array of Data Key/Value pairs to be set on the sender address after sending assets.
#### Parameters
| Name | Type | Description |
| -------------- | :-------: | ----------------------------------------------------------------------------- |
| `sender` | `address` | The address sending the asset and where the LSP5 data keys should be updated. |
| `assetAddress` | `address` | The address of the asset that is being sent. |
#### Returns
| Name | Type | Description |
| ---------------- | :---------: | -------------------------------------------------------------------- |
| `lsp5DataKeys` | `bytes32[]` | An array Data Keys used to update the [LSP-5-ReceivedAssets] data. |
| `lsp5DataValues` | `bytes[]` | An array Data Values used to update the [LSP-5-ReceivedAssets] data. |
### getLSP5ArrayLengthBytes
```solidity
function getLSP5ArrayLengthBytes(contract IERC725Y erc725YContract) internal view returns (bytes);
```
Get the raw bytes value stored under the `_LSP5_RECEIVED_ASSETS_ARRAY_KEY`.
#### Parameters
| Name | Type | Description |
| ----------------- | :-----------------: | ----------------------------------------------- |
| `erc725YContract` | `contract IERC725Y` | The contract to query the ERC725Y storage from. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | ----------------------------------------------- |
| `0` | `bytes` | The raw bytes value stored under this data key. |
---
# LSP6Utils
:::info Standard Specifications
[`LSP-6-KeyManager`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md)
:::
:::info Solidity implementation
[`LSP6Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/tree/main/packages/lsp6-contracts/contracts/LSP6KeyManager.sol)
:::
> LSP6 Utility library.
LSP6Utils is a library of utility functions that can be used to retrieve, check and set LSP6 permissions stored under the ERC725Y storage of a smart contract. Based on the LSP6 Key Manager standard.
## 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.
### getPermissionsFor
:::info
If the raw value fetched from the ERC725Y storage of `target` is not 32 bytes long, this is considered
like _"no permissions are set"_ and will return 32 x `0x00` bytes as `bytes32(0)`.
:::
```solidity
function getPermissionsFor(contract IERC725Y target, address caller) internal view returns (bytes32);
```
Read the permissions of a `caller` on an ERC725Y `target` contract.
#### Parameters
| Name | Type | Description |
| -------- | :-----------------: | ----------------------------------------------------- |
| `target` | `contract IERC725Y` | An `IERC725Y` contract where to read the permissions. |
| `caller` | `address` | The controller address to read the permissions from. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------------------------ |
| `0` | `bytes32` | A `bytes32` BitArray containing the permissions of a controller address. |
### getAllowedCallsFor
```solidity
function getAllowedCallsFor(contract IERC725Y target, address from) internal view returns (bytes);
```
### getAllowedERC725YDataKeysFor
```solidity
function getAllowedERC725YDataKeysFor(contract IERC725Y target, address caller) internal view returns (bytes);
```
Read the Allowed ERC725Y data keys of a `caller` on an ERC725Y `target` contract.
#### Parameters
| Name | Type | Description |
| -------- | :-----------------: | ----------------------------------------------------- |
| `target` | `contract IERC725Y` | An `IERC725Y` contract where to read the permissions. |
| `caller` | `address` | The controller address to read the permissions from. |
#### Returns
| Name | Type | Description |
| ---- | :-----: | --------------------------------------------------------------------------------------------------------- |
| `0` | `bytes` | An abi-encoded array of allowed ERC725 data keys that the controller address is allowed to interact with. |
### hasPermission
```solidity
function hasPermission(
bytes32 controllerPermissions,
bytes32 permissionToCheck
) internal pure returns (bool);
```
Compare the permissions `controllerPermissions` of a controller address to check if they includes the permissions `permissionToCheck`.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-------: | --------------------------------------------------------------------------------- |
| `controllerPermissions` | `bytes32` | The permissions of an address. |
| `permissionToCheck` | `bytes32` | The permissions to check if the controller has under its `controllerPermissions`. |
#### Returns
| Name | Type | Description |
| ---- | :----: | ---------------------------------------------------------------------------------- |
| `0` | `bool` | `true` if `controllerPermissions` includes `permissionToCheck`, `false` otherwise. |
### isCompactBytesArrayOfAllowedCalls
```solidity
function isCompactBytesArrayOfAllowedCalls(
bytes allowedCallsCompacted
) internal pure returns (bool);
```
Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that each element must be 32 bytes long.
#### Parameters
| Name | Type | Description |
| ----------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowedCallsCompacted` | `bytes` | A compact bytes array of tuples `(bytes4,address,bytes4,bytes4)` to check (defined as `(bytes4,address,bytes4,bytes4)[CompactBytesArray]` in LSP6). |
#### Returns
| Name | Type | Description |
| ---- | :----: | -------------------------------------------------------------------------------------------------------------- |
| `0` | `bool` | `true` if the value passed is a valid compact bytes array of bytes32 AllowedCalls elements, `false` otherwise. |
### isCompactBytesArrayOfAllowedERC725YDataKeys
```solidity
function isCompactBytesArrayOfAllowedERC725YDataKeys(
bytes allowedERC725YDataKeysCompacted
) internal pure returns (bool);
```
Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that each element must be from 1 to 32 bytes long.
#### Parameters
| Name | Type | Description |
| --------------------------------- | :-----: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `allowedERC725YDataKeysCompacted` | `bytes` | a compact bytes array of ERC725Y data Keys (full bytes32 data keys or bytesN prefix) to check (defined as `bytes[CompactBytesArray]`). |
#### Returns
| Name | Type | Description |
| ---- | :----: | ------------------------------------------------------------------------------------------------------------------ |
| `0` | `bool` | `true` if the value passed is a valid compact bytes array of bytes32 Allowed ERC725Y data keys, `false` otherwise. |
### setDataViaKeyManager
```solidity
function setDataViaKeyManager(
address keyManagerAddress,
bytes32[] keys,
bytes[] values
) internal nonpayable returns (bytes result);
```
Use the `setData(bytes32[],bytes[])` function via the KeyManager on the target contract.
#### Parameters
| Name | Type | Description |
| ------------------- | :---------: | ----------------------------------- |
| `keyManagerAddress` | `address` | The address of the KeyManager. |
| `keys` | `bytes32[]` | The array of `bytes32[]` data keys. |
| `values` | `bytes[]` | The array of `bytes[]` data values. |
### combinePermissions
```solidity
function combinePermissions(
bytes32[] permissions
) internal pure returns (bytes32);
```
Combine multiple permissions into a single `bytes32`.
Make sure that the sum of the values of the input array is less than `2^256-1 to avoid overflow.
#### Parameters
| Name | Type | Description |
| ------------- | :---------: | ------------------------------------ |
| `permissions` | `bytes32[]` | The array of permissions to combine. |
#### Returns
| Name | Type | Description |
| ---- | :-------: | ------------------------------------------------------ |
| `0` | `bytes32` | A `bytes32` value containing the combined permissions. |
### generateNewPermissionsKeys
```solidity
function generateNewPermissionsKeys(contract IERC725Y account, address controller, bytes32 permissions) internal view returns (bytes32[] keys, bytes[] values);
```
Generate a new set of 3 x LSP6 permission data keys to add a new `controller` on `account`.
#### Parameters
| Name | Type | Description |
| ------------- | :-----------------: | ----------------------------------------------------------------------------------------------- |
| `account` | `contract IERC725Y` | The ERC725Y contract to add the controller into (used to fetch the `LSP6Permissions[]` length). |
| `controller` | `address` | The address of the controller to grant permissions to. |
| `permissions` | `bytes32` | The `BitArray` of permissions to grant to the controller. |
#### Returns
| Name | Type | Description |
| -------- | :---------: | --------------------------------------- |
| `keys` | `bytes32[]` | An array of 3 x data keys containing: |
| `values` | `bytes[]` | An array of 3 x data values containing: |
### getPermissionName
```solidity
function getPermissionName(bytes32 permission) internal pure returns (string);
```
Returns the name of the permission as a string.
#### Parameters
| Name | Type | Description |
| ------------ | :-------: | ----------------------------------------------------------------------------------- |
| `permission` | `bytes32` | The low-level `bytes32` permission as a `BitArray` to get the permission name from. |
#### Returns
| Name | Type | Description |
| ---- | :------: | -------------------------------------------------- |
| `0` | `string` | The string name of the `bytes32` permission value. |
---
---
title: ⛽️ Execute Relay Call (Meta Transactions)
sidebar_position: 7
---
# Execute Relay Call
## Sequential relay calls in the same channel
When executing 3 sequential relay calls with sequential nonces in a single channel (= nonces from the KeyManager retrieved via [`getNonce`](../contracts/LSP6KeyManager/LSP6KeyManager.md#getnonce), keep in mind that **if the first transaction does revert, the next 2 will revert in turns**. That happens because a Key Manager nonce is assigned to each relay call.
E.g.:
- First relay call - nonce is 4
- Second relay call - nonce is 5
- Third relay call - nonce is 6
One of the requirements for executing a relay call is that **the latest nonce (for a specific signer) stored on-chain in the Key Manager contract must be the same as the one used when signing the executed relay call**. After each successful execution, the on-chain nonce is incremented.
Given the example above, the on-chain nonce is 4 and we are executing the relay calls.
**If the first relay call pass ✅**
- First relay call: nonce was 4 -> incremented to 5
- Second relay call: nonce was 5 -> incremented to 6
- Third relay call: nonce was 6 -> incremented to 7
**If the first relay call fails ❌**
- **First relay call reverts ❌** nonce was 4 -> nonce remains 4
- Second relay call: nonce on-chain is 4 -> nonce used to sign was 5 = reverts ❌ with [`InvalidRelayNonce`](../contracts//LSP6KeyManager/LSP6KeyManager.md#invalidrelaynonce)
- Third relay call: nonce on-chain is 5 -> nonce used to sign was 6 = reverts ❌ with [`InvalidRelayNonce`](../contracts//LSP6KeyManager/LSP6KeyManager.md#invalidrelaynonce)
---
---
sidebar_label: '🔂 Follower System'
sidebar_position: 8
description: How to interact with and implement the LUKSO LSP26 Follower System in your dApps and smart contracts.
---
# Follower System
The LSP26 Follower System provides a standardized way to manage social connections on-chain. This guide will help you understand how to interact with the LSP26 contract.
## Interacting with the LSP26 - Follower System Contract
### Following an Address
To follow an address, call the `follow` function:
```solidity
function follow(address addr) external;
```
Example usage:
```javascript
await followerSystemContract.follow(addressToFollow);
```
### Unfollowing an Address
To unfollow an address, use the `unfollow` function:
```solidity
function unfollow(address addr) external;
```
Example usage:
```javascript
await followerSystemContract.unfollow(addressToUnfollow);
```
### Checking Follow Status
To check if one address is following another:
```solidity
function isFollowing(address follower, address addr) external view returns (bool);
```
Example usage:
```javascript
const isFollowing = await followerSystemContract.isFollowing(
followerAddress,
followedAddress,
);
```
### Retrieving Follower and Following Counts
To get the number of followers or followed addresses:
```solidity
function followerCount(address addr) external view returns (uint256);
function followingCount(address addr) external view returns (uint256);
```
Example usage:
```javascript
const followers = await followerSystemContract.followerCount(address);
const following = await followerSystemContract.followingCount(address);
```
## Best Practices
1. **Batch Operations**: For following or unfollowing multiple addresses at once, use the `followBatch` and `unfollowBatch` functions to save on gas costs.
2. **Pagination**: When retrieving large lists of followers or following, use the paginated `getFollowersByIndex` and `getFollowsByIndex` functions to avoid gas limits and improve performance.
3. **Event Listening**: Set up event listeners for the `Follow` and `Unfollow` events to keep your dApp's state in sync with on-chain changes.
4. **LSP1 Integration**: If your dApp interacts with LSP1-compatible contracts, be prepared to handle the LSP26 follow/unfollow notifications through the `universalReceiver` function.
---
---
title: 🔐 Key Manager
sidebar_position: 2
---
# Key Manager
The Key Manager uses the concept of [permissions](/docs/standards/access-control/lsp6-key-manager.md#permissions) to _authorize_ any addresses (dApps, protocols, devices, etc…) to do certain specific actions on the contract it is linked to. But why should you give anybody access to your smart contract? What is the intention behind doing this?
A Key Manager can be used with different setups by being linked to:
- **a LSP0ERC725Account like a Universal Profile**: to access your UP from other devices (that hold private keys), give access to some of your UP's functionalities to some dApps, or to create a DAO.
- **a Token contract**: to manage a token or NFT collection that was created in collaboration with multiple brands.
## Example of permissions usage
### For a Universal Profile
When looking at your Universal Profile within the 🆙 Browser Extension, your EOA / private keys held within your device (Browser or Mobile) is _the address that holds all the permissions_. We refer to this as the **main controller**.
You can then grant partial access to any address so that they can use your Universal Profile to interact on your behalf in a controlled manner. For example:
| Example | Description | Permissions |
| :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| Treasury & Funds Manager | Allow certain addresses to transfer your native tokens (or any LSP7 tokens) to certain specific addresses (_e.g: allow a crypto accountant or treasury manager to manage your funds on your behalf, allow a video game dApp to transfer the game tokens, etc..._) | `SUPER_TRANSFERVALUE` or `TRANSFERVALUE` + Allowed Calls on specific addresses or `CALL` + Allowed Calls on certain token addresses. |
| Brand Manager | Allow certain addresses representing Marketing managers to either manage the metadata (and branding) of your Universal Profile, or the metadata of any NFT collections created by your Universal Profile. | `SETDATA` + Allowed ERC725Y Data Keys to manage the UP `CALL` + Allowed Calls on specific NFT collection contract addresses. |
| Metadata Manager | Allow certain dApps to store some user settings related to the dApp under the Universal Profile's storage, and allow each specific dApp to update these specific data only. | `SETDATA` + Allowed ERC725Y Data Keys |
| Universal Receiver Delegate | Allow your Universal Receiver Delegate to operate automatically when receiving tokens or NFTs (_e.g: add / remove them in your received assets, automatically transfer a certain percentage of tokens received into a saving vault, save certain valuable NFTs into a vault, etc..._) | |
| Social Recovery | Plug a service to gain you back access to your 🆙 if you have a lost access to your main controller private key / address. | `ADDCONTROLLER` |
| Automated Trading | Allow a defi protocol to automatically transfer certain tokens automatically on your behalf for trading purpose | `CALL` + Allowed Calls on certain token addresses. |
Using the Key Manager's permissions for a Universal Profile enables to catalyze interactions on the blockchain. Instead of requiring the main profile owner to have to do _"everything by himself / herself"_ and perform any single actions, any permissioned addresses (trusted users, dapps, smart contracts behind protocols, third party services) can perform the action themselves in a restricted manner, without having to wait for the user to complete the action.
## Allowed ERC725Y Data Keys
:::note
If controller has `SETDATA` permission but has no `AllowedERC725YDataKeys`, controller will not be able to use the `SETDATA` permission at all.
:::
Key Manager allows for restricting controller addresses to change only specific or dynamic data keys. In order to achieve such functionality:
1. encode a set of data keys as [`bytes[CompactBytesArray]`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md#bytescompactbytesarray)
2. store them under the data key [`AllowedERC725YDataKeys`](/standards/access-control/lsp6-key-manager.md#allowed-erc725y-data-keys).
### Specific Data Keys
A _Specific Data Key_ must have the length of 32 bytes. Setting a _Specific Data Key_ in the [Allowed ERC725Y Data Keys](/standards/access-control/lsp6-key-manager.md#allowed-erc725y-data-keys) will allow the controller to only modify the data value of that _Specific Data Key_.
### Dynamic Data Keys
A _Dynamic Data Key_ can have any length between 0 and 32 (except 0 and 32). Setting a _Dynamic Data Key_ in the [Allowed ERC725Y Data Keys](/standards/access-control/lsp6-key-manager.md#allowed-erc725y-data-keys) will allow the controller to modify the data value of any data key that starts exactly with that _Dynamic Data Key_.
Example:
Dynamic Data Key - `0xcafe0000cafe0000beef0000beef`
| Data key | Can modify data value? |
| :------------------------------------------------------------------- | :--------------------- |
| `0xcafe0000cafe0000beef0000beef000000000000000000000000000000000000` | ✅ |
| `0xcafe0000cafe0000beef0000beef000000000000000000000000000000000123` | ✅ |
| `0xcafe0000cafe0000beef0000beefcafecafecafecafecafecafecafecafecafe` | ✅ |
| `0x0000000000000000000000000000cafecafecafecafecafecafecafecafecafe` | ❌ |
| `0x000000000000000000000000000000000000cafe0000cafe0000beef0000beef` | ❌ |
## Allowed Calls
:::note
If controller has `CALL` permission but has no `AllowedCalls`, controller will not be able to use the `CALL` permission at all.
:::
Key Manager allows for restricting controller addresses to be able to call specific functions on specific addresses which should be of a specific standard. In order to achieve such functionality one could encode a set of type calls, addresses, standards and functions to [`bytes[CompactBytesArray]`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md#bytesncompactbytesarray), and store them under the [Allowed Calls](../../standards/access-control/lsp6-key-manager.md#allowed-calls) data key.
_E.g._
Supposedly we have the following `AllowedCalls`:
`0x002000000002cafecafecafecafecafecafecafecafecafecafe24871b3d7f23690c002000000003cafecafecafecafecafecafecafecafecafecafe24871b3d44c028fe`
It can be decoded as:
| Allowed Calls | | |
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| First allowed call | **Call Types** - `0x00000002` (Call) **Address** - `0xcafecafecafecafecafecafecafecafecafecafe` **Standard** - `0x24871b3d` (LSP0) **Function** - `0x7f23690c` (`setData(bytes32,bytes)`) | - This allowed call permits the controller to use the function `setData(bytes32,bytes)` in the contract deployed at address `0xcafecafecafecafecafecafecafecafecafecafe`. - When calling that function the operation type has to be `CALL` with no value being sent. - The address `0xcafecafecafecafecafecafecafecafecafecafe` has to return true to `ERC165.supportsInterface(0x24871b3d)`. |
| Second allowed call | **Call Types** - `0x00000003` (Transfervalue & Call) **Address** - `0xcafecafecafecafecafecafecafecafecafecafe` **Standard** - `0x24871b3d` (LSP0) **Function** - `0x44c028fe` (`execute(uint256,address,uint256,bytes)`) | - This allowed call permits the controller to use the function `execute(uint256,address,uint256,bytes)` in the contract deployed at address `0xcafecafecafecafecafecafecafecafecafecafe`. - When calling that function the operation type has to be `CALL`, you can send value as well. - The address `0xcafecafecafecafecafecafecafecafecafecafe` has to return true to `ERC165.supportsInterface(0x24871b3d)`. |
## Implement custom permissions
> **Note:** although custom permissions can be created, this might not prevent from collisions where third party applications may treat the same custom permission differently.
The permission system of the Key Manager is versatile enough to allow new custom permissions to be created, for specific application use cases, aside from the default ones. Since the permissions use `bytes32` as type, the range is large enough to fit up to 256 permissions in total ([32 bytes = 256 bits](/standards/access-control/lsp6-key-manager#address-permissions)).
For instance, data stored under some data keys could be very sensitive for some specific dApp (_e.g: represent the :up: user settings for this dApp._), and a developer might not necessarily want to use the **Allowed ERC725Y Data Keys** for this particular data key.
The Solidity implementation of the Key Manager allows extend the verification logic to [implement custom permissions](https://github.com/lukso-network/lsp-smart-contracts/blob/8f0cfb2c573c44702d3155375b2d935b043416b3/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol#L263-L275). This can be done by simply overriding some of the functions that check for permissions depending on the action being performed (the action being defined by the calldata sent and the function being called, like `setData(...)`, `execute(...)`, etc...).
Below is a Solidity example of a custom Key Manager that can control a token contract and requires a specific permission to update the `LSP4Metadata`.
```solidity
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.5;
// interfaces
import {ILSP6KeyManager} from "@lukso/lsp6-contracts/contracts/ILSP6KeyManager.sol";
// modules
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {LSP6SetDataModule} from "@lukso/lsp6-contracts/contracts/LSP6SetDataModule.sol";
import {LSP6OwnershipModule} from "@lukso/lsp6-contracts/contracts/LSP6OwnershipModule.sol";
/// @title LSP6 Key Manager implementation to enable multiple owners with different permissions and roles
/// to control an LSP7 or LSP8 Token (instead of having a single `owner()`).
contract LSP6TokenManager is
ILSP6KeyManager,
ERC165,
LSP6SetDataModule,
LSP6OwnershipModule
{
using Address for *;
using ECDSA for *;
using LSP6Utils for *;
/// @dev address of the LSP7/8 Token contract this Key Manager controls
address private immutable _linkedToken;
mapping(address => mapping(uint256 => uint256)) internal _nonceStore;
constructor(address linkedToken_) {
if (linkedToken_ == address(0)) revert InvalidLSP6Target();
_linkedToken = linkedToken_;
}
/// @dev permission required to update the `LSP4Metadata` data key via `setData(...)` on the token contract
bytes32 constant _PERMISSION_UPDATE_TOKEN_METADATA = 0x0000000000000000000000000000000000000000000000000000000000400000;
/// @dev keccak256('LSP4Metadata') --> from the LSP4 Standard
/// This is defined in `LSP4Constants.sol`, but we write it here for better understanding.
bytes32 constant _LSP4_METADATA_KEY = 0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e;
/// @inheritdoc LSP6SetDataModule
/// @dev implement a custom check to verify if the controller
/// has the permission to update the token metadata
function _getPermissionRequiredToSetDataKey(
address controlledContract,
bytes32 controllerPermissions,
bytes32 inputDataKey,
bytes memory inputDataValue
) internal view virtual override returns (bytes32) {
if (inputDataKey == _LSP4_METADATA_KEY) {
controllerPermissions.hasPermission(
_PERMISSION_UPDATE_TOKEN_METADATA
);
}
super._getPermissionRequiredToSetDataKey(
controlledContract,
controllerPermissions,
inputDataKey,
inputDataValue
);
}
}
```
As you can see from the Solidity code snippet above, since the Key Manager is broken down in multiple modules for each set of permissions related to specific type of actions (`LSP6SetDataModule`, `LSP6OwnershipModule`), it is relatively easy to create a specific implementation by-reusing the same code and implement custom permissions check on top based on the examples above.
## Further Reading
- [The Bytecode episode #4 (Youtube) - overview of the Solidity code of the `LSP6KeyManagerCore.sol` by Jean Cavallera](https://www.youtube.com/watch?v=2Sm9LsCPjdE)
---
---
title: ⚙️ Extendable & Extension Contracts
sidebar_position: 6
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Extendable & Extension Contracts
Contracts that use the LSP17 standard are called **Extendable Contracts**. Meaning they can extend their functionalities by linking **Extension Contracts** to them for specific functionalities that they do not support natively.
## Extendable Contracts
The list of extensions for specific functions are stored under the specific data keys under their ERC725Y storage. You can think of them as **Extension Hosts**.
You can inherit the [`LSP17Extendable.sol`](../contracts/LSP17ContractExtension/LSP17Extendable.md) contract to create an extendable contract.
To add an extension handler for a specific function selector, you can set the address of the extension contract under the `LSP17Extension:` data key as follow:
- 10 bytes (= 20 hexadecimal characters): `LSP17Extension` Mapping data key prefix
- 20 bytes (= 40 hexadecimal characters): the `bytes4` function selector right padded with 16 zero bytes.
Now whenever a call is made to this function selector on the extendable contract, it will land in its `fallback` function. From there, the calldata will be forwarded to the retrieved extension contract address set above.
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ~0.8.4;
// libraries
import {
LSP2Utils
} from "@lukso/lsp-smart-contracts/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol";
// constants
import {
_LSP17_EXTENSION_PREFIX
} from "@lukso/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Constants.sol";
function generateLSP17ExtensionDataKey(bytes4 extensionSelector) pure returns (bytes32) {
return
LSP2Utils.generateMappingKey(
_LSP17_EXTENSION_PREFIX,
bytes20(extensionSelector)
);
}
```
```js
import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts';
import { concat, zeroPadBytes } from 'ethers';
const extensionSelector = zeroPadBytes('0xcafecafe', 20);
const dataKey = concat([
ERC725YDataKeys.LSP17.LSP17ExtensionPrefix,
extensionSelector,
]);
```
:::warning
Be aware that adding an extension that can `selfdestruct` itself can be dangerous. This can make the [`LSP17Extendable`](../contracts/LSP17ContractExtension/LSP17Extendable.md) contract vulnerable to [metamorphic contracts](https://twitter.com/samczsun/status/1660012956632104960).
If this extension contract has been deployed at a pre-determined address with `CREATE2`, an attacker could `selfdestruct` it and deploy a new one with different runtime bytecode using `CREATE2` and the same salt and initialization code as on the first deployment.
This can result in the new contract to have the same address but different functionality. An attacker can now use these new functionalities to perform malicious actions.
:::
### Forwarding native tokens received to extensions
The [`LSP17Extendable`](../contracts/LSP17ContractExtension/LSP17Extendable.md) contract implementation does not forward by default the native tokens received by the contract to the extension contract.
If you want your extension to receive native tokens, by forwarding them to the extension contract (for instance, for extensions that require native tokens as part of their logic, or to make the extendable contract to fully work as a _"proxy forwarder contract"_), you can override the [`_fallbackLSP17Extendable`](../contracts/LSP17ContractExtension/LSP17Extendable.md#_fallbacklsp17extendable) function.
## Extensions Contracts
Extension contracts are contracts deployed on the network that aim to be used for extending functionalities that use the LSP17 standard.
You can inherit the [`LSP17Extendable.sol`](../contracts/LSP17ContractExtension/LSP17Extendable.md) contract to create a contract extension.
:::warning
The extendable contract might forward the value that it received on extension call.
If the extension you are creating is not intended to receive value, make sure to revert by adding a simple check:
```solidity
if (msg.value == 0) revert(...)
```
**If your extension does not have a way to withdraw the native tokens, they will be stuck in the contract**.
:::
### Checking the amount of native tokens received by the extended contract
You can use the function [`_extendableMsgValue()`](../contracts/LSP17ContractExtension/LSP17Extension.md#_extendablemsgvalue) function to check the amount of native tokens received by the extended contract in the first place.
This function can be useful if you want to create a behaviour in your extension contract that takes into account that the `msg.value` received. For instance:
- your extended contract received a specific amount of native tokens (_e.g: `_extendableMsgValue() == 1 ether`_).
- your extended contract did not receive any native tokens at all (_e.g: `_extendableMsgValue() == 0`_).
## Difference between Inheriting and Extending
The code of a smart contract can be either inherited or extended by an extendable smart contract.
The idea of inheriting a Solidity contract is that the code or the function inherited will be included natively in the contract, so whenever someone calls the logic, it will be executed directly.
```mermaid
sequenceDiagram
participant User
participant InheritedContract
User ->> InheritedContract: Call Function
InheritedContract-->>InheritedContract: Execute Logic
InheritedContract -->> User: Return
```
Extending means the logic is borrowed from somewhere else. Whenever someone calls the extended smart contract, this contract calls the extension, and lets the logic execute from the extension.
```mermaid
sequenceDiagram
participant User
participant ExtendableContract
participant Extension
User ->> ExtendableContract: Call Function
ExtendableContract ->> Extension: Forward Call
Extension -->> Extension: Execute Logic
Extension -->> ExtendableContract: Return
ExtendableContract -->> User: Return
```
### Differences
1. **Flexibility:** Extensions are useful when a functionality is needed but the behavior is not certain. The extension can be changed later to a newer version that modifies the logic. With inheriting, the implementation logic is fixed permanently.
2. **Event Emission:** If event emission on the core contract is important, inheriting is the better choice. When extending functionality, the logic is triggered from the extension, and all events are emitted there. This could be problematic for dApps that require events to be on the same smart contract, not on a potentially changeable extension.
3. **Contract Size Limit:** Extensions are useful when a smart contract is expected to have many functionalities, but the smart contract cannot include all the logic due to a contract size limit. It works as a router; when called with a function, it checks its extension and calls it.
4. **Context Changing:** When the logic is implemented by inheriting, `msg.sender` will be the caller and `msg.value` will be the value sent. In the case of extending, the `msg.sender` in the function in the extension will be the extended contract. The function can still have access to the original initiator caller by using it from the extra appended calldata. But in case of the function being executed is calling another function, when inherited the caller will be the original contract, but in the case of extension, the caller will be the extension. This could be problematic or require different structural adjustments.
---
---
title: 🔊 Universal Receiver
sidebar_position: 3
---
# Universal Receiver Delegate
There are two default implementations of the LSP1 Delegate contracts available, each for different use cases.
| Contract | Description |
| -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **[`LSP1UniversalReceiverDelegateUP.sol`](/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.md)** | Add feature to a `LSP0ERC725Account` to registered and un-register tokens (LSP7 and LSP8) and vaults (LSP9) received. |
| **[`LSP1UniversalReceiverDelegateVault.sol`](/contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.md)** | Add feature to a `LSP9Vault` to register and un-register tokens (LSP7 and LSP8). |
## Routing
The Universal Profile implementation allows for attaching multiple instances of Universal Receiver Delegate to it. This is due to LSP1 Routing. You could have a single General Purpose Universal Receiver Delegate and multiple instances of Specific Universal Receiver Delegate.
A General Purpose Universal Receiver Delegate has its address stored under the [LSP1UniversalReceiverDelegate Singleton](/standards/accounts/lsp1-universal-receiver-delegate.md#lsp1universalreceiverdelegate-singleton) data key. This contract will be called on any LSP1 hook, meaning that it can potentially react on any [TypeID](../type-ids.md#universal-receiver-type-ids).
A Specific Universal Receiver Delegate has its address stored under the [LSP1UniversalReceiverDelegate Mapping](/standards/accounts/lsp1-universal-receiver-delegate.md#lsp1universalreceiverdelegate-mapping) data key. This contract will be called on specific LSP1 hook, depending on the [TypeID](../type-ids.md#universal-receiver-type-ids) that was passed as a parameter in the hook, meaning that it only reacts on a single specific [TypeID](../type-ids.md#universal-receiver-type-ids).
---
---
title: Create a Non Fungible Token
sidebar_position: 1
---
# Create a Non Fungible Token
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// modules
import {
LSP8IdentifiableDigitalAsset
} from "@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol";
// constants
import {
_LSP8_TOKENID_FORMAT_NUMBER
} from "@lukso/lsp8-contracts/contracts/LSP8Constants.sol";
import {
_LSP4_TOKEN_TYPE_COLLECTION
} from "@lukso/lsp4-contracts/contracts/LSP4Constants.sol";
contract BasicNFTCollection is LSP8IdentifiableDigitalAsset {
constructor(
string memory nftCollectionName,
string memory nftCollectionSymbol,
address contractOwner
)
LSP8IdentifiableDigitalAsset(
nftCollectionName,
nftCollectionSymbol,
contractOwner,
_LSP4_TOKEN_TYPE_COLLECTION,
_LSP8_TOKENID_FORMAT_NUMBER
)
{
// contract logic goes here...
}
}
```
## LSP8 NFT extensions
The `@lukso/lsp8-contracts` package includes token extensions (similarly to OpenZeppelin contracts) that can be added through inheritance. This enables to include specific functionalities for building your token.
| Extension contract | Description |
| :---------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
| [`LSP8Burnable.sol`](../../contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md) | exposes a public `burn(...)` function that allows any NFT holder or operator to burn a specific NFT tokenId. |
| [`LSP8CappedSupply.sol`](../../contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md) | enable to specify a maximum supply on deployment / initialization, which caps the maximum amount of NFT that can be minted in the collection. |
| [`LSP8Enumerable.sol`](../../contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md) | functionality to enumerate the list of NFTs in a collection. |
---
---
title: Customize transfer behaviour
sidebar_position: 2
---
# Customize transfer behaviour
The `LSP8IdenfitiableDigitalAsset` contract implementation includes the `_beforeTokenTransfer` and `_afterTokenTransfer` functions that offer the ability to specify custom logic that can run before or after the token transfer has happen (= before or after the balances in the contract state have been updated).
---
---
title: 🖼️ Identifiable Digital Asset (NFT)
sidebar_position: 5
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# LSP8 Identifiable Digital Asset
:::danger Deprecation of `LSP8CompatibleERC721`
The `LSP8CompatibleERC721` contracts have been deprecated and deleted from the [`@lukso/lsp-smart-contracts`](https://github.com/lukso-network/lsp-smart-contracts) package since version `0.15.0`, because of their unsafe nature and [security considerations (See PR #845 for more details)](https://github.com/lukso-network/lsp-smart-contracts/pull/845#issuecomment-1888671461).
They are not recommended to be used. However, if you want to still use them, they remain available in the version [`0.14.0`](https://github.com/lukso-network/lsp-smart-contracts/releases/tag/lsp-smart-contracts-v0.14.0).
:::
The **LSP8 Identifiable Digital Asset** contract is the newest advanced version of the existing ERC NFT standards, such as ERC721. LSP8 identifiable digital assets represent **N**on **F**ungible **T**okens (NFTs) that can be uniquely traded. Each NFT is identified with a tokenId, based on **[ERC721](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol)** and can also have its own metadata set using the **[`setDataForTokenId(...)`](../../contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md#setdatafortokenid)** function.
A **bytes32** value is used for tokenId to allow many uses of token identification, including numbers, contract addresses, and hashed values (i.e., serial numbers).
## Installation & Usage
The LSP8 smart contracts and their ABIs are available are available in their own individual package. To use them, install `@lukso/lsp8-contracts` as a dependency in your project.
```
npm install @lukso/lsp8-contracts
```
```
yarn add @lukso/lsp8-contracts
```
```
pnpm add @lukso/lsp8-contracts
```
`LSP8IdentifiableDigitalAsset.sol` is an `abstract` contract that is not deployable as is, because it does not contain any public functions by default to manage token supply (_e.g: no public `mint(...)` or `burn(...)` functions_). You can either:
- use the `LSP8Mintable` preset contract that contains a public `mint(...)` function callable only by the contract's owner.
- or extend the `LSP8IdentifiableDigitalAsset` contract (_see below_) and create your own supply mechanism by defining public methods that use the internal `_mint(...)` and `_burn(...)` functions.
## Comparisons with ERC721