diff --git a/docs/learn/smart-contract-developers/create-nft-collection-lsp7.md b/docs/learn/smart-contract-developers/create-nft-collection-lsp7.md index 365d52618c..a674d72a42 100644 --- a/docs/learn/smart-contract-developers/create-nft-collection-lsp7.md +++ b/docs/learn/smart-contract-developers/create-nft-collection-lsp7.md @@ -29,26 +29,13 @@ npm install @lukso/lsp-smart-contracts ## Create the Smart Contracts -When creating smart contracts representing digital assets on LUKSO, you will need to specify the token type and data keys for the 📄 [LSP4 Digital Asset Metadata](../../standards/tokens/LSP4-Digital-Asset-Metadata) that will be stored in the 🗂️ [ERC725Y](../../standards/lsp-background/erc725.md#erc725y-generic-data-keyvalue-store) storage of the Digital Asset. There are three different token types: +When creating smart contracts representing digital assets on LUKSO, you will need to specify the token type and data keys for the 📄 [LSP4 Digital Asset Metadata](../../standards/tokens/LSP4-Digital-Asset-Metadata) that will be stored in the 🗂️ [ERC725Y](../../standards/lsp-background/erc725.md#erc725y-generic-data-keyvalue-store) storage of the Digital Asset. There are three different [token types](../../standards/tokens/LSP4-Digital-Asset-Metadata.md#lsp4tokentype): - `0` = Token - `1` = NFT - `2` = Collection -```solidity title="contracts/TokenTypes.sol" -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -bytes32 constant _LSP4_TOKEN_TYPE_DATA_KEY = 0xe0261fa95db2eb3b5439bd033cda66d56b96f92f243a8228fd87550ed7bdfdb3; // kecca256 hash of the word `LSP4TokenType` - -enum TokenType { - TOKEN, - NFT, - COLLECTION -} -``` - -After defining the type of the asset you can create a custom 🌄 [LSP7 Digital Asset Collection](../../standards/tokens/LSP7-Digital-Asset.md) that extends [LSP7Mintable](../../contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md) so that new assets can be created within the smart contract. +For this example we will use the `Token` token type. You can create a custom 🌄 [LSP7 Digital Asset Token](../../standards/tokens/LSP7-Digital-Asset.md) that extends [LSP7Mintable](../../contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md) so that new assets can be minted by the [`owner`](../../contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md#owner) of the smart contract. ```solidity title="contracts/Example1/EventTicketsNFT.sol" // SPDX-License-Identifier: MIT @@ -58,8 +45,9 @@ pragma solidity ^0.8.4; import { LSP7Mintable } from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol"; - -import {_LSP4_TOKEN_TYPE_DATA_KEY, TokenType} from "../TokenTypes.sol"; +import { + _LSP4_TOKEN_TYPE_TOKEN +} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol"; contract EventTicketsNFT is LSP7Mintable { constructor( @@ -71,12 +59,10 @@ contract EventTicketsNFT is LSP7Mintable { eventName, tokenSymbol, contractOwner, + _LSP4_TOKEN_TYPE_TOKEN, // set the token type as Token true // make the token non divisible ) - { - // set the token type - _setData(_LSP4_TOKEN_TYPE_DATA_KEY, abi.encode(TokenType.TOKEN)); - } + {} } ```