Interfaces IDs
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, LSP1UniversalReceiver, etc.
The supportsInterface function from the ERC165 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. They are accessible as follow:
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:
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.
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 predfined 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. |