Socket
Book a DemoInstallSign in
Socket

@lukso/lsp-smart-contracts

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lukso/lsp-smart-contracts

The reference smart contract implementation for the LUKSO LSP standards

latest
npmnpm
Version
0.16.7
Version published
Maintainers
2
Created
Source

@lukso/lsp-smart-contracts

This is the "umbrella" package for the LSP smart contracts. It contains all the individual @lukso/lspN-contracts packages (where N is an LSP number) as dependencies.

Installation

npm install @lukso/lsp-smart-contracts

Usage

in Javascript

The JSON ABIs of the smart contracts can be imported as follow:

import LSP0ERC725Account from "@lukso/lsp-smart-contracts/artifacts/LSP0ERC725Account.json";

const myContract = new web3.eth.Contract(
  LSP0ERC725Account.abi,
  "",
  defaultOptions
);

in Solidity

import "@lukso/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.sol";

contract MyAccount is LSP0ERC725Account {
  constructor(address _newOwner) LSP0ERC725Account(_newOwner) {}
}

Available Constants & Types

The @lukso/lsp-smart-contracts npm package contains useful constants such as interface IDs, and ERC725Y data keys related to the LSP Standards. You can import and access them as follows.

import {
  INTERFACE_IDS,
  ERC1271,
  LSP8_TOKEN_ID_FORMAT,
  LSP1_TYPE_IDS,
  OPERATION_TYPES,
  PERMISSIONS,
  ALL_PERMISSIONS,
  SupportedStandards,
  ERC725YDataKeys,
  INTERFACE_ID_LSP1DELEGATE,
  LSP6DataKeys,
  LSP25_VERSION,
  LSPSupportedStandard,
  ErrorSelectors,
  EventSigHashes,
  FunctionSelectors,
  ContractsDocs,
  StateVariables,
} from "@lukso/lsp-smart-contracts";

Note: we also export it as @lukso/lsp-smart-contracts/constants or @lukso/lsp-smart-contracts/constants.js to keep it backward compatible.

It also includes constant values Array data keys to retrieve both the array length and for index access.

'LSP5ReceivedAssets[]': {
    length: '0x6460ee3c0aac563ccbf76d6e1d07bada78e3a9514e6382b736ed3f478ab7b90b',
    index: '0x6460ee3c0aac563ccbf76d6e1d07bada',
},

Note for Hardhat Typescript projects

If you are trying to import the constants in a Hardhat project that uses Typescript, you will need to import the constants from the dist folder directly, as shown in the code snippet:

import { INTERFACE_IDS } from "@lukso/lsp-smart-contracts/dist/constants.cjs.js";

// 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 LSP0InterfaceId = INTERFACE_IDS.LSP0ERC725Account;

See the issue related to Hardhat Typescript + ES Modules in the Hardhat docs for more infos.

Typescript types

The following additional typescript types are also available, including types for the JSON format of the LSP3 Profile and LSP4 Digital Asset metadata.

import {
  LSP2ArrayKey,
  LSPSupportedStandard,
  LSP6PermissionName,
  LSP3ProfileMetadataJSON,
  LSP3ProfileMetadata,
  LSP4DigitalAssetMetadataJSON,
  LSP4DigitalAssetMetadata,
  ImageMetadata,
  LinkMetadata,
  AssetMetadata,
} from "@lukso/lsp-smart-contracts";

You can also import the type-safe ABI of each LSP smart contracts from the /abi path.

import {
  lsp0Erc725AccountAbi,
  lsp6KeyManagerAbi,
  lsp7DigitalAssetAbi,
  lsp8IdentifiableDigitalAssetAbi,
} from "@lukso/lsp-smart-contracts/abi";

Keywords

LUKSO

FAQs

Package last updated on 19 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts