npm.io
0.18.1 • Published 3 months ago

@lukso/lsp7-contracts

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

LSP7 Digital Asset · npm version

The contracts LSP7Votes and LSP7VotesInitAbstract 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 LSP7 Digital Asset standard (fungible token).

Installation

npm install @lukso/lsp7-contracts

Available Constants & Types

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

In JavaScript.

import {
  INTERFACE_ID_LSP7,
  INTERFACE_ID_LSP7_PREVIOUS,
  LSP7_TYPE_IDS,
} from "@lukso/lsp7-contracts";

In Solidity.

import {
  _INTERFACEID_LSP7,
  _INTERFACEID_LSP7_V0_12_0,
  _INTERFACEID_LSP7_V0_14_0,
  _TYPEID_LSP7_DELEGATOR,
  _TYPEID_LSP7_DELEGATEE,
  _TYPEID_LSP7_TOKENSSENDER,
  _TYPEID_LSP7_TOKENSRECIPIENT,
  _TYPEID_LSP7_TOKENOPERATOR
} from "@lukso/lsp7-contracts/contracts/LSP7Constants.sol";

The LSP7_TYPE_IDS object includes type IDs for the following types of notifications:

'LSP7Tokens_SenderNotification';
'LSP7Tokens_RecipientNotification';
'LSP7Tokens_OperatorNotification';
'LSP7Tokens_VotesDelegatorNotification';
'LSP7Tokens_VotesDelegateeNotification';

TypeScript types

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

import {
    // standard version
    lsp7DigitalAssetAbi,
    lsp7CappedSupplyAbi,
    lsp7MintableAbi,
    lsp7VotesAbi
    // proxy version
    lsp7CappedSupplyInitAbstractAbi,
    lsp7DigitalAssetInitAbstractAbi,
    lsp7MintableInitAbi,
 } from '@lukso/lsp7-contracts/abi';

Foundry deployment

This package includes two Foundry scripts to deploy the LSP7CustomizableTokenInit and LSP7MintableInit implementation contracts.

  • scripts/DeployLSP7CustomizableTokenInit.s.sol
  • scripts/DeployLSP7MintableInit.s.sol

Set your deployer key first:

export PRIVATE_KEY=0x...

Dry run against LUKSO Testnet

LSP7CustomizableTokenInit
FOUNDRY_PROFILE=lsp7 forge script packages/lsp7-contracts/scripts/DeployLSP7CustomizableTokenInit.s.sol:DeployLSP7CustomizableTokenInitScript --rpc-url https://rpc.testnet.lukso.network
LSP7MintableInit
FOUNDRY_PROFILE=lsp7 forge script packages/lsp7-contracts/scripts/DeployLSP7MintableInit.s.sol:DeployLSP7MintableInitScript --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

LSP7CustomizableTokenInit
FOUNDRY_PROFILE=lsp7 forge script packages/lsp7-contracts/scripts/DeployLSP7CustomizableTokenInit.s.sol:DeployLSP7CustomizableTokenInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast
LSP7MintableInit
FOUNDRY_PROFILE=lsp7 forge script packages/lsp7-contracts/scripts/DeployLSP7MintableInit.s.sol:DeployLSP7MintableInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast

Broadcast and verify on the LUKSO Testnet Blockscout explorer:

LSP7CustomizableTokenInit
FOUNDRY_PROFILE=lsp7 forge script packages/lsp7-contracts/scripts/DeployLSP7CustomizableTokenInit.s.sol:DeployLSP7CustomizableTokenInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast --verify --verifier blockscout --verifier-url https://explorer.execution.testnet.lukso.network/api/
LSP7MintableInit
FOUNDRY_PROFILE=lsp7 forge script packages/lsp7-contracts/scripts/DeployLSP7MintableInit.s.sol:DeployLSP7MintableInitScript --rpc-url https://rpc.testnet.lukso.network --broadcast --verify --verifier blockscout --verifier-url https://explorer.execution.testnet.lukso.network/api/

Audits

The LSP7 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