npm.io
0.18.1 • Published 3 months ago

@lukso/lsp8-contracts

Licence
Apache-2.0
Version
0.18.1
Deps
5
Size
3.8 MB
Vulns
0
Weekly
0
Stars
88

LSP8 Identifiable Digital Asset · npm version

The contracts LSP8Votes and LSP8VotesInitAbstract have not been formally audited by an external third party and are not recommended to be used in production without undergoing an independent security audit.

npm package for the LSP8 Identifiable Digital Asset standard (NFTs token IDs).

Installation

npm install @lukso/lsp8-contracts

Available Constants & Types

The @lukso/lsp8-contracts npm package contains useful constants such as interface IDs or ERC725Y data keys related to the LSP8 Standard. You can import and access them as follows.

In JavaScript.

import {
  INTERFACE_ID_LSP8,
  INTERFACE_ID_LSP8_PREVIOUS,
  LSP8DataKeys,
  LSP8_TYPE_IDS,
  LSP8_TOKEN_ID_FORMAT,
} from "@lukso/lsp8-contracts";

In Solidity.

import {
  _INTERFACEID_LSP8,
  _INTERFACEID_LSP8_V0_12_0,
  _INTERFACEID_LSP8_V0_14_0,
  _LSP8_TOKENID_FORMAT_KEY,
  _LSP8_TOKEN_METADATA_BASE_URI,
  _LSP8_REFERENCE_CONTRACT,
  _TYPEID_LSP8_TOKENSSENDER,
  _TYPEID_LSP8_TOKENSRECIPIENT,
  _TYPEID_LSP8_TOKENOPERATOR,
  _LSP8_TOKENID_FORMAT_NUMBER,
  _LSP8_TOKENID_FORMAT_STRING,
  _LSP8_TOKENID_FORMAT_ADDRESS,
  _LSP8_TOKENID_FORMAT_UNIQUE_ID,
  _LSP8_TOKENID_FORMAT_HASH,
  _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_NUMBER,
  _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_STRING,
  _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_ADDRESS,
  _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_UNIQUE_ID,
  _LSP8_TOKENID_FORMAT_MIXED_DEFAULT_HASH
} from "@lukso/lsp8-contracts/contracts/LSP8Constants.sol";

TypeScript types

You can also import the type-safe ABI from the /abi path.

import {
    // standard version
    lsp8IdentifiableDigitalAssetAbi,
    lsp8CappedSupplyAbi,
    lsp8MintableAbi,
    lsp8VotesAbi
    // proxy version
    lsp8CappedSupplyInitAbstractAbi,
    lsp8IdentifiableDigitalAssetInitAbstractAbi,
    lsp8MintableInitAbi,
 } from '@lukso/lsp8-contracts/abi';

Foundry deployment

This package includes two Foundry scripts to deploy the LSP8CustomizableTokenInit and LSP8MintableInit implementation contracts.

  • scripts/DeployLSP8CustomizableTokenInit.s.sol
  • scripts/DeployLSP8MintableInit.s.sol

Set your deployer key first:

export PRIVATE_KEY=0x...

Dry run against LUKSO Testnet

LSP8CustomizableTokenInit
FOUNDRY_PROFILE=lsp8 forge script packages/lsp8-contracts/scripts/DeployLSP8CustomizableTokenInit.s.sol:DeployLSP8CustomizableTokenInitScript --rpc-url https://rpc.testnet.lukso.network
LSP8MintableInit
FOUNDRY_PROFILE=lsp8 forge script packages/lsp8-contracts/scripts/DeployLSP8MintableInit.s.sol:DeployLSP8MintableInitScript --rpc-url https://rpc.testnet.lukso.network

Broadcast the deployment

Use one of the methods described in the foundry docs to broadcast from a specific address

LSP8CustomizableTokenInit
FOUNDRY_PROFILE=lsp8 forge script packages/lsp8-contracts/scripts/DeployLSP8CustomizableTokenInit.s.sol:DeployLSP8CustomizableTokenInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast
LSP8MintableInit
FOUNDRY_PROFILE=lsp8 forge script packages/lsp8-contracts/scripts/DeployLSP8MintableInit.s.sol:DeployLSP8MintableInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast

Broadcast and verify on the LUKSO Testnet Blockscout explorer:

LSP8CustomizableTokenInit
FOUNDRY_PROFILE=lsp8 forge script packages/lsp8-contracts/scripts/DeployLSP8CustomizableTokenInit.s.sol:DeployLSP8CustomizableTokenInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast --verify --verifier blockscout --verifier-url https://explorer.execution.testnet.lukso.network/api/
LSP8MintableInit
FOUNDRY_PROFILE=lsp8 forge script packages/lsp8-contracts/scripts/DeployLSP8MintableInit.s.sol:DeployLSP8MintableInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast --verify --verifier blockscout --verifier-url https://explorer.execution.testnet.lukso.network/api/

Audits

The LSP8 Customizable Token presets and their token extensions listed below were reviewed by the AI auditing tool Nethermind AI Audit Agent (May 2026). See the audit report PDF.

Presets

Extensions (standard and Init variants)

Keywords