From d66a82629f143e41c000166d22c266c2dea4dc5e Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 13:32:06 +0000 Subject: [PATCH 01/12] refactor!: set `LSP4TokenType` on deployment of digital asset --- constants.ts | 18 ++++++++++++++++- .../LSP4Constants.sol | 3 +++ .../LSP4DigitalAssetMetadata.sol | 20 +++++++++++++------ .../LSP4DigitalAssetMetadataInitAbstract.sol | 14 ++++++++++--- .../LSP4DigitalAssetMetadata/LSP4Errors.sol | 19 ++++++++++++------ .../LSP7DigitalAsset/LSP7DigitalAsset.sol | 5 +++-- .../LSP7DigitalAssetInitAbstract.sol | 7 +++++-- .../extensions/LSP7CompatibleERC20.sol | 6 ++++-- .../LSP7CompatibleERC20InitAbstract.sol | 13 +++++++----- .../presets/LSP7CompatibleERC20Mintable.sol | 6 ++++-- .../LSP7CompatibleERC20MintableInit.sol | 7 +++++-- ...SP7CompatibleERC20MintableInitAbstract.sol | 10 ++++++++-- .../LSP7DigitalAsset/presets/LSP7Mintable.sol | 14 +++++++++++-- .../presets/LSP7MintableInit.sol | 7 +++++-- .../presets/LSP7MintableInitAbstract.sol | 7 +++++-- .../LSP8IdentifiableDigitalAsset.sol | 6 ++++-- ...P8IdentifiableDigitalAssetInitAbstract.sol | 7 +++++-- .../extensions/LSP8CompatibleERC721.sol | 14 +++++++++++-- .../LSP8CompatibleERC721InitAbstract.sol | 7 +++++-- .../presets/LSP8CompatibleERC721Mintable.sol | 14 +++++++++++-- .../LSP8CompatibleERC721MintableInit.sol | 7 +++++-- ...P8CompatibleERC721MintableInitAbstract.sol | 6 ++++-- .../presets/LSP8Mintable.sol | 14 +++++++++++-- .../presets/LSP8MintableInit.sol | 7 +++++-- .../presets/LSP8MintableInitAbstract.sol | 6 ++++-- 25 files changed, 185 insertions(+), 59 deletions(-) diff --git a/constants.ts b/constants.ts index d24a27ab0..5141f3844 100644 --- a/constants.ts +++ b/constants.ts @@ -192,6 +192,9 @@ export const ERC725YDataKeys = { // keccak256('LSP4TokenSymbol') LSP4TokenSymbol: '0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756', + // kecca256('LSP4TokenType) + LSP4TokenType: '0xe0261fa95db2eb3b5439bd033cda66d56b96f92f243a8228fd87550ed7bdfdb3', + // keccak256('LSP4Metadata') LSP4Metadata: '0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e', @@ -390,11 +393,24 @@ export const LSP1_TYPE_IDS = { '0xe32c7debcb817925ba4883fdbfc52797187f28f73f860641dab1a68d9b32902c', }; +// LSP4 +// ---------- + +/** + * @dev list of LSP4 Token types to describe the type of token a digital asset contract represents. + * @see for details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md#lsp4tokentype + */ +export const LSP4_TOKEN_TYPES = { + TOKEN: 0, + NFT: 1, + COLLECTION: 2, +}; + // LSP8 // ---------- /** - * @dev list of LSP8 Token ID types that can be used to create different types of NFTs. + * @dev list of LSP8 Token ID types that can be used to create different types of NFTs and represent each NFT identifiers differently. * @see for details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtype */ export const LSP8_TOKEN_ID_TYPES = { diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol b/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol index 09547e37a..ce82f1eb2 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol @@ -15,6 +15,9 @@ bytes32 constant _LSP4_TOKEN_NAME_KEY = 0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac // keccak256('LSP4TokenSymbol') bytes32 constant _LSP4_TOKEN_SYMBOL_KEY = 0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756; +// keccak256('LSP4TokenType') +bytes32 constant _LSP4_TOKEN_TYPE_KEY = 0xe0261fa95db2eb3b5439bd033cda66d56b96f92f243a8228fd87550ed7bdfdb3; + // keccak256('LSP4Creators[]') bytes32 constant _LSP4_CREATORS_ARRAY_KEY = 0x114bd03b3a46d48759680d81ebb2b414fda7d030a7105a851867accf1c2352e7; diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol index a57731572..ebbcd92f2 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol @@ -12,13 +12,15 @@ import { _LSP4_SUPPORTED_STANDARDS_KEY, _LSP4_SUPPORTED_STANDARDS_VALUE, _LSP4_TOKEN_NAME_KEY, - _LSP4_TOKEN_SYMBOL_KEY + _LSP4_TOKEN_SYMBOL_KEY, + _LSP4_TOKEN_TYPE_KEY } from "./LSP4Constants.sol"; // errors import { LSP4TokenNameNotEditable, - LSP4TokenSymbolNotEditable + LSP4TokenSymbolNotEditable, + LSP4TokenTypeNotEditable } from "./LSP4Errors.sol"; /** @@ -30,14 +32,16 @@ abstract contract LSP4DigitalAssetMetadata is ERC725Y { /** * @notice Deploying a digital asset `name_` with the `symbol_` symbol. * - * @param name_ The name of the token - * @param symbol_ The symbol of the token - * @param initialOwner_ The owner of the token contract + * @param name_ The name of the token. + * @param symbol_ The symbol of the token. + * @param initialOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, - address initialOwner_ + address initialOwner_, + uint256 lsp4TokenType_ ) ERC725Y(initialOwner_) { // set data key SupportedStandards:LSP4DigitalAsset super._setData( @@ -47,6 +51,7 @@ abstract contract LSP4DigitalAssetMetadata is ERC725Y { super._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_)); super._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_)); + super._setData(_LSP4_TOKEN_TYPE_KEY, abi.encode(lsp4TokenType_)); } /** @@ -63,8 +68,11 @@ abstract contract LSP4DigitalAssetMetadata is ERC725Y { revert LSP4TokenNameNotEditable(); } else if (dataKey == _LSP4_TOKEN_SYMBOL_KEY) { revert LSP4TokenSymbolNotEditable(); + } else if (dataKey == _LSP4_TOKEN_TYPE_KEY) { + revert LSP4TokenTypeNotEditable(); } else { _store[dataKey] = dataValue; + emit DataChanged( dataKey, dataValue.length <= 256 diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol index 56603d4ff..503ab902c 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol @@ -14,13 +14,15 @@ import { _LSP4_SUPPORTED_STANDARDS_KEY, _LSP4_SUPPORTED_STANDARDS_VALUE, _LSP4_TOKEN_NAME_KEY, - _LSP4_TOKEN_SYMBOL_KEY + _LSP4_TOKEN_SYMBOL_KEY, + _LSP4_TOKEN_TYPE_KEY } from "./LSP4Constants.sol"; // errors import { LSP4TokenNameNotEditable, - LSP4TokenSymbolNotEditable + LSP4TokenSymbolNotEditable, + LSP4TokenTypeNotEditable } from "./LSP4Errors.sol"; /** @@ -35,11 +37,13 @@ abstract contract LSP4DigitalAssetMetadataInitAbstract is ERC725YInitAbstract { * @param name_ The name of the token * @param symbol_ The symbol of the token * @param initialOwner_ The owner of the token contract + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection) */ function _initialize( string memory name_, string memory symbol_, - address initialOwner_ + address initialOwner_, + uint256 lsp4TokenType_ ) internal virtual onlyInitializing { ERC725YInitAbstract._initialize(initialOwner_); @@ -51,6 +55,7 @@ abstract contract LSP4DigitalAssetMetadataInitAbstract is ERC725YInitAbstract { super._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_)); super._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_)); + super._setData(_LSP4_TOKEN_TYPE_KEY, abi.encode(lsp4TokenType_)); } /** @@ -67,8 +72,11 @@ abstract contract LSP4DigitalAssetMetadataInitAbstract is ERC725YInitAbstract { revert LSP4TokenNameNotEditable(); } else if (dataKey == _LSP4_TOKEN_SYMBOL_KEY) { revert LSP4TokenSymbolNotEditable(); + } else if (dataKey == _LSP4_TOKEN_TYPE_KEY) { + revert LSP4TokenTypeNotEditable(); } else { _store[dataKey] = dataValue; + emit DataChanged( dataKey, dataValue.length <= 256 diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol b/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol index 44e28f370..9ecaa3e93 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol @@ -2,15 +2,22 @@ pragma solidity ^0.8.4; /** - * @dev Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. - * The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. - * It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. + * @dev Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. + * The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. + * It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. */ error LSP4TokenNameNotEditable(); /** - * @dev Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. - * The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. - * It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. + * @dev Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. + * The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. + * It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. */ error LSP4TokenSymbolNotEditable(); + +/** + * @dev Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. + * The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. + * It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized. + */ +error LSP4TokenTypeNotEditable(); diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol b/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol index 42638fa88..aee29ba31 100644 --- a/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +++ b/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol @@ -56,8 +56,9 @@ abstract contract LSP7DigitalAsset is string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_ - ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_) { + bool isNonDivisible_, + uint256 lsp4TokenType_ + ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_, lsp4TokenType_) { _isNonDivisible = isNonDivisible_; } diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol b/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol index 29bbc55c6..19e4bcdd8 100644 --- a/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +++ b/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol @@ -46,13 +46,16 @@ abstract contract LSP7DigitalAssetInitAbstract is string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_ + bool isNonDivisible_, + uint256 lsp4TokenType_ ) internal virtual onlyInitializing { _isNonDivisible = isNonDivisible_; + LSP4DigitalAssetMetadataInitAbstract._initialize( name_, symbol_, - newOwner_ + newOwner_, + lsp4TokenType_ ); } diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol index b8326007b..9f15ac366 100644 --- a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +++ b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol @@ -27,12 +27,14 @@ abstract contract LSP7CompatibleERC20 is IERC20Metadata, LSP7DigitalAsset { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, - address newOwner_ - ) LSP7DigitalAsset(name_, symbol_, newOwner_, false) {} + address newOwner_, + uint256 lsp4TokenType_ + ) LSP7DigitalAsset(name_, symbol_, newOwner_, false, lsp4TokenType_) {} /** * @inheritdoc IERC20Metadata diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol index 8f0d9dec0..11321124d 100644 --- a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +++ b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol @@ -30,20 +30,23 @@ abstract contract LSP7CompatibleERC20InitAbstract is * @notice Initializing a `LSP7CompatibleERC20` token contract with: token name = `name_`, token symbol = `symbol_`, and * address `newOwner_` as the token contract owner. * - * @param name_ The name of the token - * @param symbol_ The symbol of the token - * @param newOwner_ The owner of the token + * @param name_ The name of the token. + * @param symbol_ The symbol of the token. + * @param newOwner_ The owner of the token. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function _initialize( string memory name_, string memory symbol_, - address newOwner_ + address newOwner_, + uint256 lsp4TokenType_ ) internal virtual override onlyInitializing { LSP7DigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - false + false, + lsp4TokenType_ ); } diff --git a/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol b/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol index c3833e16e..6fa892b16 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol @@ -14,12 +14,14 @@ contract LSP7CompatibleERC20Mintable is LSP7CompatibleERC20 { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, - address newOwner_ - ) LSP7CompatibleERC20(name_, symbol_, newOwner_) {} + address newOwner_, + uint256 lsp4TokenType_ + ) LSP7CompatibleERC20(name_, symbol_, newOwner_, lsp4TokenType_) {} /** * @dev Public {_mint} function only callable by the {owner}. diff --git a/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol b/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol index 83ace62b5..8a649e765 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol @@ -26,16 +26,19 @@ contract LSP7CompatibleERC20MintableInit is * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function initialize( string memory name_, string memory symbol_, - address newOwner_ + address newOwner_, + uint256 lsp4TokenType_ ) external virtual initializer { LSP7CompatibleERC20MintableInitAbstract._initialize( name_, symbol_, - newOwner_ + newOwner_, + lsp4TokenType_ ); } } diff --git a/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol b/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol index 9b831d11a..ca390db9a 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol @@ -18,9 +18,15 @@ abstract contract LSP7CompatibleERC20MintableInitAbstract is function _initialize( string memory name_, string memory symbol_, - address newOwner_ + address newOwner_, + uint256 lsp4TokenType_ ) internal virtual override onlyInitializing { - LSP7CompatibleERC20InitAbstract._initialize(name_, symbol_, newOwner_); + LSP7CompatibleERC20InitAbstract._initialize( + name_, + symbol_, + newOwner_, + lsp4TokenType_ + ); } /** diff --git a/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol b/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol index 5091862cf..ace26d5f7 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol @@ -20,13 +20,23 @@ contract LSP7Mintable is LSP7DigitalAsset, ILSP7Mintable { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_ - ) LSP7DigitalAsset(name_, symbol_, newOwner_, isNonDivisible_) {} + bool isNonDivisible_, + uint256 lsp4TokenType_ + ) + LSP7DigitalAsset( + name_, + symbol_, + newOwner_, + isNonDivisible_, + lsp4TokenType_ + ) + {} /** * @dev Public {_mint} function only callable by the {owner}. diff --git a/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol b/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol index d3e395f26..753082337 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol @@ -23,18 +23,21 @@ contract LSP7MintableInit is LSP7MintableInitAbstract { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function initialize( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_ + bool isNonDivisible_, + uint256 lsp4TokenType_ ) external virtual initializer { LSP7MintableInitAbstract._initialize( name_, symbol_, newOwner_, - isNonDivisible_ + isNonDivisible_, + lsp4TokenType_ ); } } diff --git a/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol b/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol index a32716124..7e2fe43f5 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol @@ -24,18 +24,21 @@ abstract contract LSP7MintableInitAbstract is * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function _initialize( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_ + bool isNonDivisible_, + uint256 lsp4TokenType_ ) internal virtual override onlyInitializing { LSP7DigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - isNonDivisible_ + isNonDivisible_, + lsp4TokenType_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol index 4bb42aa7c..911441eb2 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol @@ -67,6 +67,7 @@ abstract contract LSP8IdentifiableDigitalAsset is * @param newOwner_ The owner of the the token-Metadata * @param tokenIdType_ The type of tokenIds (= NFTs) that this contract will create. * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). * * @custom:warning Make sure the tokenId type provided on deployment is correct, as it can only be set once * and cannot be changed in the ERC725Y storage after the contract has been deployed. @@ -75,8 +76,9 @@ abstract contract LSP8IdentifiableDigitalAsset is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ - ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_) { + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_, lsp4TokenType_) { LSP4DigitalAssetMetadata._setData( _LSP8_TOKENID_TYPE_KEY, abi.encode(tokenIdType_) diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol index e1d6ad0f8..caadbd6c8 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol @@ -64,6 +64,7 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is * @param newOwner_ The owner of the the token-Metadata * @param tokenIdType_ The type of tokenIds (= NFTs) that this contract will create. * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). * * @custom:warning Make sure the tokenId type provided on deployment is correct, as it can only be set once * and cannot be changed in the ERC725Y storage after the contract has been initialized. @@ -72,12 +73,14 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) internal virtual onlyInitializing { LSP4DigitalAssetMetadataInitAbstract._initialize( name_, symbol_, - newOwner_ + newOwner_, + lsp4TokenType_ ); LSP4DigitalAssetMetadataInitAbstract._setData( diff --git a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol index 5bb539fb7..e3fe0d906 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol @@ -64,13 +64,23 @@ abstract contract LSP8CompatibleERC721 is * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ - ) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, tokenIdType_) {} + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) + LSP8IdentifiableDigitalAsset( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + {} /** * @inheritdoc IERC721Metadata diff --git a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol index 1f57d45f2..6c5e5c3bb 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol @@ -64,19 +64,22 @@ abstract contract LSP8CompatibleERC721InitAbstract is * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function _initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) internal virtual override onlyInitializing { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol index cec967433..3d9423b4e 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol @@ -14,13 +14,23 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ - ) LSP8CompatibleERC721(name_, symbol_, newOwner_, tokenIdType_) {} + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) + LSP8CompatibleERC721( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + {} /** * @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`). diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol index 7558bc368..b94628cce 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol @@ -26,18 +26,21 @@ contract LSP8CompatibleERC721MintableInit is * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) external virtual initializer { LSP8CompatibleERC721MintableInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); } } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol index 58e7d31aa..92d1c3591 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol @@ -19,13 +19,15 @@ contract LSP8CompatibleERC721MintableInitAbstract is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) internal virtual override onlyInitializing { LSP8CompatibleERC721InitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol index 66bc01675..71016bd81 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol @@ -21,13 +21,23 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ constructor( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ - ) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, tokenIdType_) {} + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) + LSP8IdentifiableDigitalAsset( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + {} /** * @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`). diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol index 72532187e..ab2c12fb3 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol @@ -23,18 +23,21 @@ contract LSP8MintableInit is LSP8MintableInitAbstract { * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). */ function initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) external virtual initializer { LSP8MintableInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); } } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol index b59f023ab..eefcf50a4 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol @@ -28,13 +28,15 @@ abstract contract LSP8MintableInitAbstract is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) internal virtual override onlyInitializing { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); } From 61fed43e16f7625c42d4c288479059f504eb9506 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 13:54:35 +0000 Subject: [PATCH 02/12] test: add tests for LSP4 for `LSP4TokenType` data key not editable --- .../LSP4DigitalAssetMetadata.behaviour.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts b/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts index dd552e53b..d6de9e019 100644 --- a/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts +++ b/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts @@ -7,11 +7,12 @@ import { LSP7DigitalAsset, LSP8IdentifiableDigitalAsset, LSP9Vault } from '../.. // constants import { ERC725YDataKeys } from '../../constants'; +import { abiCoder } from '../utils/helpers'; export type LS4DigitalAssetMetadataTestContext = { accounts: SignerWithAddress[]; contract: LSP7DigitalAsset | LSP8IdentifiableDigitalAsset | LSP9Vault; - deployParams: { owner: SignerWithAddress }; + deployParams: { owner: SignerWithAddress; lsp4TokenType: number }; }; export const shouldBehaveLikeLSP4DigitalAssetMetadata = ( @@ -68,6 +69,15 @@ export const shouldBehaveLikeLSP4DigitalAssetMetadata = ( ).to.be.revertedWithCustomError(context.contract, 'LSP4TokenSymbolNotEditable'); }); + it('should revert when trying to edit Token Type', async () => { + const key = ERC725YDataKeys.LSP4['LSP4TokenType']; + const value = abiCoder.encode(['uint256'], [12345]); + + expect( + context.contract.connect(context.deployParams.owner).setData(key, value), + ).to.be.revertedWithCustomError(context.contract, 'LSP4TokenTypeNotEditable'); + }); + describe('when setting a data key with a value less than 256 bytes', () => { it('should emit DataChanged event with the whole data value', async () => { const key = ethers.utils.keccak256(ethers.utils.toUtf8Bytes('My Key')); From 1170a330bf06b85c13138d2b8f1d5b2226e52f4f Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 13:56:11 +0000 Subject: [PATCH 03/12] test: update LSP7 test suite with extra deployment param --- .../Tokens/LSP7CappedSupplyInitTester.sol | 19 +++++++++++++------ .../Mocks/Tokens/LSP7CappedSupplyTester.sol | 13 +++++++------ .../Tokens/LSP7CompatibleERC20InitTester.sol | 10 ++++++++-- .../Tokens/LSP7CompatibleERC20Tester.sol | 5 +++-- contracts/Mocks/Tokens/LSP7InitTester.sol | 6 ++++-- .../Mocks/Tokens/LSP7MintWhenDeployed.sol | 11 ++++++----- contracts/Mocks/Tokens/LSP7Tester.sol | 9 +++++---- .../LSP7CappedSupply.behaviour.ts | 1 + .../LSP7CompatibleERC20.behaviour.ts | 1 + .../LSP7DigitalAsset.behaviour.ts | 8 ++++++++ .../LSP7Mintable.behaviour.ts | 1 + .../proxy/LSP7CappedSupplyInit.test.ts | 5 ++++- .../proxy/LSP7CompatibleERC20Init.test.ts | 11 ++++++++--- .../proxy/LSP7DigitalAssetInit.test.ts | 12 +++++++++--- .../proxy/LSP7MintableInit.test.ts | 10 +++++++--- .../standard/LSP7CappedSupply.test.ts | 4 ++++ .../standard/LSP7CompatibleERC20.test.ts | 2 ++ .../standard/LSP7DigitalAsset.test.ts | 14 +++++++++++++- .../standard/LSP7Mintable.test.ts | 3 +++ 19 files changed, 107 insertions(+), 38 deletions(-) diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol b/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol index 286d08d22..10448ca6d 100644 --- a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol +++ b/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol @@ -12,13 +12,20 @@ import { contract LSP7CappedSupplyInitTester is LSP7CappedSupplyInitAbstract { function initialize( - string memory name, - string memory symbol, - address newOwner, - uint256 tokenSupplyCap + string memory name_, + string memory symbol_, + address newOwner_, + uint256 tokenSupplyCap_, + uint256 lsp4TokenType_ ) public virtual initializer { - LSP7DigitalAssetInitAbstract._initialize(name, symbol, newOwner, true); - LSP7CappedSupplyInitAbstract._initialize(tokenSupplyCap); + LSP7DigitalAssetInitAbstract._initialize( + name_, + symbol_, + newOwner_, + true, + lsp4TokenType_ + ); + LSP7CappedSupplyInitAbstract._initialize(tokenSupplyCap_); } function mint(address to, uint256 amount) public { diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol b/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol index 252d985ce..ab445935b 100644 --- a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol +++ b/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol @@ -10,13 +10,14 @@ import { contract LSP7CappedSupplyTester is LSP7CappedSupply { constructor( - string memory name, - string memory symbol, - address newOwner, - uint256 tokenSupplyCap + string memory name_, + string memory symbol_, + address newOwner_, + uint256 tokenSupplyCap_, + uint256 lsp4TokenType_ ) - LSP7DigitalAsset(name, symbol, newOwner, true) - LSP7CappedSupply(tokenSupplyCap) + LSP7DigitalAsset(name_, symbol_, newOwner_, true, lsp4TokenType_) + LSP7CappedSupply(tokenSupplyCap_) {} function mint(address to, uint256 amount) public { diff --git a/contracts/Mocks/Tokens/LSP7CompatibleERC20InitTester.sol b/contracts/Mocks/Tokens/LSP7CompatibleERC20InitTester.sol index 996b173a9..bf5b86e7e 100644 --- a/contracts/Mocks/Tokens/LSP7CompatibleERC20InitTester.sol +++ b/contracts/Mocks/Tokens/LSP7CompatibleERC20InitTester.sol @@ -18,9 +18,15 @@ contract LSP7CompatibleERC20InitTester is LSP7CompatibleERC20InitAbstract { function initialize( string memory name_, string memory symbol_, - address newOwner_ + address newOwner_, + uint256 lsp4TokenType_ ) public initializer { - LSP7CompatibleERC20InitAbstract._initialize(name_, symbol_, newOwner_); + LSP7CompatibleERC20InitAbstract._initialize( + name_, + symbol_, + newOwner_, + lsp4TokenType_ + ); } function mint(address to, uint256 amount, bytes calldata data) public { diff --git a/contracts/Mocks/Tokens/LSP7CompatibleERC20Tester.sol b/contracts/Mocks/Tokens/LSP7CompatibleERC20Tester.sol index 21b1e4891..7a2bd280b 100644 --- a/contracts/Mocks/Tokens/LSP7CompatibleERC20Tester.sol +++ b/contracts/Mocks/Tokens/LSP7CompatibleERC20Tester.sol @@ -11,8 +11,9 @@ contract LSP7CompatibleERC20Tester is LSP7CompatibleERC20 { constructor( string memory name_, string memory symbol_, - address newOwner_ - ) LSP7CompatibleERC20(name_, symbol_, newOwner_) {} + address newOwner_, + uint256 lsp4TokenType_ + ) LSP7CompatibleERC20(name_, symbol_, newOwner_, lsp4TokenType_) {} function mint(address to, uint256 amount, bytes calldata data) public { // using force=true so we can send to EOA in test diff --git a/contracts/Mocks/Tokens/LSP7InitTester.sol b/contracts/Mocks/Tokens/LSP7InitTester.sol index 5759191f6..4877eb159 100644 --- a/contracts/Mocks/Tokens/LSP7InitTester.sol +++ b/contracts/Mocks/Tokens/LSP7InitTester.sol @@ -18,13 +18,15 @@ contract LSP7InitTester is string memory tokenName_, string memory tokenSymbol_, address newOwner_, - bool isNonDivisible_ + bool isNonDivisible_, + uint256 lsp4TokenType_ ) public initializer { LSP7DigitalAssetInitAbstract._initialize( tokenName_, tokenSymbol_, newOwner_, - isNonDivisible_ + isNonDivisible_, + lsp4TokenType_ ); } diff --git a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol b/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol index 7c4e15a5f..fd25565a9 100644 --- a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol +++ b/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol @@ -5,10 +5,11 @@ import {LSP7DigitalAsset} from "../../LSP7DigitalAsset/LSP7DigitalAsset.sol"; contract LSP7MintWhenDeployed is LSP7DigitalAsset { constructor( - string memory name, - string memory symbol, - address newOwner - ) LSP7DigitalAsset(name, symbol, newOwner, false) { - _mint(newOwner, 1_000, true, ""); + string memory name_, + string memory symbol_, + address newOwner_, + uint256 lsp4TokenType_ + ) LSP7DigitalAsset(name_, symbol_, newOwner_, false, lsp4TokenType_) { + _mint(newOwner_, 1_000, true, ""); } } diff --git a/contracts/Mocks/Tokens/LSP7Tester.sol b/contracts/Mocks/Tokens/LSP7Tester.sol index ca0744ec8..0dfa40742 100644 --- a/contracts/Mocks/Tokens/LSP7Tester.sol +++ b/contracts/Mocks/Tokens/LSP7Tester.sol @@ -7,10 +7,11 @@ import {LSP7Burnable} from "../../LSP7DigitalAsset/extensions/LSP7Burnable.sol"; contract LSP7Tester is LSP7DigitalAsset, LSP7Burnable { constructor( - string memory name, - string memory symbol, - address newOwner - ) LSP7DigitalAsset(name, symbol, newOwner, false) {} + string memory name_, + string memory symbol_, + address newOwner_, + uint256 lsp4TokenType_ + ) LSP7DigitalAsset(name_, symbol_, newOwner_, false, lsp4TokenType_) {} function mint( address to, diff --git a/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts b/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts index 25687e214..e36a7a9d0 100644 --- a/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts @@ -23,6 +23,7 @@ export type LSP7CappedSupplyTestContext = { symbol: string; newOwner: string; tokenSupplyCap: BigNumber; + lsp4TokenType: number; }; }; diff --git a/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts b/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts index 6d5783c0c..56fe715f5 100644 --- a/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts @@ -36,6 +36,7 @@ export type LSP7CompatibleERC20DeployParams = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; }; export type LSP7CompatibleERC20TestContext = { diff --git a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts b/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts index 7b6efc916..6976b5c5a 100644 --- a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts @@ -56,6 +56,7 @@ export type LSP7DeployParams = { name: string; symbol: string; newOwner: string; + lsp4TokenType?: number; }; export type LSP7TestContext = { @@ -2254,6 +2255,13 @@ export const shouldInitializeLikeLSP7 = ( .to.emit(context.lsp7, 'DataChanged') .withArgs(symbolKey, expectedSymbolValue); expect(await context.lsp7.getData(symbolKey)).to.equal(expectedSymbolValue); + + const tokenTypeKey = ERC725YDataKeys.LSP4['LSP4TokenType']; + const expectedTokenTypeValue = abiCoder.encode( + ['uint256'], + [context.deployParams.lsp4TokenType], + ); + expect(await context.lsp7.getData(tokenTypeKey)).to.equal(expectedTokenTypeValue); }); }); }; diff --git a/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts b/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts index c1e94a27e..3ff145a02 100644 --- a/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts @@ -29,6 +29,7 @@ export type LSP7MintableDeployParams = { symbol: string; newOwner: string; isNFT: boolean; + lsp4TokenType: number; }; export type LSP7MintableTestContext = { diff --git a/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts index 317b3c537..8c7533931 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts @@ -11,6 +11,7 @@ import { } from '../LSP7CappedSupply.behaviour'; import { deployProxy } from '../../utils/fixtures'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7CappedSupplyInit with proxy', () => { const buildTestContext = async () => { @@ -20,6 +21,7 @@ describe('LSP7CappedSupplyInit with proxy', () => { symbol: 'CAP', newOwner: accounts.owner.address, tokenSupplyCap: ethers.BigNumber.from('2'), + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7CappedSupplyInit = await new LSP7CappedSupplyInitTester__factory( accounts.owner, @@ -31,11 +33,12 @@ describe('LSP7CappedSupplyInit with proxy', () => { }; const initializeProxy = async (context: LSP7CappedSupplyTestContext) => { - return context.lsp7CappedSupply['initialize(string,string,address,uint256)']( + return context.lsp7CappedSupply['initialize(string,string,address,uint256,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenSupplyCap, + context.deployParams.lsp4TokenType, ); }; diff --git a/tests/LSP7DigitalAsset/proxy/LSP7CompatibleERC20Init.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7CompatibleERC20Init.test.ts index 9c05ba3d9..c98a47f2c 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7CompatibleERC20Init.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7CompatibleERC20Init.test.ts @@ -14,6 +14,7 @@ import { } from '../LSP7CompatibleERC20.behaviour'; import { deployProxy } from '../../utils/fixtures'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7CompatibleERC20Init with proxy', () => { const buildTestContext = async (): Promise => { @@ -23,6 +24,7 @@ describe('LSP7CompatibleERC20Init with proxy', () => { name: 'LSP7 - deployed with constructor', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7CompatibilityForERC20TesterInit = await new LSP7CompatibleERC20InitTester__factory( @@ -45,10 +47,11 @@ describe('LSP7CompatibleERC20Init with proxy', () => { }; const initializeProxy = async (context: LSP7CompatibleERC20TestContext) => { - return context.lsp7CompatibleERC20['initialize(string,string,address)']( + return context.lsp7CompatibleERC20['initialize(string,string,address,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, + context.deployParams.lsp4TokenType, ); }; @@ -63,10 +66,11 @@ describe('LSP7CompatibleERC20Init with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp7CompatibilityForERC20TesterInit['initialize(string,string,address)']( + lsp7CompatibilityForERC20TesterInit['initialize(string,string,address,uint256)']( 'XXXXXXXXXXX', 'XXX', randomCaller.address, + 12345, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); @@ -81,10 +85,11 @@ describe('LSP7CompatibleERC20Init with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp7CompatibleERC20MintableInit['initialize(string,string,address)']( + lsp7CompatibleERC20MintableInit['initialize(string,string,address,uint256)']( 'XXXXXXXXXXX', 'XXX', randomCaller.address, + 12345, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); diff --git a/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts index fc3c599d4..3a87705f1 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts @@ -16,6 +16,7 @@ import { } from '../../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour'; import { deployProxy } from '../../utils/fixtures'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7DigitalAssetInit with proxy', () => { const buildTestContext = async (): Promise => { @@ -25,6 +26,7 @@ describe('LSP7DigitalAssetInit with proxy', () => { name: 'LSP7 - deployed with proxy', symbol: 'TKN', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7TesterInit = await new LSP7InitTester__factory(accounts.owner).deploy(); @@ -46,6 +48,7 @@ describe('LSP7DigitalAssetInit with proxy', () => { const deployParams = { owner: accounts[0], + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; return { @@ -56,11 +59,12 @@ describe('LSP7DigitalAssetInit with proxy', () => { }; const initializeProxy = async (context: LSP7TestContext) => { - return context.lsp7['initialize(string,string,address,bool)']( + return context.lsp7['initialize(string,string,address,bool,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, false, + context.deployParams.lsp4TokenType, ); }; @@ -73,11 +77,12 @@ describe('LSP7DigitalAssetInit with proxy', () => { it('should revert when initializing with address(0) as owner', async () => { await expect( - context.lsp7['initialize(string,string,address,bool)']( + context.lsp7['initialize(string,string,address,bool,uint256)']( context.deployParams.name, context.deployParams.symbol, ethers.constants.AddressZero, false, + 12345, ), ).to.be.revertedWithCustomError(context.lsp7, 'OwnableCannotSetZeroAddressAsOwner'); }); @@ -108,11 +113,12 @@ describe('LSP7DigitalAssetInit with proxy', () => { shouldBehaveLikeLSP4DigitalAssetMetadata(async () => { const lsp4Context = await buildLSP4DigitalAssetMetadataTestContext(); - await lsp4Context.contract['initialize(string,string,address,bool)']( + await lsp4Context.contract['initialize(string,string,address,bool,uint256)']( 'LSP7 - deployed with proxy', 'TKN', lsp4Context.deployParams.owner.address, false, + lsp4Context.deployParams.lsp4TokenType, ); return lsp4Context; diff --git a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts index 3593d07e7..8133684d0 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts @@ -11,7 +11,7 @@ import { } from '../LSP7Mintable.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { ERC725YDataKeys } from '../../../constants'; +import { ERC725YDataKeys, LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7MintableInit with proxy', () => { const buildTestContext = async () => { @@ -22,6 +22,7 @@ describe('LSP7MintableInit with proxy', () => { symbol: 'LSP7 MNTBL', newOwner: accounts.owner.address, isNFT: false, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const LSP7MintableInit: LSP7MintableInit = await new LSP7MintableInit__factory( @@ -35,11 +36,12 @@ describe('LSP7MintableInit with proxy', () => { }; const initializeProxy = async (context: LSP7MintableTestContext) => { - return context.lsp7Mintable['initialize(string,string,address,bool)']( + return context.lsp7Mintable['initialize(string,string,address,bool,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.isNFT, + context.deployParams.lsp4TokenType, ); }; @@ -52,6 +54,7 @@ describe('LSP7MintableInit with proxy', () => { expect(await lsp7MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenName)).to.equal('0x'); expect(await lsp7MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenSymbol)).to.equal('0x'); expect(await lsp7MintableInit.getData(ERC725YDataKeys.LSP4.LSP4Metadata)).to.equal('0x'); + expect(await lsp7MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenType)).to.equal('0x'); expect(await lsp7MintableInit.owner()).to.equal(ethers.constants.AddressZero); }); @@ -64,11 +67,12 @@ describe('LSP7MintableInit with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp7MintableInit['initialize(string,string,address,bool)']( + lsp7MintableInit['initialize(string,string,address,bool,uint256)']( 'XXXXXXXXXXX', 'XXX', randomCaller.address, false, + 12345, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); diff --git a/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts b/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts index fe8491784..353c572bb 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts @@ -8,6 +8,7 @@ import { LSP7CappedSupplyTestContext, getNamedAccounts, } from '../LSP7CappedSupply.behaviour'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7CappedSupply with constructor', () => { const buildTestContext = async () => { @@ -17,12 +18,15 @@ describe('LSP7CappedSupply with constructor', () => { symbol: 'CAP', newOwner: accounts.owner.address, tokenSupplyCap: ethers.BigNumber.from('2'), + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; + const lsp7CappedSupply = await new LSP7CappedSupplyTester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, deployParams.tokenSupplyCap, + deployParams.lsp4TokenType, ); return { accounts, lsp7CappedSupply, deployParams }; diff --git a/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts b/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts index 1e033ce1d..c49853f0b 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts @@ -8,6 +8,7 @@ import { shouldInitializeLikeLSP7CompatibleERC20, shouldBehaveLikeLSP7CompatibleERC20, } from '../LSP7CompatibleERC20.behaviour'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7CompatibleERC20 with constructor', () => { const buildTestContext = async (): Promise => { @@ -23,6 +24,7 @@ describe('LSP7CompatibleERC20 with constructor', () => { deployParams.name, deployParams.symbol, deployParams.newOwner, + LSP4_TOKEN_TYPES.TOKEN, ); return { diff --git a/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts b/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts index 8447ea11b..443d0f39a 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts @@ -19,6 +19,7 @@ import { LS4DigitalAssetMetadataTestContext, shouldBehaveLikeLSP4DigitalAssetMetadata, } from '../../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP7DigitalAsset with constructor', () => { const buildTestContext = async (): Promise => { @@ -28,12 +29,14 @@ describe('LSP7DigitalAsset with constructor', () => { name: 'LSP7 - deployed with constructor', symbol: 'Token', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7 = await new LSP7Tester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, + deployParams.lsp4TokenType, ); // mint tokens for the owner @@ -49,6 +52,7 @@ describe('LSP7DigitalAsset with constructor', () => { const deployParams = { owner: accounts[0], + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; return { @@ -65,12 +69,14 @@ describe('LSP7DigitalAsset with constructor', () => { name: 'LSP8 - deployed with constructor', symbol: 'NFT', owner: accounts[0], + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const contract = await new LSP7Tester__factory(accounts[0]).deploy( deployParams.name, deployParams.symbol, deployParams.owner.address, + deployParams.lsp4TokenType, ); return { accounts, contract, deployParams }; @@ -84,12 +90,18 @@ describe('LSP7DigitalAsset with constructor', () => { name: 'LSP7 - deployed with constructor', symbol: 'Token', newOwner: ethers.constants.AddressZero, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const contractToDeploy = new LSP7Tester__factory(accounts[0]); await expect( - contractToDeploy.deploy(deployParams.name, deployParams.symbol, deployParams.newOwner), + contractToDeploy.deploy( + deployParams.name, + deployParams.symbol, + deployParams.newOwner, + deployParams.lsp4TokenType, + ), ).to.be.revertedWithCustomError(contractToDeploy, 'OwnableCannotSetZeroAddressAsOwner'); }); diff --git a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts b/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts index 86ff9ee6f..1dd2ccf62 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts @@ -1,3 +1,4 @@ +import { LSP4_TOKEN_TYPES } from '../../../constants'; import { LSP7Mintable, LSP7Mintable__factory } from '../../../types'; import { shouldInitializeLikeLSP7 } from '../LSP7DigitalAsset.behaviour'; @@ -17,6 +18,7 @@ describe('LSP7Mintable with constructor', () => { symbol: 'LSP7MNT', newOwner: accounts.owner.address, isNFT: false, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7Mintable: LSP7Mintable = await new LSP7Mintable__factory(accounts.owner).deploy( @@ -24,6 +26,7 @@ describe('LSP7Mintable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.isNFT, + deployParams.lsp4TokenType, ); return { accounts, lsp7Mintable, deployParams }; From ee6fc52718a9c556434b5f5b02772e4e5ca78585 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 14:47:55 +0000 Subject: [PATCH 04/12] test: update LSP8 test with extra deployment param --- .../Mocks/Tokens/LSP8BurnableInitTester.sol | 6 ++++-- contracts/Mocks/Tokens/LSP8BurnableTester.sol | 13 +++++++++++-- .../Tokens/LSP8CappedSupplyInitTester.sol | 6 ++++-- .../Mocks/Tokens/LSP8CappedSupplyTester.sol | 11 +++++++++-- .../Tokens/LSP8CompatibleERC721Tester.sol | 13 +++++++++++-- .../Tokens/LSP8CompatibleERC721TesterInit.sol | 6 ++++-- .../Mocks/Tokens/LSP8EnumerableInitTester.sol | 18 ++++++++++-------- .../Mocks/Tokens/LSP8EnumerableTester.sol | 19 ++++++++++++++----- contracts/Mocks/Tokens/LSP8InitTester.sol | 18 ++++++++++-------- contracts/Mocks/Tokens/LSP8Tester.sol | 19 ++++++++++++++----- .../LSP8CappedSupply.behaviour.ts | 1 + .../LSP8CompatibleERC721.behaviour.ts | 1 + .../LSP8Enumerable.behaviour.ts | 1 + .../LSP8IdentifiableDigitalAsset.behaviour.ts | 8 ++++++++ .../LSP8Mintable.behaviour.ts | 1 + .../proxy/LSP8BurnableInit.test.ts | 5 ++++- .../proxy/LSP8CappedSupplyInit.test.ts | 6 ++++-- .../proxy/LSP8CompatibleERC721Init.test.ts | 17 +++++++++++++---- .../proxy/LSP8EnumerableInit.test.ts | 6 ++++-- .../LSP8IdentifiableDigitalAssetInit.test.ts | 12 +++++++++--- .../proxy/LSP8MintableInit.test.ts | 10 +++++++--- .../standard/LSP8Burnable.test.ts | 5 ++++- .../standard/LSP8CappedSupply.test.ts | 4 +++- .../standard/LSP8CompatibleERC721.test.ts | 4 +++- .../standard/LSP8Enumerable.test.ts | 4 +++- .../LSP8IdentifiableDigitalAsset.test.ts | 9 ++++++++- .../standard/LSP8Mintable.test.ts | 4 +++- 27 files changed, 168 insertions(+), 59 deletions(-) diff --git a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol b/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol index 0b63ce67b..79128af6d 100644 --- a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol @@ -15,13 +15,15 @@ contract LSP8BurnableInitTester is LSP8BurnableInitAbstract { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); } } diff --git a/contracts/Mocks/Tokens/LSP8BurnableTester.sol b/contracts/Mocks/Tokens/LSP8BurnableTester.sol index 02c38dbb4..a8dcf0cd9 100644 --- a/contracts/Mocks/Tokens/LSP8BurnableTester.sol +++ b/contracts/Mocks/Tokens/LSP8BurnableTester.sol @@ -15,6 +15,15 @@ contract LSP8BurnableTester is LSP8Burnable { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_ - ) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, tokenIdType_) {} + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) + LSP8IdentifiableDigitalAsset( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + {} } diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol b/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol index ece6a3b52..b73503f1f 100644 --- a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol @@ -16,13 +16,15 @@ contract LSP8CappedSupplyInitTester is LSP8CappedSupplyInitAbstract { string memory symbol_, address newOwner_, uint256 tokenIdType_, - uint256 tokenSupplyCap_ + uint256 tokenSupplyCap_, + uint256 lsp4TokenType_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); LSP8CappedSupplyInitAbstract._initialize(tokenSupplyCap_); } diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol b/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol index 5ee6bea0c..c0ad07698 100644 --- a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol +++ b/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol @@ -16,9 +16,16 @@ contract LSP8CappedSupplyTester is LSP8CappedSupply { string memory symbol_, address newOwner_, uint256 tokenIdType_, - uint256 tokenSupplyCap_ + uint256 tokenSupplyCap_, + uint256 lsp4TokenType_ ) - LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, tokenIdType_) + LSP8IdentifiableDigitalAsset( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) LSP8CappedSupply(tokenSupplyCap_) {} diff --git a/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol b/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol index e713ebe63..8e400d4c4 100644 --- a/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol +++ b/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol @@ -18,8 +18,17 @@ contract LSP8CompatibleERC721Tester is LSP8CompatibleERC721 { string memory symbol_, address newOwner_, uint256 tokenIdType_, - bytes memory tokenURIValue_ - ) LSP8CompatibleERC721(name_, symbol_, newOwner_, tokenIdType_) { + bytes memory tokenURIValue_, + uint256 lsp4TokenType_ + ) + LSP8CompatibleERC721( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + { _setData(_LSP4_METADATA_KEY, tokenURIValue_); } diff --git a/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol b/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol index 51689eb2e..a7e3b65b6 100644 --- a/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol +++ b/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol @@ -25,13 +25,15 @@ contract LSP8CompatibleERC721InitTester is LSP8CompatibleERC721InitAbstract { string memory symbol_, address newOwner_, uint256 tokenIdType_, - bytes memory tokenURIValue_ + bytes memory tokenURIValue_, + uint256 lsp4TokenType_ ) public virtual initializer { LSP8CompatibleERC721InitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_ + tokenIdType_, + lsp4TokenType_ ); _setData(_LSP4_METADATA_KEY, tokenURIValue_); diff --git a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol b/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol index 50aa38f66..05e2f7313 100644 --- a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol @@ -12,16 +12,18 @@ import { contract LSP8EnumerableInitTester is LSP8EnumerableInitAbstract { function initialize( - string memory name, - string memory symbol, - address newOwner, - uint256 tokenIdType + string memory name_, + string memory symbol_, + address newOwner_, + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( - name, - symbol, - newOwner, - tokenIdType + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ ); } diff --git a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol b/contracts/Mocks/Tokens/LSP8EnumerableTester.sol index ef7d25858..cf46ca5be 100644 --- a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol +++ b/contracts/Mocks/Tokens/LSP8EnumerableTester.sol @@ -12,11 +12,20 @@ import { contract LSP8EnumerableTester is LSP8Enumerable { constructor( - string memory name, - string memory symbol, - address newOwner, - uint256 tokenIdType - ) LSP8IdentifiableDigitalAsset(name, symbol, newOwner, tokenIdType) {} + string memory name_, + string memory symbol_, + address newOwner_, + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) + LSP8IdentifiableDigitalAsset( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + {} function mint(address to, bytes32 tokenId) public { _mint(to, tokenId, true, "token printer go brrr"); diff --git a/contracts/Mocks/Tokens/LSP8InitTester.sol b/contracts/Mocks/Tokens/LSP8InitTester.sol index 9f8e3245d..633f776f0 100644 --- a/contracts/Mocks/Tokens/LSP8InitTester.sol +++ b/contracts/Mocks/Tokens/LSP8InitTester.sol @@ -15,16 +15,18 @@ contract LSP8InitTester is LSP8BurnableInitAbstract { function initialize( - string memory name, - string memory symbol, - address newOwner, - uint256 tokenIdType + string memory name_, + string memory symbol_, + address newOwner_, + uint256 tokenIdType_, + uint256 lsp4TokenType_ ) public initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( - name, - symbol, - newOwner, - tokenIdType + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ ); } diff --git a/contracts/Mocks/Tokens/LSP8Tester.sol b/contracts/Mocks/Tokens/LSP8Tester.sol index 337cdc2b9..080752ac6 100644 --- a/contracts/Mocks/Tokens/LSP8Tester.sol +++ b/contracts/Mocks/Tokens/LSP8Tester.sol @@ -12,11 +12,20 @@ import { contract LSP8Tester is LSP8IdentifiableDigitalAsset, LSP8Burnable { constructor( - string memory name, - string memory symbol, - address newOwner, - uint256 tokenIdType - ) LSP8IdentifiableDigitalAsset(name, symbol, newOwner, tokenIdType) {} + string memory name_, + string memory symbol_, + address newOwner_, + uint256 tokenIdType_, + uint256 lsp4TokenType_ + ) + LSP8IdentifiableDigitalAsset( + name_, + symbol_, + newOwner_, + tokenIdType_, + lsp4TokenType_ + ) + {} function mint( address to, diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts index 24cb4ceca..e96a4ea32 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts @@ -22,6 +22,7 @@ export type LSP8CappedSupplyTestContext = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; tokenIdType: number; tokenSupplyCap: BigNumber; }; diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts index edf0b2ad7..c47bcf774 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts @@ -47,6 +47,7 @@ type LSP8CompatibleERC721DeployParams = { symbol: string; newOwner: string; lsp4MetadataValue: string; + lsp4TokenType: number; tokenIdType: number; }; diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts index 0be64bb05..2c5066783 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts @@ -18,6 +18,7 @@ export type LSP8EnumerableDeployParams = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; tokenIdType: number; }; diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts index f03a712ae..1ac94fdf4 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts @@ -42,6 +42,7 @@ export type LSP8DeployParams = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; tokenIdType: number; }; @@ -1856,6 +1857,13 @@ export const shouldInitializeLikeLSP8 = ( .withArgs(symbolKey, expectedSymbolValue); expect(await context.lsp8.getData(symbolKey)).to.equal(expectedSymbolValue); + const tokenTypeKey = ERC725YDataKeys.LSP4['LSP4TokenType']; + const expectedTokenTypeValue = abiCoder.encode( + ['uint256'], + [context.deployParams.lsp4TokenType], + ); + expect(await context.lsp8.getData(tokenTypeKey)).to.equal(expectedTokenTypeValue); + const lsp8TokenIdTypeDataKey = ERC725YDataKeys.LSP8['LSP8TokenIdType']; const expectedTokenIdDataValue = abiCoder.encode( ['uint256'], diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts index da558a2ca..59c687015 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts @@ -28,6 +28,7 @@ export type LSP8MintableDeployParams = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; tokenIdType: number; }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts index f6d1cf7db..6d0980361 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts @@ -7,7 +7,7 @@ import { LSP8BurnableInitTester, LSP8BurnableInitTester__factory } from '../../. import { shouldInitializeLikeLSP8 } from '../LSP8IdentifiableDigitalAsset.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; type LSP8BurnableInitTestContext = { accounts: SignerWithAddress[]; @@ -16,6 +16,7 @@ type LSP8BurnableInitTestContext = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; tokenIdType: number; }; }; @@ -27,6 +28,7 @@ describe('LSP8BurnableInit with proxy', () => { name: 'LSP8 Burnable - deployed with constructor', symbol: 'BRN', newOwner: accounts[0].address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; @@ -45,6 +47,7 @@ describe('LSP8BurnableInit with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenIdType, + context.deployParams.lsp4TokenType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts index b1091b1b4..8463c9e0e 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts @@ -10,7 +10,7 @@ import { } from '../LSP8CappedSupply.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8CappedSupplyInit with proxy', () => { const buildTestContext = async () => { @@ -19,6 +19,7 @@ describe('LSP8CappedSupplyInit with proxy', () => { name: 'LSP8 capped supply - deployed with proxy', symbol: 'CAP', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, tokenSupplyCap: ethers.BigNumber.from('2'), }; @@ -32,12 +33,13 @@ describe('LSP8CappedSupplyInit with proxy', () => { }; const initializeProxy = async (context: LSP8CappedSupplyTestContext) => { - return context.lsp8CappedSupply['initialize(string,string,address,uint256,uint256)']( + return context.lsp8CappedSupply['initialize(string,string,address,uint256,uint256,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenIdType, context.deployParams.tokenSupplyCap, + context.deployParams.lsp4TokenType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts index cf444cca8..be586e4e5 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts @@ -14,7 +14,7 @@ import { } from '../LSP8CompatibleERC721.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8CompatibleERC721Init with proxy', () => { const buildTestContext = async (): Promise => { @@ -32,6 +32,7 @@ describe('LSP8CompatibleERC721Init with proxy', () => { name: 'LSP8 - deployed with constructor', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, lsp4MetadataValue, }; @@ -49,12 +50,13 @@ describe('LSP8CompatibleERC721Init with proxy', () => { }; const initializeProxy = async (context: LSP8CompatibleERC721TestContext) => { - return context.lsp8CompatibleERC721['initialize(string,string,address,uint256,bytes)']( + return context.lsp8CompatibleERC721['initialize(string,string,address,uint256,bytes,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenIdType, context.deployParams.lsp4MetadataValue, + context.deployParams.lsp4TokenType, ); }; @@ -68,12 +70,13 @@ describe('LSP8CompatibleERC721Init with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp8CompatibilityForERC721TesterInit['initialize(string,string,address,uint256,bytes)']( + lsp8CompatibilityForERC721TesterInit.initialize( 'XXXXXXXXXXX', 'XXX', randomCaller.address, 0, '0x', + 12345, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); @@ -88,7 +91,13 @@ describe('LSP8CompatibleERC721Init with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp8CompatibleERC721MintableInit.initialize('XXXXXXXXXXX', 'XXX', randomCaller.address, 0), + lsp8CompatibleERC721MintableInit.initialize( + 'XXXXXXXXXXX', + 'XXX', + randomCaller.address, + 0, + 12345, + ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts index 7aae65422..c03240fa7 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts @@ -9,7 +9,7 @@ import { } from '../LSP8Enumerable.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8EnumerableInit with proxy', () => { const buildTestContext = async () => { @@ -18,6 +18,7 @@ describe('LSP8EnumerableInit with proxy', () => { name: 'LSP8 Enumerable - deployed with proxy', symbol: 'LSP8 NMRBL', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; @@ -31,11 +32,12 @@ describe('LSP8EnumerableInit with proxy', () => { }; const initializeProxy = async (context: LSP8EnumerableTestContext) => { - return context.lsp8Enumerable['initialize(string,string,address,uint256)']( + return context.lsp8Enumerable['initialize(string,string,address,uint256,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenIdType, + context.deployParams.lsp4TokenType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts index d016e2167..79ee91081 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts @@ -16,6 +16,7 @@ import { } from '../../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour'; import { deployProxy } from '../../utils/fixtures'; +import { LSP4_TOKEN_TYPES } from '../../../constants'; describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { const buildTestContext = async (nftType: number): Promise => { @@ -24,6 +25,7 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { name: 'LSP8 - deployed with constructor', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: nftType, }; @@ -41,6 +43,7 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { const deployParams = { owner: accounts[0], + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, }; return { @@ -51,11 +54,12 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { }; const initializeProxy = async (context: LSP8TestContext) => { - return context.lsp8['initialize(string,string,address,uint256)']( + return context.lsp8['initialize(string,string,address,uint256,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenIdType, + context.deployParams.lsp4TokenType, ); }; @@ -68,11 +72,12 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { it('should revert when initializing with address(0) as owner', async () => { await expect( - context.lsp8['initialize(string,string,address,uint256)']( + context.lsp8['initialize(string,string,address,uint256,uint256)']( context.deployParams.name, context.deployParams.symbol, ethers.constants.AddressZero, 0, + context.deployParams.lsp4TokenType, ), ).to.be.revertedWithCustomError(context.lsp8, 'OwnableCannotSetZeroAddressAsOwner'); }); @@ -103,11 +108,12 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { shouldBehaveLikeLSP4DigitalAssetMetadata(async () => { const lsp4Context = await buildLSP4DigitalAssetMetadataTestContext(); - await lsp4Context.contract['initialize(string,string,address,uint256)']( + await lsp4Context.contract['initialize(string,string,address,uint256,uint256)']( 'LSP8 - deployed with proxy', 'NFT', lsp4Context.deployParams.owner.address, 0, + lsp4Context.deployParams.lsp4TokenType, ); return lsp4Context; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts index 9843cffcb..4ef49929a 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts @@ -10,7 +10,7 @@ import { } from '../LSP8Mintable.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { ERC725YDataKeys, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { ERC725YDataKeys, LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8MintableInit with proxy', () => { const buildTestContext = async () => { @@ -19,6 +19,7 @@ describe('LSP8MintableInit with proxy', () => { name: 'LSP8 Mintable - deployed with proxy', symbol: 'MNTBL', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; @@ -33,11 +34,12 @@ describe('LSP8MintableInit with proxy', () => { }; const initializeProxy = async (context: LSP8MintableTestContext) => { - return context.lsp8Mintable['initialize(string,string,address,uint256)']( + return context.lsp8Mintable['initialize(string,string,address,uint256,uint256)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.tokenIdType, + context.deployParams.lsp4TokenType, ); }; @@ -50,6 +52,7 @@ describe('LSP8MintableInit with proxy', () => { expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenName)).to.equal('0x'); expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenSymbol)).to.equal('0x'); expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4Metadata)).to.equal('0x'); + expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenType)).to.equal('0x'); expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP8.LSP8TokenIdType)).to.equal('0x'); expect(await lsp8MintableInit.owner()).to.equal(ethers.constants.AddressZero); @@ -63,11 +66,12 @@ describe('LSP8MintableInit with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp8Mintable['initialize(string,string,address,uint256)']( + lsp8Mintable['initialize(string,string,address,uint256,uint256)']( 'XXXXXXXXXXX', 'XXX', randomCaller.address, 0, + 12345, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts index 4170d7959..05d691467 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts @@ -4,7 +4,7 @@ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { LSP8BurnableTester, LSP8BurnableTester__factory } from '../../../types'; import { shouldInitializeLikeLSP8 } from '../LSP8IdentifiableDigitalAsset.behaviour'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; type LSP8BurnableTestContext = { accounts: SignerWithAddress[]; @@ -13,6 +13,7 @@ type LSP8BurnableTestContext = { name: string; symbol: string; newOwner: string; + lsp4TokenType: number; tokenIdType: number; }; }; @@ -24,6 +25,7 @@ describe('LSP8Burnable with constructor', () => { name: 'LSP8 Burnable - deployed with constructor', symbol: 'BRN', newOwner: accounts[0].address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; @@ -32,6 +34,7 @@ describe('LSP8Burnable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.tokenIdType, + deployParams.lsp4TokenType, ); return { accounts, lsp8Burnable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts index 9d3c85e41..c6c332724 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts @@ -8,7 +8,7 @@ import { LSP8CappedSupplyTestContext, getNamedAccounts, } from '../LSP8CappedSupply.behaviour'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8CappedSupply with constructor', () => { const buildTestContext = async () => { @@ -17,6 +17,7 @@ describe('LSP8CappedSupply with constructor', () => { name: 'LSP8 capped supply - deployed with constructor', symbol: 'CAP', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, tokenSupplyCap: ethers.BigNumber.from('2'), }; @@ -26,6 +27,7 @@ describe('LSP8CappedSupply with constructor', () => { deployParams.newOwner, deployParams.tokenIdType, deployParams.tokenSupplyCap, + deployParams.lsp4TokenType, ); return { accounts, lsp8CappedSupply, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts index e55499f8f..50d3a59d5 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts @@ -8,7 +8,7 @@ import { shouldInitializeLikeLSP8CompatibleERC721, LSP8CompatibleERC721TestContext, } from '../LSP8CompatibleERC721.behaviour'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8CompatibleERC721 with constructor', () => { const buildTestContext = async (): Promise => { @@ -26,6 +26,7 @@ describe('LSP8CompatibleERC721 with constructor', () => { name: 'Compat for ERC721', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, lsp4MetadataValue, }; @@ -38,6 +39,7 @@ describe('LSP8CompatibleERC721 with constructor', () => { deployParams.newOwner, deployParams.tokenIdType, deployParams.lsp4MetadataValue, + deployParams.lsp4TokenType, ); return { accounts, lsp8CompatibleERC721, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts index e78b97336..7310947d0 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts @@ -6,7 +6,7 @@ import { LSP8EnumerableTestContext, getNamedAccounts, } from '../LSP8Enumerable.behaviour'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8Enumerable with constructor', () => { const buildTestContext = async () => { @@ -16,6 +16,7 @@ describe('LSP8Enumerable with constructor', () => { name: 'LSP8 Enumerable - deployed with constructor', symbol: 'LSP8 NMRBL', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; @@ -26,6 +27,7 @@ describe('LSP8Enumerable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.tokenIdType, + deployParams.lsp4TokenType, ); return { accounts, lsp8Enumerable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts index 3d5d14d07..0fb923317 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts @@ -19,7 +19,7 @@ import { LS4DigitalAssetMetadataTestContext, shouldBehaveLikeLSP4DigitalAssetMetadata, } from '../../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour'; -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; describe('LSP8IdentifiableDigitalAsset with constructor', () => { const buildTestContext = async (nftType: number): Promise => { @@ -28,6 +28,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { name: 'LSP8 - deployed with constructor', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: nftType, }; const lsp8 = await new LSP8Tester__factory(accounts.owner).deploy( @@ -35,6 +36,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.tokenIdType, + deployParams.lsp4TokenType, ); return { accounts, lsp8, deployParams }; @@ -47,6 +49,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { const deployParams = { owner: accounts[0], + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, }; return { @@ -63,6 +66,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { name: 'LSP8 - deployed with constructor', symbol: 'NFT', owner: accounts[0], + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const contract = await new LSP8Tester__factory(accounts[0]).deploy( @@ -70,6 +74,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { deployParams.symbol, deployParams.owner.address, deployParams.tokenIdType, + deployParams.lsp4TokenType, ); return { accounts, contract, deployParams }; @@ -83,6 +88,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { name: 'LSP8 - deployed with constructor', symbol: 'NFT', newOwner: ethers.constants.AddressZero, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, }; const contractToDeploy = new LSP8Tester__factory(accounts[0]); @@ -93,6 +99,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { deployParams.symbol, ethers.constants.AddressZero, LSP8_TOKEN_ID_TYPES.NUMBER, + deployParams.lsp4TokenType, ), ).to.be.revertedWithCustomError(contractToDeploy, 'OwnableCannotSetZeroAddressAsOwner'); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts index 79b77d849..3c50646fc 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts @@ -1,4 +1,4 @@ -import { LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; import { LSP8Mintable, LSP8Mintable__factory } from '../../../types'; import { shouldInitializeLikeLSP8 } from '../LSP8IdentifiableDigitalAsset.behaviour'; @@ -16,6 +16,7 @@ describe('LSP8Mintable with constructor', () => { name: 'LSP8 Mintable - deployed with constructor', symbol: 'LSP8 MNTBL', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.NFT, tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; @@ -24,6 +25,7 @@ describe('LSP8Mintable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.tokenIdType, + deployParams.lsp4TokenType, ); return { accounts, lsp8Mintable, deployParams }; From 2b2577d39e4810132f19fd58e54d303cf4f41065 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 14:49:42 +0000 Subject: [PATCH 05/12] docs: update auto-generated docs --- .../LSP4DigitalAssetMetadata.md | 23 ++++++++++- .../LSP7DigitalAsset/LSP7DigitalAsset.md | 23 ++++++++++- .../extensions/LSP7Burnable.md | 23 ++++++++++- .../extensions/LSP7CappedSupply.md | 23 ++++++++++- .../extensions/LSP7CompatibleERC20.md | 23 ++++++++++- .../presets/LSP7CompatibleERC20Mintable.md | 41 +++++++++++++++---- .../LSP7DigitalAsset/presets/LSP7Mintable.md | 39 ++++++++++++++---- .../LSP8IdentifiableDigitalAsset.md | 23 ++++++++++- .../extensions/LSP8Burnable.md | 23 ++++++++++- .../extensions/LSP8CappedSupply.md | 23 ++++++++++- .../extensions/LSP8CompatibleERC721.md | 23 ++++++++++- .../extensions/LSP8Enumerable.md | 23 ++++++++++- .../presets/LSP8CompatibleERC721Mintable.md | 39 ++++++++++++++---- .../presets/LSP8Mintable.md | 39 ++++++++++++++---- 14 files changed, 333 insertions(+), 55 deletions(-) diff --git a/docs/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md b/docs/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md index 15121dc6b..d2aa87b1d 100644 --- a/docs/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md +++ b/docs/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.md @@ -483,7 +483,7 @@ Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#set error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -502,7 +502,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-4-DigitalAssetMetadata**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-4-DigitalAssetMetadata.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP4DigitalAssetMetadata.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md b/docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md index 3900f03f1..2c65f288f 100644 --- a/docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md +++ b/docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md @@ -1388,7 +1388,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1407,7 +1407,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md b/docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md index be7904c07..69ba785d0 100644 --- a/docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md +++ b/docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md @@ -1413,7 +1413,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1432,7 +1432,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md b/docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md index ce8ec9237..7214256c1 100644 --- a/docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md +++ b/docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md @@ -1387,7 +1387,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1406,7 +1406,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md b/docs/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md index 4f96f2746..982e2409a 100644 --- a/docs/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md +++ b/docs/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.md @@ -1530,7 +1530,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1549,7 +1549,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP7CompatibleERC20.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md b/docs/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md index 44601bc29..e3f44ae2c 100644 --- a/docs/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md +++ b/docs/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.md @@ -31,18 +31,24 @@ When marked as 'public', a method can be called both externally and internally, ::: ```solidity -constructor(string name_, string symbol_, address newOwner_); +constructor( + string name_, + string symbol_, + address newOwner_, + uint256 lsp4TokenType_ +); ``` _Deploying a `LSP7CompatibleERC20Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._ #### Parameters -| Name | Type | Description | -| ----------- | :-------: | -------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | +| Name | Type | Description | +| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). |
@@ -1564,7 +1570,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1583,7 +1589,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP7CompatibleERC20Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md b/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md index 3c6bf9d9b..b3d511af8 100644 --- a/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md +++ b/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md @@ -35,7 +35,8 @@ constructor( string name_, string symbol_, address newOwner_, - bool isNonDivisible_ + bool isNonDivisible_, + uint256 lsp4TokenType_ ); ``` @@ -43,12 +44,13 @@ _Deploying a `LSP7Mintable` token contract with: token name = `name_`, token sym #### Parameters -| Name | Type | Description | -| ----------------- | :-------: | -------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `isNonDivisible_` | `bool` | - | +| Name | Type | Description | +| ----------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `isNonDivisible_` | `bool` | - | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). |
@@ -1450,7 +1452,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1469,7 +1471,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md b/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md index c2e4b5192..d23daffa0 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md @@ -1386,7 +1386,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1405,7 +1405,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md index 039e018b9..9048c572c 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md @@ -1412,7 +1412,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1431,7 +1431,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md index 683016cdb..bec910f83 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md @@ -1386,7 +1386,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1405,7 +1405,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md index 666d1384b..d878c5ad2 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md @@ -1777,7 +1777,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1796,7 +1796,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md index 075c11a2c..5f4e9fa89 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md @@ -1414,7 +1414,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1433,7 +1433,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md index e5effdcc1..c6992231e 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md @@ -35,7 +35,8 @@ constructor( string name_, string symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ); ``` @@ -43,12 +44,13 @@ _Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `n #### Parameters -| Name | Type | Description | -| -------------- | :-------: | -------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `tokenIdType_` | `uint256` | - | +| Name | Type | Description | +| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `tokenIdType_` | `uint256` | - | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). |
@@ -1819,7 +1821,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1838,7 +1840,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md index 5bf7ffb76..958dd5ebe 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md @@ -35,7 +35,8 @@ constructor( string name_, string symbol_, address newOwner_, - uint256 tokenIdType_ + uint256 tokenIdType_, + uint256 lsp4TokenType_ ); ``` @@ -43,12 +44,13 @@ _Deploying a `LSP8Mintable` token contract with: token name = `name_`, token sym #### Parameters -| Name | Type | Description | -| -------------- | :-------: | -------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `tokenIdType_` | `uint256` | - | +| Name | Type | Description | +| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `tokenIdType_` | `uint256` | - | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). |
@@ -1450,7 +1452,7 @@ reverts when the contract is called with a function selector not valid (less tha error LSP4TokenNameNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed. The `LSP4TokenName` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized.
@@ -1469,7 +1471,26 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset error LSP4TokenSymbolNotEditable(); ``` -Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed. The `LSP4TokenSymbol` data key is located inside the ERC725Y Data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + +
+ +### LSP4TokenTypeNotEditable + +:::note References + +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp4tokentypenoteditable) +- Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) +- Error signature: `LSP4TokenTypeNotEditable()` +- Error hash: `0x4ef6d7fb` + +::: + +```solidity +error LSP4TokenTypeNotEditable(); +``` + +Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized.
From fc580a37f8a8d4757aa91b212b7cecbe27b161f1 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 15:28:44 +0000 Subject: [PATCH 06/12] test: fix remaining tests that deploy tokens --- tests/Benchmark.test.ts | 11 +++++++++++ .../LSP1UniversalReceiverDelegateUP.behaviour.ts | 12 ++++++++++++ .../LSP1UniversalReceiverDelegateVault.behaviour.ts | 11 +++++++++++ .../LSP6/Interactions/AllowedFunctions.test.ts | 3 +++ .../LSP6/Interactions/AllowedStandards.test.ts | 4 ++++ .../LSP6/Interactions/ERC725XExecuteBatch.test.ts | 6 +++++- .../Interactions/PermissionTransferValue.test.ts | 5 +++++ .../Interactions/AllowedFunctions.test.ts | 3 +++ .../Interactions/AllowedStandards.test.ts | 4 ++++ .../LSP6KeyManager/Interactions/BatchExecute.test.ts | 11 ++++++++++- .../Interactions/PermissionTransferValue.test.ts | 5 +++++ tests/LSP6KeyManager/LSP6ControlledToken.test.ts | 10 +++++++++- tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts | 2 ++ .../standard/LSP7CompatibleERC20.test.ts | 3 ++- 14 files changed, 86 insertions(+), 4 deletions(-) diff --git a/tests/Benchmark.test.ts b/tests/Benchmark.test.ts index 302f0a722..441a173f7 100644 --- a/tests/Benchmark.test.ts +++ b/tests/Benchmark.test.ts @@ -22,6 +22,7 @@ import { PERMISSIONS, CALLTYPE, LSP8_TOKEN_ID_TYPES, + LSP4_TOKEN_TYPES, } from '../constants'; import { LSP6TestContext } from './utils/context'; import { setupKeyManager, setupProfileWithKeyManagerWithURD } from './utils/fixtures'; @@ -129,6 +130,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTKN', accounts[0].address, false, + LSP4_TOKEN_TYPES.TOKEN, ); const lsp7DeployTransaction = lsp7Mintable.deployTransaction; @@ -142,6 +144,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNFT', accounts[0].address, LSP8_TOKEN_ID_TYPES.NUMBER, + LSP4_TOKEN_TYPES.NFT, ); const lsp8DeployTransaction = lsp8Mintable.deployTransaction; @@ -552,6 +555,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTKN', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); // deploy a LSP8 token @@ -560,6 +564,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNFT', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); universalProfile1 = await new UniversalProfile__factory(context.mainController).deploy( @@ -704,6 +709,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTC', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); // deploy a LSP8 NFT @@ -712,6 +718,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNF', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); // mint some tokens to the UP @@ -891,6 +898,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTC', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); lsp7LyxDai = await new LSP7Mintable__factory(context.mainController).deploy( @@ -898,6 +906,7 @@ describe('⛽📊 Gas Benchmark', () => { 'LDAI', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); [lsp7MetaCoin, lsp7LyxDai].forEach(async (token) => { @@ -912,6 +921,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNF', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); lsp8LyxPunks = await new LSP8Mintable__factory(context.mainController).deploy( @@ -919,6 +929,7 @@ describe('⛽📊 Gas Benchmark', () => { 'LPK', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); [ diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts index 20e758f48..be9afd648 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts @@ -36,6 +36,7 @@ import { OPERATION_TYPES, LSP1_TYPE_IDS, LSP8_TOKEN_ID_TYPES, + LSP4_TOKEN_TYPES, } from '../../constants'; // fixtures @@ -245,18 +246,21 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TokenAlpha', 'TA', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); lsp7TokenB = await new LSP7Tester__factory(context.accounts.random).deploy( 'TokenBeta', 'TB', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); lsp7TokenC = await new LSP7Tester__factory(context.accounts.random).deploy( 'TokenGamma', 'TA', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); }); @@ -269,6 +273,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'LSP7 Token', 'TKN', context.universalProfile1.address, + LSP4_TOKEN_TYPES.TOKEN, ); }); @@ -931,6 +936,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'Example LSP7 token', 'EL7T', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); }); @@ -1124,6 +1130,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'Example LSP7 token', 'EL7T', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); arrayKey = ERC725YDataKeys.LSP5['LSP5ReceivedAssets[]'].length; @@ -1782,6 +1789,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TA', context.accounts.random.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); lsp8TokenB = await new LSP8Tester__factory(context.accounts.random).deploy( @@ -1789,6 +1797,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TB', context.accounts.random.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); lsp8TokenC = await new LSP8Tester__factory(context.accounts.random).deploy( @@ -1796,6 +1805,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TA', context.accounts.random.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); }); @@ -3087,6 +3097,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'MyToken', 'MTK', context.universalProfile1.address, + LSP4_TOKEN_TYPES.TOKEN, ); expect(await LSP7.balanceOf(context.universalProfile1.address)).to.equal(1000); @@ -3119,6 +3130,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'MTK', context.universalProfile1.address, LSP8_TOKEN_ID_TYPES.NUMBER, + LSP4_TOKEN_TYPES.NFT, ); // Mint token for UP1 await LSP8.mint(context.universalProfile1.address, '0x' + '0'.repeat(64), true, '0x'); diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts index a41f25b70..21dc57bbe 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts @@ -25,6 +25,7 @@ import { OPERATION_TYPES, LSP1_TYPE_IDS, LSP8_TOKEN_ID_TYPES, + LSP4_TOKEN_TYPES, } from '../../constants'; import { callPayload, getLSP5MapAndArrayKeysValue } from '../utils/fixtures'; import { BigNumber, BytesLike, Transaction } from 'ethers'; @@ -209,18 +210,21 @@ export const shouldBehaveLikeLSP1Delegate = (buildContext: () => Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise { 'symbol', accounts[0].address, true, + LSP4_TOKEN_TYPES.TOKEN, ); const keyManager = await new LSP6KeyManager__factory(accounts[0]).deploy(lsp7.address); @@ -597,6 +604,7 @@ describe('When deploying LSP7 with LSP6 as owner', () => { 'NewTokenName', 'NewTokenSymbol', context.mainController.address, + LSP4_TOKEN_TYPES.TOKEN, ); // creating a payload to mint tokens in the new contract const mintPayload = newTokenContract.interface.encodeFunctionData('mint', [ diff --git a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts index 97bcc5ff1..38a36bb75 100644 --- a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts +++ b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts @@ -21,6 +21,7 @@ import { PERMISSIONS, CALLTYPE, INTERFACE_IDS, + LSP4_TOKEN_TYPES, } from '../../../constants'; // helpers @@ -1379,6 +1380,7 @@ export const shouldBehaveLikeExecuteRelayCall = ( 'LSP7', context.universalProfile.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); const permissionKeys = [ diff --git a/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts b/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts index c49853f0b..0c37f48ea 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts @@ -18,13 +18,14 @@ describe('LSP7CompatibleERC20 with constructor', () => { name: 'Compat for ERC20', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7CompatibleERC20 = await new LSP7CompatibleERC20Tester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - LSP4_TOKEN_TYPES.TOKEN, + deployParams.lsp4TokenType, ); return { From 54a623cb508a6fdb9fb35ab8bb4179792a6a0759 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 15:44:20 +0000 Subject: [PATCH 07/12] test: update tokens deployments on foundry tests --- constants.ts | 2 +- contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol | 6 ++++++ .../foundry/GasTests/execute/RestrictedController.sol | 10 ++++++++-- .../GasTests/execute/UnrestrictedController.sol | 10 ++++++++-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/constants.ts b/constants.ts index 5141f3844..b5cc13101 100644 --- a/constants.ts +++ b/constants.ts @@ -192,7 +192,7 @@ export const ERC725YDataKeys = { // keccak256('LSP4TokenSymbol') LSP4TokenSymbol: '0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756', - // kecca256('LSP4TokenType) + // keccak256('LSP4TokenType) LSP4TokenType: '0xe0261fa95db2eb3b5439bd033cda66d56b96f92f243a8228fd87550ed7bdfdb3', // keccak256('LSP4Metadata') diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol b/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol index ce82f1eb2..fa9edc516 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol @@ -1,6 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; +// Token types + +uint256 constant _LSP4_TOKEN_TYPE_TOKEN = 0; +uint256 constant _LSP4_TOKEN_TYPE_NFT = 1; +uint256 constant _LSP4_TOKEN_TYPE_COLLECTION = 2; + // --- ERC725Y entries // bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP4DigitalAsset')) diff --git a/tests/foundry/GasTests/execute/RestrictedController.sol b/tests/foundry/GasTests/execute/RestrictedController.sol index a7bf58cf0..d6a7497b0 100644 --- a/tests/foundry/GasTests/execute/RestrictedController.sol +++ b/tests/foundry/GasTests/execute/RestrictedController.sol @@ -10,6 +10,10 @@ import "../../../../contracts/Mocks/Tokens/LSP8Tester.sol"; import { _LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY } from "../../../../contracts/LSP1UniversalReceiver/LSP1Constants.sol"; +import { + _LSP4_TOKEN_TYPE_TOKEN, + _LSP4_TOKEN_TYPE_NFT +} from "../../../../contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol"; import { _LSP6KEY_ADDRESSPERMISSIONS_PERMISSIONS_PREFIX, _PERMISSION_SUPER_SETDATA, @@ -442,7 +446,8 @@ contract ExecuteRestrictedController is UniversalProfileTestsHelper { "TestLSP8", "TSTLSP8", digitalAssetsOwner, - _LSP8_TOKENID_TYPE_NUMBER + _LSP8_TOKENID_TYPE_NUMBER, + _LSP4_TOKEN_TYPE_NFT ); bytes32 tokenID = bytes32(uint256(1)); @@ -467,7 +472,8 @@ contract ExecuteRestrictedController is UniversalProfileTestsHelper { digitalAsset = new LSP7Tester( "TestLSP7", "TSTLSP7", - digitalAssetsOwner + digitalAssetsOwner, + _LSP4_TOKEN_TYPE_TOKEN ); // mint 100 tokens to UniversalProfile diff --git a/tests/foundry/GasTests/execute/UnrestrictedController.sol b/tests/foundry/GasTests/execute/UnrestrictedController.sol index 49ca3b07a..f2fdcbc19 100644 --- a/tests/foundry/GasTests/execute/UnrestrictedController.sol +++ b/tests/foundry/GasTests/execute/UnrestrictedController.sol @@ -10,6 +10,10 @@ import "../../../../contracts/Mocks/Tokens/LSP8Tester.sol"; import { _LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY } from "../../../../contracts/LSP1UniversalReceiver/LSP1Constants.sol"; +import { + _LSP4_TOKEN_TYPE_TOKEN, + _LSP4_TOKEN_TYPE_NFT +} from "../../../../contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol"; import { _LSP6KEY_ADDRESSPERMISSIONS_PERMISSIONS_PREFIX, _PERMISSION_SUPER_SETDATA, @@ -264,7 +268,8 @@ contract ExecuteUnrestrictedController is UniversalProfileTestsHelper { "TestLSP8", "TSTLSP8", digitalAssetsOwner, - _LSP8_TOKENID_TYPE_NUMBER + _LSP8_TOKENID_TYPE_NUMBER, + _LSP4_TOKEN_TYPE_NFT ); bytes32 tokenID = bytes32(uint256(1)); @@ -289,7 +294,8 @@ contract ExecuteUnrestrictedController is UniversalProfileTestsHelper { digitalAsset = new LSP7Tester( "TestLSP7", "TSTLSP7", - digitalAssetsOwner + digitalAssetsOwner, + _LSP4_TOKEN_TYPE_TOKEN ); // mint 100 tokens to UniversalProfile From 00f9fce8935373cacc04cbbd686fe33ee01ecc19 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Fri, 24 Nov 2023 10:47:26 +0000 Subject: [PATCH 08/12] refactor: put `lsp4TokenType` param before `lsp8TokenIdType` on deployment --- .../LSP7DigitalAsset/LSP7DigitalAsset.sol | 13 ++++++------ .../LSP7DigitalAssetInitAbstract.sol | 8 ++++---- .../extensions/LSP7CompatibleERC20.sol | 2 +- .../LSP7CompatibleERC20InitAbstract.sol | 4 ++-- .../LSP7DigitalAsset/presets/LSP7Mintable.sol | 9 +++++---- .../presets/LSP7MintableInit.sol | 9 +++++---- .../presets/LSP7MintableInitAbstract.sol | 9 +++++---- .../LSP8IdentifiableDigitalAsset.sol | 12 +++++------ ...P8IdentifiableDigitalAssetInitAbstract.sol | 10 +++++----- .../extensions/LSP8CompatibleERC721.sol | 10 ++++++---- .../LSP8CompatibleERC721InitAbstract.sol | 10 ++++++---- .../presets/LSP8CompatibleERC721Mintable.sol | 10 ++++++---- .../LSP8CompatibleERC721MintableInit.sol | 10 ++++++---- ...P8CompatibleERC721MintableInitAbstract.sol | 8 ++++---- .../presets/LSP8Mintable.sol | 10 ++++++---- .../presets/LSP8MintableInit.sol | 10 ++++++---- .../presets/LSP8MintableInitAbstract.sol | 11 ++++++---- .../Tokens/LSP7CappedSupplyInitTester.sol | 8 ++++---- .../Mocks/Tokens/LSP7CappedSupplyTester.sol | 6 +++--- contracts/Mocks/Tokens/LSP7InitTester.sol | 8 ++++---- .../Mocks/Tokens/LSP7MintWhenDeployed.sol | 2 +- contracts/Mocks/Tokens/LSP7Tester.sol | 2 +- .../Mocks/Tokens/LSP8BurnableInitTester.sol | 8 ++++---- contracts/Mocks/Tokens/LSP8BurnableTester.sol | 8 ++++---- .../Tokens/LSP8CappedSupplyInitTester.sol | 10 +++++----- .../Mocks/Tokens/LSP8CappedSupplyTester.sol | 10 +++++----- .../Tokens/LSP8CompatibleERC721Tester.sol | 10 +++++----- .../Tokens/LSP8CompatibleERC721TesterInit.sol | 10 +++++----- .../Mocks/Tokens/LSP8EnumerableInitTester.sol | 8 ++++---- .../Mocks/Tokens/LSP8EnumerableTester.sol | 8 ++++---- contracts/Mocks/Tokens/LSP8InitTester.sol | 8 ++++---- contracts/Mocks/Tokens/LSP8Tester.sol | 8 ++++---- .../LSP7DigitalAsset/presets/LSP7Mintable.md | 6 +++--- .../presets/LSP8CompatibleERC721Mintable.md | 18 ++++++++--------- .../presets/LSP8Mintable.md | 18 ++++++++--------- tests/Benchmark.test.ts | 20 +++++++++---------- ...P1UniversalReceiverDelegateUP.behaviour.ts | 8 ++++---- ...niversalReceiverDelegateVault.behaviour.ts | 8 ++++---- .../Interactions/AllowedFunctions.test.ts | 4 ++-- .../Interactions/AllowedStandards.test.ts | 6 +++--- .../Interactions/ERC725XExecuteBatch.test.ts | 18 +++++++++++------ .../PermissionTransferValue.test.ts | 8 ++++---- .../Interactions/AllowedFunctions.test.ts | 4 ++-- .../Interactions/AllowedStandards.test.ts | 6 +++--- .../Interactions/BatchExecute.test.ts | 18 +++++++++++------ .../PermissionTransferValue.test.ts | 8 ++++---- .../LSP6ControlledToken.test.ts | 2 +- .../Relay/ExecuteRelayCall.test.ts | 2 +- .../LSP7CompatibleERC20.behaviour.ts | 10 ++++++++++ .../LSP7DigitalAsset.behaviour.ts | 3 +++ .../proxy/LSP7CappedSupplyInit.test.ts | 4 ++-- .../proxy/LSP7DigitalAssetInit.test.ts | 12 +++++------ .../proxy/LSP7MintableInit.test.ts | 8 ++++---- .../standard/LSP7CappedSupply.test.ts | 4 ++-- .../standard/LSP7Mintable.test.ts | 2 +- .../LSP8CappedSupply.behaviour.ts | 2 +- .../LSP8CompatibleERC721.behaviour.ts | 17 ++++++++++++++-- .../LSP8Enumerable.behaviour.ts | 2 +- .../LSP8IdentifiableDigitalAsset.behaviour.ts | 11 ++++++---- .../LSP8Mintable.behaviour.ts | 2 +- .../proxy/LSP8BurnableInit.test.ts | 6 +++--- .../proxy/LSP8CappedSupplyInit.test.ts | 6 +++--- .../proxy/LSP8CompatibleERC721Init.test.ts | 14 ++++++------- .../proxy/LSP8EnumerableInit.test.ts | 4 ++-- .../LSP8IdentifiableDigitalAssetInit.test.ts | 4 ++-- .../proxy/LSP8MintableInit.test.ts | 4 ++-- .../standard/LSP8Burnable.test.ts | 6 +++--- .../standard/LSP8CappedSupply.test.ts | 6 +++--- .../standard/LSP8CompatibleERC721.test.ts | 6 +++--- .../standard/LSP8Enumerable.test.ts | 4 ++-- .../LSP8IdentifiableDigitalAsset.test.ts | 10 +++++----- .../standard/LSP8Mintable.test.ts | 4 ++-- .../GasTests/execute/RestrictedController.sol | 4 ++-- .../execute/UnrestrictedController.sol | 4 ++-- 74 files changed, 321 insertions(+), 261 deletions(-) diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol b/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol index aee29ba31..e58f38915 100644 --- a/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +++ b/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol @@ -47,17 +47,18 @@ abstract contract LSP7DigitalAsset is { /** * @notice Sets the token-Metadata - * @param name_ The name of the token - * @param symbol_ The symbol of the token - * @param newOwner_ The owner of the the token-Metadata - * @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token + * @param name_ The name of the token. + * @param symbol_ The symbol of the token. + * @param newOwner_ The owner of the the token-Metadata. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token. */ constructor( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_, lsp4TokenType_) { _isNonDivisible = isNonDivisible_; } diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol b/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol index 19e4bcdd8..80169e687 100644 --- a/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +++ b/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol @@ -46,17 +46,17 @@ abstract contract LSP7DigitalAssetInitAbstract is string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ) internal virtual onlyInitializing { - _isNonDivisible = isNonDivisible_; - LSP4DigitalAssetMetadataInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_ ); + + _isNonDivisible = isNonDivisible_; } // fallback function diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol index 9f15ac366..525584001 100644 --- a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +++ b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol @@ -34,7 +34,7 @@ abstract contract LSP7CompatibleERC20 is IERC20Metadata, LSP7DigitalAsset { string memory symbol_, address newOwner_, uint256 lsp4TokenType_ - ) LSP7DigitalAsset(name_, symbol_, newOwner_, false, lsp4TokenType_) {} + ) LSP7DigitalAsset(name_, symbol_, newOwner_, lsp4TokenType_, false) {} /** * @inheritdoc IERC20Metadata diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol index 11321124d..d2176e60f 100644 --- a/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +++ b/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol @@ -45,8 +45,8 @@ abstract contract LSP7CompatibleERC20InitAbstract is name_, symbol_, newOwner_, - false, - lsp4TokenType_ + lsp4TokenType_, + false ); } diff --git a/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol b/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol index ace26d5f7..397059e8c 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol @@ -21,20 +21,21 @@ contract LSP7Mintable is LSP7DigitalAsset, ILSP7Mintable { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token. */ constructor( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ) LSP7DigitalAsset( name_, symbol_, newOwner_, - isNonDivisible_, - lsp4TokenType_ + lsp4TokenType_, + isNonDivisible_ ) {} diff --git a/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol b/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol index 753082337..0f2dc1f62 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol @@ -24,20 +24,21 @@ contract LSP7MintableInit is LSP7MintableInitAbstract { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token. */ function initialize( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ) external virtual initializer { LSP7MintableInitAbstract._initialize( name_, symbol_, newOwner_, - isNonDivisible_, - lsp4TokenType_ + lsp4TokenType_, + isNonDivisible_ ); } } diff --git a/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol b/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol index 7e2fe43f5..81708365a 100644 --- a/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +++ b/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol @@ -25,20 +25,21 @@ abstract contract LSP7MintableInitAbstract is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token. */ function _initialize( string memory name_, string memory symbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ) internal virtual override onlyInitializing { LSP7DigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - isNonDivisible_, - lsp4TokenType_ + lsp4TokenType_, + isNonDivisible_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol index 911441eb2..2b9d741d5 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol @@ -57,7 +57,7 @@ abstract contract LSP8IdentifiableDigitalAsset is { /** * @notice Deploying a LSP8IdentifiableDigitalAsset with name `name_`, symbol `symbol_`, owned by address `newOwner_` - * with tokenId type `tokenIdType_`. + * with tokenId type `lsp8TokenIdType_`. * * @dev Deploy a `LSP8IdentifiableDigitalAsset` contract and set the tokenId type inside the ERC725Y storage of the contract. * This will also set the token `name_` and `symbol_` under the ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol`. @@ -65,9 +65,9 @@ abstract contract LSP8IdentifiableDigitalAsset is * @param name_ The name of the token * @param symbol_ The symbol of the token * @param newOwner_ The owner of the the token-Metadata - * @param tokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. * * @custom:warning Make sure the tokenId type provided on deployment is correct, as it can only be set once * and cannot be changed in the ERC725Y storage after the contract has been deployed. @@ -76,12 +76,12 @@ abstract contract LSP8IdentifiableDigitalAsset is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_, lsp4TokenType_) { LSP4DigitalAssetMetadata._setData( _LSP8_TOKENID_TYPE_KEY, - abi.encode(tokenIdType_) + abi.encode(lsp8TokenIdType_) ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol index caadbd6c8..ed0e43260 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol @@ -62,9 +62,9 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is * @param name_ The name of the token * @param symbol_ The symbol of the token * @param newOwner_ The owner of the the token-Metadata - * @param tokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. * * @custom:warning Make sure the tokenId type provided on deployment is correct, as it can only be set once * and cannot be changed in the ERC725Y storage after the contract has been initialized. @@ -73,8 +73,8 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) internal virtual onlyInitializing { LSP4DigitalAssetMetadataInitAbstract._initialize( name_, @@ -85,7 +85,7 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is LSP4DigitalAssetMetadataInitAbstract._setData( _LSP8_TOKENID_TYPE_KEY, - abi.encode(tokenIdType_) + abi.encode(lsp8TokenIdType_) ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol index e3fe0d906..cb7bb01c6 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol @@ -65,20 +65,22 @@ abstract contract LSP8CompatibleERC721 is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ constructor( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) {} diff --git a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol index 6c5e5c3bb..ceef8f14e 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol @@ -65,21 +65,23 @@ abstract contract LSP8CompatibleERC721InitAbstract is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ function _initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) internal virtual override onlyInitializing { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol index 3d9423b4e..32c34d705 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol @@ -15,20 +15,22 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ constructor( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP8CompatibleERC721( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) {} diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol index b94628cce..bc9355ee5 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol @@ -27,20 +27,22 @@ contract LSP8CompatibleERC721MintableInit is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ function initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) external virtual initializer { LSP8CompatibleERC721MintableInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol index 92d1c3591..9777aa926 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol @@ -19,15 +19,15 @@ contract LSP8CompatibleERC721MintableInitAbstract is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) internal virtual override onlyInitializing { LSP8CompatibleERC721InitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol index 71016bd81..275a3a229 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol @@ -22,20 +22,22 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ constructor( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) {} diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol index ab2c12fb3..75bea8902 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol @@ -24,20 +24,22 @@ contract LSP8MintableInit is LSP8MintableInitAbstract { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ function initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) external virtual initializer { LSP8MintableInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol index eefcf50a4..5284e265a 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol @@ -23,20 +23,23 @@ abstract contract LSP8MintableInitAbstract is * @param name_ The name of the token. * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). + * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. + * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. */ function _initialize( string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) internal virtual override onlyInitializing { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol b/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol index 10448ca6d..0e9c44e1b 100644 --- a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol +++ b/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol @@ -15,15 +15,15 @@ contract LSP7CappedSupplyInitTester is LSP7CappedSupplyInitAbstract { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenSupplyCap_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 tokenSupplyCap_ ) public virtual initializer { LSP7DigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - true, - lsp4TokenType_ + lsp4TokenType_, + true ); LSP7CappedSupplyInitAbstract._initialize(tokenSupplyCap_); } diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol b/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol index ab445935b..de76f80d2 100644 --- a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol +++ b/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol @@ -13,10 +13,10 @@ contract LSP7CappedSupplyTester is LSP7CappedSupply { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenSupplyCap_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 tokenSupplyCap_ ) - LSP7DigitalAsset(name_, symbol_, newOwner_, true, lsp4TokenType_) + LSP7DigitalAsset(name_, symbol_, newOwner_, lsp4TokenType_, true) LSP7CappedSupply(tokenSupplyCap_) {} diff --git a/contracts/Mocks/Tokens/LSP7InitTester.sol b/contracts/Mocks/Tokens/LSP7InitTester.sol index 4877eb159..731591bd1 100644 --- a/contracts/Mocks/Tokens/LSP7InitTester.sol +++ b/contracts/Mocks/Tokens/LSP7InitTester.sol @@ -18,15 +18,15 @@ contract LSP7InitTester is string memory tokenName_, string memory tokenSymbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ) public initializer { LSP7DigitalAssetInitAbstract._initialize( tokenName_, tokenSymbol_, newOwner_, - isNonDivisible_, - lsp4TokenType_ + lsp4TokenType_, + isNonDivisible_ ); } diff --git a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol b/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol index fd25565a9..f90f5daf8 100644 --- a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol +++ b/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol @@ -9,7 +9,7 @@ contract LSP7MintWhenDeployed is LSP7DigitalAsset { string memory symbol_, address newOwner_, uint256 lsp4TokenType_ - ) LSP7DigitalAsset(name_, symbol_, newOwner_, false, lsp4TokenType_) { + ) LSP7DigitalAsset(name_, symbol_, newOwner_, lsp4TokenType_, false) { _mint(newOwner_, 1_000, true, ""); } } diff --git a/contracts/Mocks/Tokens/LSP7Tester.sol b/contracts/Mocks/Tokens/LSP7Tester.sol index 0dfa40742..76a1a4404 100644 --- a/contracts/Mocks/Tokens/LSP7Tester.sol +++ b/contracts/Mocks/Tokens/LSP7Tester.sol @@ -11,7 +11,7 @@ contract LSP7Tester is LSP7DigitalAsset, LSP7Burnable { string memory symbol_, address newOwner_, uint256 lsp4TokenType_ - ) LSP7DigitalAsset(name_, symbol_, newOwner_, false, lsp4TokenType_) {} + ) LSP7DigitalAsset(name_, symbol_, newOwner_, lsp4TokenType_, false) {} function mint( address to, diff --git a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol b/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol index 79128af6d..b0526f8ea 100644 --- a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol @@ -15,15 +15,15 @@ contract LSP8BurnableInitTester is LSP8BurnableInitAbstract { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } } diff --git a/contracts/Mocks/Tokens/LSP8BurnableTester.sol b/contracts/Mocks/Tokens/LSP8BurnableTester.sol index a8dcf0cd9..e6b0ad3a7 100644 --- a/contracts/Mocks/Tokens/LSP8BurnableTester.sol +++ b/contracts/Mocks/Tokens/LSP8BurnableTester.sol @@ -15,15 +15,15 @@ contract LSP8BurnableTester is LSP8Burnable { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) {} } diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol b/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol index b73503f1f..b59edd2d1 100644 --- a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol @@ -15,16 +15,16 @@ contract LSP8CappedSupplyInitTester is LSP8CappedSupplyInitAbstract { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 tokenSupplyCap_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_, + uint256 tokenSupplyCap_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); LSP8CappedSupplyInitAbstract._initialize(tokenSupplyCap_); } diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol b/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol index c0ad07698..f29e9459b 100644 --- a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol +++ b/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol @@ -15,16 +15,16 @@ contract LSP8CappedSupplyTester is LSP8CappedSupply { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 tokenSupplyCap_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_, + uint256 tokenSupplyCap_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) LSP8CappedSupply(tokenSupplyCap_) {} diff --git a/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol b/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol index 8e400d4c4..611b1b06e 100644 --- a/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol +++ b/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol @@ -17,16 +17,16 @@ contract LSP8CompatibleERC721Tester is LSP8CompatibleERC721 { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - bytes memory tokenURIValue_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_, + bytes memory tokenURIValue_ ) LSP8CompatibleERC721( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) { _setData(_LSP4_METADATA_KEY, tokenURIValue_); diff --git a/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol b/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol index a7e3b65b6..2f65ee39e 100644 --- a/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol +++ b/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol @@ -24,16 +24,16 @@ contract LSP8CompatibleERC721InitTester is LSP8CompatibleERC721InitAbstract { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - bytes memory tokenURIValue_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_, + bytes memory tokenURIValue_ ) public virtual initializer { LSP8CompatibleERC721InitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); _setData(_LSP4_METADATA_KEY, tokenURIValue_); diff --git a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol b/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol index 05e2f7313..99aa816f2 100644 --- a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol @@ -15,15 +15,15 @@ contract LSP8EnumerableInitTester is LSP8EnumerableInitAbstract { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } diff --git a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol b/contracts/Mocks/Tokens/LSP8EnumerableTester.sol index cf46ca5be..a8edcde1b 100644 --- a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol +++ b/contracts/Mocks/Tokens/LSP8EnumerableTester.sol @@ -15,15 +15,15 @@ contract LSP8EnumerableTester is LSP8Enumerable { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) {} diff --git a/contracts/Mocks/Tokens/LSP8InitTester.sol b/contracts/Mocks/Tokens/LSP8InitTester.sol index 633f776f0..5036ea8e4 100644 --- a/contracts/Mocks/Tokens/LSP8InitTester.sol +++ b/contracts/Mocks/Tokens/LSP8InitTester.sol @@ -18,15 +18,15 @@ contract LSP8InitTester is string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) public initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ); } diff --git a/contracts/Mocks/Tokens/LSP8Tester.sol b/contracts/Mocks/Tokens/LSP8Tester.sol index 080752ac6..ae1d18a5b 100644 --- a/contracts/Mocks/Tokens/LSP8Tester.sol +++ b/contracts/Mocks/Tokens/LSP8Tester.sol @@ -15,15 +15,15 @@ contract LSP8Tester is LSP8IdentifiableDigitalAsset, LSP8Burnable { string memory name_, string memory symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, - tokenIdType_, - lsp4TokenType_ + lsp4TokenType_, + lsp8TokenIdType_ ) {} diff --git a/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md b/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md index b3d511af8..c991c7fc7 100644 --- a/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md +++ b/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md @@ -35,8 +35,8 @@ constructor( string name_, string symbol_, address newOwner_, - bool isNonDivisible_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + bool isNonDivisible_ ); ``` @@ -49,8 +49,8 @@ _Deploying a `LSP7Mintable` token contract with: token name = `name_`, token sym | `name_` | `string` | The name of the token. | | `symbol_` | `string` | The symbol of the token. | | `newOwner_` | `address` | The owner of the token contract. | -| `isNonDivisible_` | `bool` | - | | `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| `isNonDivisible_` | `bool` | Specify if the LSP7 token is a fungible or non-fungible token. |
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md index c6992231e..402cbbfe5 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md @@ -35,8 +35,8 @@ constructor( string name_, string symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ); ``` @@ -44,13 +44,13 @@ _Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `n #### Parameters -| Name | Type | Description | -| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `tokenIdType_` | `uint256` | - | -| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| Name | Type | Description | +| ------------------ | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| `lsp8TokenIdType_` | `uint256` | The type of tokenIds (= NFTs) that this contract will create. Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. |
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md index 958dd5ebe..c669f007b 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md @@ -35,8 +35,8 @@ constructor( string name_, string symbol_, address newOwner_, - uint256 tokenIdType_, - uint256 lsp4TokenType_ + uint256 lsp4TokenType_, + uint256 lsp8TokenIdType_ ); ``` @@ -44,13 +44,13 @@ _Deploying a `LSP8Mintable` token contract with: token name = `name_`, token sym #### Parameters -| Name | Type | Description | -| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `tokenIdType_` | `uint256` | - | -| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| Name | Type | Description | +| ------------------ | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| `lsp8TokenIdType_` | `uint256` | The type of tokenIds (= NFTs) that this contract will create. Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. |
diff --git a/tests/Benchmark.test.ts b/tests/Benchmark.test.ts index 441a173f7..52e99959c 100644 --- a/tests/Benchmark.test.ts +++ b/tests/Benchmark.test.ts @@ -129,8 +129,8 @@ describe('⛽📊 Gas Benchmark', () => { 'Token', 'MTKN', accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); const lsp7DeployTransaction = lsp7Mintable.deployTransaction; @@ -143,8 +143,8 @@ describe('⛽📊 Gas Benchmark', () => { 'My NFT', 'MNFT', accounts[0].address, - LSP8_TOKEN_ID_TYPES.NUMBER, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.NUMBER, ); const lsp8DeployTransaction = lsp8Mintable.deployTransaction; @@ -554,8 +554,8 @@ describe('⛽📊 Gas Benchmark', () => { 'Token', 'MTKN', context.mainController.address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); // deploy a LSP8 token @@ -563,8 +563,8 @@ describe('⛽📊 Gas Benchmark', () => { 'My NFT', 'MNFT', context.mainController.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); universalProfile1 = await new UniversalProfile__factory(context.mainController).deploy( @@ -708,8 +708,8 @@ describe('⛽📊 Gas Benchmark', () => { 'MetaCoin', 'MTC', context.mainController.address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); // deploy a LSP8 NFT @@ -717,8 +717,8 @@ describe('⛽📊 Gas Benchmark', () => { 'MetaNFT', 'MNF', context.mainController.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); // mint some tokens to the UP @@ -897,16 +897,16 @@ describe('⛽📊 Gas Benchmark', () => { 'MetaCoin', 'MTC', context.mainController.address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); lsp7LyxDai = await new LSP7Mintable__factory(context.mainController).deploy( 'LyxDai', 'LDAI', context.mainController.address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); [lsp7MetaCoin, lsp7LyxDai].forEach(async (token) => { @@ -920,16 +920,16 @@ describe('⛽📊 Gas Benchmark', () => { 'MetaNFT', 'MNF', context.mainController.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); lsp8LyxPunks = await new LSP8Mintable__factory(context.mainController).deploy( 'LyxPunks', 'LPK', context.mainController.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); [ diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts index be9afd648..f37dcbe96 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts @@ -1788,24 +1788,24 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TokenAlpha', 'TA', context.accounts.random.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); lsp8TokenB = await new LSP8Tester__factory(context.accounts.random).deploy( 'TokenBeta', 'TB', context.accounts.random.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); lsp8TokenC = await new LSP8Tester__factory(context.accounts.random).deploy( 'TokenGamma', 'TA', context.accounts.random.address, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.UNIQUE_ID, ); }); @@ -3129,8 +3129,8 @@ export const shouldBehaveLikeLSP1Delegate = ( 'MyToken', 'MTK', context.universalProfile1.address, - LSP8_TOKEN_ID_TYPES.NUMBER, LSP4_TOKEN_TYPES.NFT, + LSP8_TOKEN_ID_TYPES.NUMBER, ); // Mint token for UP1 await LSP8.mint(context.universalProfile1.address, '0x' + '0'.repeat(64), true, '0x'); diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts index 21dc57bbe..bafca29bd 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts @@ -1174,24 +1174,24 @@ export const shouldBehaveLikeLSP1Delegate = (buildContext: () => Promise Promise Promise Promise { // step 1 - deploy token contract const lsp7ConstructorArguments = abiCoder.encode( - ['string', 'string', 'address', 'bool'], - ['My UP LSP7 Token', 'UPLSP7', context.universalProfile.address, false], + ['string', 'string', 'address', 'uint256', 'bool'], + [ + 'My UP LSP7 Token', + 'UPLSP7', + context.universalProfile.address, + LSP4_TOKEN_TYPES.TOKEN, + false, + ], ); // we simulate deploying the token contract to know the future address of the LSP7 Token contract, diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts b/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts index b45229381..5ddbef075 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts +++ b/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts @@ -600,8 +600,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'LSP7 Token', 'LSP7', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); targetContract = await new TargetPayableContract__factory(context.accounts[0]).deploy(); @@ -757,8 +757,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'New LSP7 Token', 'LSP7TKN', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); const lsp7TransferPayload = newLSP7Token.interface.encodeFunctionData('transfer', [ @@ -997,8 +997,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'LSP7 Token', 'LSP7', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); // give some tokens to the UP @@ -1160,8 +1160,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'LSP7 Token', 'LSP7', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); // give some tokens to the UP diff --git a/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts b/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts index 157285db6..3d34f37cf 100644 --- a/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts +++ b/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts @@ -335,16 +335,16 @@ export const shouldBehaveLikeAllowedFunctions = (buildContext: () => Promise Promise { // step 1 - deploy token contract const lsp7ConstructorArguments = abiCoder.encode( - ['string', 'string', 'address', 'bool'], - ['My UP LSP7 Token', 'UPLSP7', context.universalProfile.address, false], + ['string', 'string', 'address', 'uint256', 'bool'], + [ + 'My UP LSP7 Token', + 'UPLSP7', + context.universalProfile.address, + LSP4_TOKEN_TYPES.TOKEN, + false, + ], ); const lsp7DeploymentPayload = context.universalProfile.interface.encodeFunctionData( diff --git a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts b/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts index 479a6a5f3..1d3626f4d 100644 --- a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts +++ b/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts @@ -883,8 +883,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'LSP7 Token', 'LSP7', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); targetContract = await new TargetPayableContract__factory(context.accounts[0]).deploy(); @@ -1066,8 +1066,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'New LSP7 Token', 'LSP7TKN', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); const lsp7TransferPayload = newLSP7Token.interface.encodeFunctionData('transfer', [ @@ -1335,8 +1335,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'LSP7 Token', 'LSP7', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); // give some tokens to the UP @@ -1516,8 +1516,8 @@ export const shouldBehaveLikePermissionTransferValue = ( 'LSP7 Token', 'LSP7', context.accounts[0].address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); // give some tokens to the UP diff --git a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts b/tests/LSP6KeyManager/LSP6ControlledToken.test.ts index 86758ebe0..ccd5e6eeb 100644 --- a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts +++ b/tests/LSP6KeyManager/LSP6ControlledToken.test.ts @@ -36,8 +36,8 @@ const buildContext = async () => { 'name', 'symbol', accounts[0].address, - true, LSP4_TOKEN_TYPES.TOKEN, + true, ); const keyManager = await new LSP6KeyManager__factory(accounts[0]).deploy(lsp7.address); diff --git a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts index 38a36bb75..34d7cc193 100644 --- a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts +++ b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts @@ -1379,8 +1379,8 @@ export const shouldBehaveLikeExecuteRelayCall = ( 'My LSP7 Token', 'LSP7', context.universalProfile.address, - false, LSP4_TOKEN_TYPES.TOKEN, + false, ); const permissionKeys = [ diff --git a/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts b/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts index 56fe715f5..03ca8905b 100644 --- a/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts @@ -18,6 +18,7 @@ import { UniversalReceiverDelegateRevert__factory, } from '../../types'; import { ERC725YDataKeys } from '../../constants'; +import { abiCoder } from '../utils/helpers'; type LSP7CompatibleERC20TestAccounts = { owner: SignerWithAddress; @@ -1287,6 +1288,15 @@ export const shouldInitializeLikeLSP7CompatibleERC20 = ( .to.emit(context.lsp7CompatibleERC20, 'DataChanged') .withArgs(symbolKey, expectedSymbolValue); expect(await context.lsp7CompatibleERC20.getData(symbolKey)).to.equal(expectedSymbolValue); + + const tokenTypeKey = ERC725YDataKeys.LSP4['LSP4TokenType']; + const expectedTokenTypeValue = abiCoder.encode( + ['uint256'], + [context.deployParams.lsp4TokenType], + ); + expect(await context.lsp7CompatibleERC20.getData(tokenTypeKey)).to.equal( + expectedTokenTypeValue, + ); }); describe('when using the functions from IERC20Metadata', () => { diff --git a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts b/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts index 6976b5c5a..69b4a762c 100644 --- a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts @@ -2261,6 +2261,9 @@ export const shouldInitializeLikeLSP7 = ( ['uint256'], [context.deployParams.lsp4TokenType], ); + await expect(context.initializeTransaction) + .to.emit(context.lsp7, 'DataChanged') + .withArgs(tokenTypeKey, expectedTokenTypeValue); expect(await context.lsp7.getData(tokenTypeKey)).to.equal(expectedTokenTypeValue); }); }); diff --git a/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts index 8c7533931..d4209cef6 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts @@ -20,8 +20,8 @@ describe('LSP7CappedSupplyInit with proxy', () => { name: 'LSP7 capped supply - deployed with proxy', symbol: 'CAP', newOwner: accounts.owner.address, - tokenSupplyCap: ethers.BigNumber.from('2'), lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, + tokenSupplyCap: ethers.BigNumber.from('2'), }; const lsp7CappedSupplyInit = await new LSP7CappedSupplyInitTester__factory( accounts.owner, @@ -37,8 +37,8 @@ describe('LSP7CappedSupplyInit with proxy', () => { context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenSupplyCap, context.deployParams.lsp4TokenType, + context.deployParams.tokenSupplyCap, ); }; diff --git a/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts index 3a87705f1..fbf2b4107 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts @@ -59,12 +59,12 @@ describe('LSP7DigitalAssetInit with proxy', () => { }; const initializeProxy = async (context: LSP7TestContext) => { - return context.lsp7['initialize(string,string,address,bool,uint256)']( + return context.lsp7['initialize(string,string,address,uint256,bool)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - false, context.deployParams.lsp4TokenType, + false, ); }; @@ -77,12 +77,12 @@ describe('LSP7DigitalAssetInit with proxy', () => { it('should revert when initializing with address(0) as owner', async () => { await expect( - context.lsp7['initialize(string,string,address,bool,uint256)']( + context.lsp7['initialize(string,string,address,uint256,bool)']( context.deployParams.name, context.deployParams.symbol, ethers.constants.AddressZero, - false, 12345, + false, ), ).to.be.revertedWithCustomError(context.lsp7, 'OwnableCannotSetZeroAddressAsOwner'); }); @@ -113,12 +113,12 @@ describe('LSP7DigitalAssetInit with proxy', () => { shouldBehaveLikeLSP4DigitalAssetMetadata(async () => { const lsp4Context = await buildLSP4DigitalAssetMetadataTestContext(); - await lsp4Context.contract['initialize(string,string,address,bool,uint256)']( + await lsp4Context.contract['initialize(string,string,address,uint256,bool)']( 'LSP7 - deployed with proxy', 'TKN', lsp4Context.deployParams.owner.address, - false, lsp4Context.deployParams.lsp4TokenType, + false, ); return lsp4Context; diff --git a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts index 8133684d0..0ee2d4782 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts @@ -36,12 +36,12 @@ describe('LSP7MintableInit with proxy', () => { }; const initializeProxy = async (context: LSP7MintableTestContext) => { - return context.lsp7Mintable['initialize(string,string,address,bool,uint256)']( + return context.lsp7Mintable['initialize(string,string,address,uint256,bool)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.isNFT, context.deployParams.lsp4TokenType, + context.deployParams.isNFT, ); }; @@ -67,12 +67,12 @@ describe('LSP7MintableInit with proxy', () => { const randomCaller = accounts[1]; await expect( - lsp7MintableInit['initialize(string,string,address,bool,uint256)']( + lsp7MintableInit['initialize(string,string,address,uint256,bool)']( 'XXXXXXXXXXX', 'XXX', randomCaller.address, - false, 12345, + false, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); diff --git a/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts b/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts index 353c572bb..1c9e546b6 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts @@ -17,16 +17,16 @@ describe('LSP7CappedSupply with constructor', () => { name: 'LSP7 capped supply - deployed with constructor', symbol: 'CAP', newOwner: accounts.owner.address, - tokenSupplyCap: ethers.BigNumber.from('2'), lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, + tokenSupplyCap: ethers.BigNumber.from('2'), }; const lsp7CappedSupply = await new LSP7CappedSupplyTester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenSupplyCap, deployParams.lsp4TokenType, + deployParams.tokenSupplyCap, ); return { accounts, lsp7CappedSupply, deployParams }; diff --git a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts b/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts index 1dd2ccf62..c9afcaf9d 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts @@ -25,8 +25,8 @@ describe('LSP7Mintable with constructor', () => { deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.isNFT, deployParams.lsp4TokenType, + deployParams.isNFT, ); return { accounts, lsp7Mintable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts index e96a4ea32..8cbeecb82 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts @@ -23,7 +23,7 @@ export type LSP8CappedSupplyTestContext = { symbol: string; newOwner: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; tokenSupplyCap: BigNumber; }; }; diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts index c47bcf774..995666073 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8CompatibleERC721.behaviour.ts @@ -28,6 +28,7 @@ import { ERC725YDataKeys, INTERFACE_IDS, SupportedStandards } from '../../consta import type { BytesLike } from 'ethers'; import type { TransactionResponse } from '@ethersproject/abstract-provider'; +import { abiCoder } from '../utils/helpers'; export type LSP8CompatibleERC721TestAccounts = { owner: SignerWithAddress; @@ -46,9 +47,9 @@ type LSP8CompatibleERC721DeployParams = { name: string; symbol: string; newOwner: string; - lsp4MetadataValue: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; + lsp4MetadataValue: string; }; export type LSP8CompatibleERC721TestContext = { @@ -1291,6 +1292,18 @@ export const shouldInitializeLikeLSP8CompatibleERC721 = ( .to.emit(context.lsp8CompatibleERC721, 'DataChanged') .withArgs(symbolKey, expectedSymbolValue); expect(await context.lsp8CompatibleERC721.getData(symbolKey)).to.equal(expectedSymbolValue); + + const tokenTypeKey = ERC725YDataKeys.LSP4['LSP4TokenType']; + const expectedTokenTypeValue = abiCoder.encode( + ['uint256'], + [context.deployParams.lsp4TokenType], + ); + await expect(context.initializeTransaction) + .to.emit(context.lsp8CompatibleERC721, 'DataChanged') + .withArgs(tokenTypeKey, expectedTokenTypeValue); + expect(await context.lsp8CompatibleERC721.getData(tokenTypeKey)).to.equal( + expectedTokenTypeValue, + ); }); describe('when using the functions from IERC721Metadata', () => { diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts index 2c5066783..623c8098c 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts @@ -19,7 +19,7 @@ export type LSP8EnumerableDeployParams = { symbol: string; newOwner: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; }; export type LSP8EnumerableTestContext = { diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts index 1ac94fdf4..e504a73bd 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts @@ -43,7 +43,7 @@ export type LSP8DeployParams = { symbol: string; newOwner: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; }; export type LSP8TestContext = { @@ -1857,17 +1857,20 @@ export const shouldInitializeLikeLSP8 = ( .withArgs(symbolKey, expectedSymbolValue); expect(await context.lsp8.getData(symbolKey)).to.equal(expectedSymbolValue); - const tokenTypeKey = ERC725YDataKeys.LSP4['LSP4TokenType']; + const lsp4TokenTypeKey = ERC725YDataKeys.LSP4['LSP4TokenType']; const expectedTokenTypeValue = abiCoder.encode( ['uint256'], [context.deployParams.lsp4TokenType], ); - expect(await context.lsp8.getData(tokenTypeKey)).to.equal(expectedTokenTypeValue); + await expect(context.initializeTransaction) + .to.emit(context.lsp8, 'DataChanged') + .withArgs(lsp4TokenTypeKey, expectedTokenTypeValue); + expect(await context.lsp8.getData(lsp4TokenTypeKey)).to.equal(expectedTokenTypeValue); const lsp8TokenIdTypeDataKey = ERC725YDataKeys.LSP8['LSP8TokenIdType']; const expectedTokenIdDataValue = abiCoder.encode( ['uint256'], - [context.deployParams.tokenIdType], + [context.deployParams.lsp8TokenIdType], ); await expect(context.initializeTransaction) .to.emit(context.lsp8, 'DataChanged') diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts index 59c687015..c43537782 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts @@ -29,7 +29,7 @@ export type LSP8MintableDeployParams = { symbol: string; newOwner: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; }; export type LSP8MintableTestContext = { diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts index 6d0980361..9d9d99c88 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts @@ -17,7 +17,7 @@ type LSP8BurnableInitTestContext = { symbol: string; newOwner: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; }; }; @@ -29,7 +29,7 @@ describe('LSP8BurnableInit with proxy', () => { symbol: 'BRN', newOwner: accounts[0].address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const lsp8BurnableImplementation = await new LSP8BurnableInitTester__factory( @@ -46,8 +46,8 @@ describe('LSP8BurnableInit with proxy', () => { context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenIdType, context.deployParams.lsp4TokenType, + context.deployParams.lsp8TokenIdType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts index 8463c9e0e..60a959160 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts @@ -20,7 +20,7 @@ describe('LSP8CappedSupplyInit with proxy', () => { symbol: 'CAP', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, tokenSupplyCap: ethers.BigNumber.from('2'), }; const lsp8CappedSupplyInit = await new LSP8CappedSupplyInitTester__factory( @@ -37,9 +37,9 @@ describe('LSP8CappedSupplyInit with proxy', () => { context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenIdType, - context.deployParams.tokenSupplyCap, context.deployParams.lsp4TokenType, + context.deployParams.lsp8TokenIdType, + context.deployParams.tokenSupplyCap, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts index be586e4e5..55237103d 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts @@ -33,7 +33,7 @@ describe('LSP8CompatibleERC721Init with proxy', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, lsp4MetadataValue, }; @@ -50,13 +50,13 @@ describe('LSP8CompatibleERC721Init with proxy', () => { }; const initializeProxy = async (context: LSP8CompatibleERC721TestContext) => { - return context.lsp8CompatibleERC721['initialize(string,string,address,uint256,bytes,uint256)']( + return context.lsp8CompatibleERC721['initialize(string,string,address,uint256,uint256,bytes)']( context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenIdType, - context.deployParams.lsp4MetadataValue, context.deployParams.lsp4TokenType, + context.deployParams.lsp8TokenIdType, + context.deployParams.lsp4MetadataValue, ); }; @@ -74,9 +74,9 @@ describe('LSP8CompatibleERC721Init with proxy', () => { 'XXXXXXXXXXX', 'XXX', randomCaller.address, - 0, - '0x', 12345, + 6789, + '0x', ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); @@ -95,8 +95,8 @@ describe('LSP8CompatibleERC721Init with proxy', () => { 'XXXXXXXXXXX', 'XXX', randomCaller.address, - 0, 12345, + 6789, ), ).to.be.revertedWith('Initializable: contract is already initialized'); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts index c03240fa7..144374655 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts @@ -19,7 +19,7 @@ describe('LSP8EnumerableInit with proxy', () => { symbol: 'LSP8 NMRBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const LSP8EnumerableInit: LSP8EnumerableInitTester = @@ -36,8 +36,8 @@ describe('LSP8EnumerableInit with proxy', () => { context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenIdType, context.deployParams.lsp4TokenType, + context.deployParams.lsp8TokenIdType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts index 79ee91081..bb2362d2c 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts @@ -26,7 +26,7 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: nftType, + lsp8TokenIdType: nftType, }; const lsp8TesterInit = await new LSP8InitTester__factory(accounts.owner).deploy(); @@ -58,8 +58,8 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenIdType, context.deployParams.lsp4TokenType, + context.deployParams.lsp8TokenIdType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts index 4ef49929a..a51cd4f8b 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts @@ -20,7 +20,7 @@ describe('LSP8MintableInit with proxy', () => { symbol: 'MNTBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const LSP8MintableInit: LSP8MintableInit = await new LSP8MintableInit__factory( @@ -38,8 +38,8 @@ describe('LSP8MintableInit with proxy', () => { context.deployParams.name, context.deployParams.symbol, context.deployParams.newOwner, - context.deployParams.tokenIdType, context.deployParams.lsp4TokenType, + context.deployParams.lsp8TokenIdType, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts index 05d691467..d423d2961 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts @@ -14,7 +14,7 @@ type LSP8BurnableTestContext = { symbol: string; newOwner: string; lsp4TokenType: number; - tokenIdType: number; + lsp8TokenIdType: number; }; }; @@ -26,15 +26,15 @@ describe('LSP8Burnable with constructor', () => { symbol: 'BRN', newOwner: accounts[0].address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const lsp8Burnable = await new LSP8BurnableTester__factory(accounts[0]).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenIdType, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, ); return { accounts, lsp8Burnable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts index c6c332724..ddb5bcd45 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts @@ -18,16 +18,16 @@ describe('LSP8CappedSupply with constructor', () => { symbol: 'CAP', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, tokenSupplyCap: ethers.BigNumber.from('2'), }; const lsp8CappedSupply = await new LSP8CappedSupplyTester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenIdType, - deployParams.tokenSupplyCap, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, + deployParams.tokenSupplyCap, ); return { accounts, lsp8CappedSupply, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts index 50d3a59d5..25e8891df 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts @@ -27,7 +27,7 @@ describe('LSP8CompatibleERC721 with constructor', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, lsp4MetadataValue, }; @@ -37,9 +37,9 @@ describe('LSP8CompatibleERC721 with constructor', () => { deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenIdType, - deployParams.lsp4MetadataValue, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, + deployParams.lsp4MetadataValue, ); return { accounts, lsp8CompatibleERC721, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts index 7310947d0..1e290c049 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts @@ -17,7 +17,7 @@ describe('LSP8Enumerable with constructor', () => { symbol: 'LSP8 NMRBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const lsp8Enumerable: LSP8EnumerableTester = await new LSP8EnumerableTester__factory( @@ -26,8 +26,8 @@ describe('LSP8Enumerable with constructor', () => { deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenIdType, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, ); return { accounts, lsp8Enumerable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts index 0fb923317..86016cefc 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts @@ -29,14 +29,14 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: nftType, + lsp8TokenIdType: nftType, }; const lsp8 = await new LSP8Tester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenIdType, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, ); return { accounts, lsp8, deployParams }; @@ -67,14 +67,14 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { symbol: 'NFT', owner: accounts[0], lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const contract = await new LSP8Tester__factory(accounts[0]).deploy( deployParams.name, deployParams.symbol, deployParams.owner.address, - deployParams.tokenIdType, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, ); return { accounts, contract, deployParams }; @@ -98,8 +98,8 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { deployParams.name, deployParams.symbol, ethers.constants.AddressZero, - LSP8_TOKEN_ID_TYPES.NUMBER, deployParams.lsp4TokenType, + LSP8_TOKEN_ID_TYPES.NUMBER, ), ).to.be.revertedWithCustomError(contractToDeploy, 'OwnableCannotSetZeroAddressAsOwner'); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts index 3c50646fc..136748419 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts @@ -17,15 +17,15 @@ describe('LSP8Mintable with constructor', () => { symbol: 'LSP8 MNTBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - tokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, }; const lsp8Mintable: LSP8Mintable = await new LSP8Mintable__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - deployParams.tokenIdType, deployParams.lsp4TokenType, + deployParams.lsp8TokenIdType, ); return { accounts, lsp8Mintable, deployParams }; diff --git a/tests/foundry/GasTests/execute/RestrictedController.sol b/tests/foundry/GasTests/execute/RestrictedController.sol index d6a7497b0..0f1f6b7bf 100644 --- a/tests/foundry/GasTests/execute/RestrictedController.sol +++ b/tests/foundry/GasTests/execute/RestrictedController.sol @@ -446,8 +446,8 @@ contract ExecuteRestrictedController is UniversalProfileTestsHelper { "TestLSP8", "TSTLSP8", digitalAssetsOwner, - _LSP8_TOKENID_TYPE_NUMBER, - _LSP4_TOKEN_TYPE_NFT + _LSP4_TOKEN_TYPE_NFT, + _LSP8_TOKENID_TYPE_NUMBER ); bytes32 tokenID = bytes32(uint256(1)); diff --git a/tests/foundry/GasTests/execute/UnrestrictedController.sol b/tests/foundry/GasTests/execute/UnrestrictedController.sol index f2fdcbc19..892599d1f 100644 --- a/tests/foundry/GasTests/execute/UnrestrictedController.sol +++ b/tests/foundry/GasTests/execute/UnrestrictedController.sol @@ -268,8 +268,8 @@ contract ExecuteUnrestrictedController is UniversalProfileTestsHelper { "TestLSP8", "TSTLSP8", digitalAssetsOwner, - _LSP8_TOKENID_TYPE_NUMBER, - _LSP4_TOKEN_TYPE_NFT + _LSP4_TOKEN_TYPE_NFT, + _LSP8_TOKENID_TYPE_NUMBER ); bytes32 tokenID = bytes32(uint256(1)); From 8640cb2f511fdea03e5bea390bd3f5ed859807a3 Mon Sep 17 00:00:00 2001 From: YamenMerhi Date: Wed, 29 Nov 2023 13:03:17 +0200 Subject: [PATCH 09/12] refactor: rename LSP8TokenIdType to LSP8TokenIdSchema --- README.md | 2 +- constants.ts | 20 ++++++++----- .../LSP8Constants.sol | 25 +++++++++------- .../LSP8Errors.sol | 6 ++-- .../LSP8IdentifiableDigitalAsset.sol | 25 ++++++++-------- ...P8IdentifiableDigitalAssetInitAbstract.sol | 23 +++++++------- .../extensions/LSP8CompatibleERC721.sol | 7 ++--- .../LSP8CompatibleERC721InitAbstract.sol | 7 ++--- .../presets/LSP8CompatibleERC721Mintable.sol | 7 ++--- .../LSP8CompatibleERC721MintableInit.sol | 7 ++--- ...P8CompatibleERC721MintableInitAbstract.sol | 4 +-- .../presets/LSP8Mintable.sol | 7 ++--- .../presets/LSP8MintableInit.sol | 7 ++--- .../presets/LSP8MintableInitAbstract.sol | 7 ++--- .../Mocks/Tokens/LSP8BurnableInitTester.sol | 4 +-- contracts/Mocks/Tokens/LSP8BurnableTester.sol | 4 +-- .../Tokens/LSP8CappedSupplyInitTester.sol | 4 +-- .../Mocks/Tokens/LSP8CappedSupplyTester.sol | 4 +-- .../Tokens/LSP8CompatibleERC721Tester.sol | 4 +-- .../Tokens/LSP8CompatibleERC721TesterInit.sol | 4 +-- .../Mocks/Tokens/LSP8EnumerableInitTester.sol | 4 +-- .../Mocks/Tokens/LSP8EnumerableTester.sol | 4 +-- contracts/Mocks/Tokens/LSP8InitTester.sol | 4 +-- contracts/Mocks/Tokens/LSP8Tester.sol | 4 +-- .../LSP8IdentifiableDigitalAsset.md | 14 ++++----- .../extensions/LSP8Burnable.md | 14 ++++----- .../extensions/LSP8CappedSupply.md | 14 ++++----- .../extensions/LSP8CompatibleERC721.md | 14 ++++----- .../extensions/LSP8Enumerable.md | 14 ++++----- .../presets/LSP8CompatibleERC721Mintable.md | 30 +++++++++---------- .../presets/LSP8Mintable.md | 30 +++++++++---------- tests/Benchmark.test.ts | 12 ++++---- ...P1UniversalReceiverDelegateUP.behaviour.ts | 10 +++---- ...niversalReceiverDelegateVault.behaviour.ts | 10 +++---- .../Interactions/AllowedFunctions.test.ts | 4 +-- .../Interactions/AllowedFunctions.test.ts | 4 +-- .../LSP8CappedSupply.behaviour.ts | 2 +- .../LSP8CompatibleERC721.behaviour.ts | 14 ++++----- .../LSP8Enumerable.behaviour.ts | 2 +- .../LSP8IdentifiableDigitalAsset.behaviour.ts | 24 ++++++++------- .../LSP8Mintable.behaviour.ts | 2 +- .../proxy/LSP8BurnableInit.test.ts | 8 ++--- .../proxy/LSP8CappedSupplyInit.test.ts | 6 ++-- .../proxy/LSP8CompatibleERC721Init.test.ts | 6 ++-- .../proxy/LSP8EnumerableInit.test.ts | 6 ++-- .../LSP8IdentifiableDigitalAssetInit.test.ts | 4 +-- .../proxy/LSP8MintableInit.test.ts | 8 ++--- .../standard/LSP8Burnable.test.ts | 8 ++--- .../standard/LSP8CappedSupply.test.ts | 6 ++-- .../standard/LSP8CompatibleERC721.test.ts | 6 ++-- .../standard/LSP8Enumerable.test.ts | 6 ++-- .../LSP8IdentifiableDigitalAsset.test.ts | 14 ++++----- .../standard/LSP8Mintable.test.ts | 6 ++-- 53 files changed, 246 insertions(+), 246 deletions(-) diff --git a/README.md b/README.md index 42c6fd102..501108f69 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ import { ERC725YDataKeys, PERMISSIONS, ALL_PERMISSIONS, - LSP8_TOKEN_ID_TYPES, + LSP8_TOKEN_ID_SCHEMA, LSP25_VERSION, ErrorSelectors, EventSigHashes, diff --git a/constants.ts b/constants.ts index b5cc13101..3a54b83f9 100644 --- a/constants.ts +++ b/constants.ts @@ -236,8 +236,7 @@ export const ERC725YDataKeys = { 'AddressPermissions:AllowedCalls': '0x4b80742de2bf393a64c70000', }, LSP8: { - LSP8TokenIdType: '0x715f248956de7ce65e94d9d836bfead479f7e70d69b718d47bfe7b00e05b4fe4', - LSP8MetadataTokenURI: '0x1339e76a390b7b9ec9010000', + LSP8TokenIdSchema: '0x341bc44e55234544c70af9d37b2cb8cc7ba74685b58526221de2cc977f469924', LSP8TokenMetadataBaseURI: '0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843', LSP8ReferenceContract: '0x708e7b881795f2e6b6c2752108c177ec89248458de3bf69d0d43480b3e5034e6', }, @@ -410,15 +409,20 @@ export const LSP4_TOKEN_TYPES = { // ---------- /** - * @dev list of LSP8 Token ID types that can be used to create different types of NFTs and represent each NFT identifiers differently. - * @see for details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtype + * @dev list of LSP8 Token ID Schemas that can be used to create different types of NFTs and represent each NFT identifiers differently. + * @see for details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschema */ -export const LSP8_TOKEN_ID_TYPES = { +export const LSP8_TOKEN_ID_SCHEMA = { NUMBER: 0, STRING: 1, - UNIQUE_ID: 2, - HASH: 3, - ADDRESS: 4, + ADDRESS: 2, + UNIQUE_ID: 3, + HASH: 4, + MIXED_DEFAULT_NUMBER: 100, + MIXED_DEFAULT_STRING: 101, + MIXED_DEFAULT_ADDRESS: 102, + MIXED_DEFAULT_UNIQUE_ID: 103, + MIXED_DEFAULT_HASH: 104, }; // LSP25 diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol index 5c068005d..4c642a94a 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol @@ -6,11 +6,8 @@ bytes4 constant _INTERFACEID_LSP8 = 0x30dc5278; // --- ERC725Y Data Keys -// keccak256('LSP8TokenIdType') -bytes32 constant _LSP8_TOKENID_TYPE_KEY = 0x715f248956de7ce65e94d9d836bfead479f7e70d69b718d47bfe7b00e05b4fe4; - -// bytes10(keccak256('LSP8MetadataTokenURI')) + bytes2(0) -bytes12 constant _LSP8_METADATA_TOKEN_URI_PREFIX = 0x1339e76a390b7b9ec9010000; +// keccak256('LSP8TokenIdSchema') +bytes32 constant _LSP8_TOKENID_SCHEMA_KEY = 0x341bc44e55234544c70af9d37b2cb8cc7ba74685b58526221de2cc977f469924; // keccak256('LSP8TokenMetadataBaseURI') bytes32 constant _LSP8_TOKEN_METADATA_BASE_URI = 0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843; @@ -29,10 +26,16 @@ bytes32 constant _TYPEID_LSP8_TOKENSRECIPIENT = 0x0b084a55ebf70fd3c06fd755269dac // keccak256('LSP8Tokens_OperatorNotification') bytes32 constant _TYPEID_LSP8_TOKENOPERATOR = 0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970; -// --- Types of token IDs +// --- Token IDs Schema + +uint256 constant _LSP8_TOKENID_SCHEMA_NUMBER = 0; +uint256 constant _LSP8_TOKENID_SCHEMA_STRING = 1; +uint256 constant _LSP8_TOKENID_SCHEMA_ADDRESS = 2; +uint256 constant _LSP8_TOKENID_SCHEMA_UNIQUE_ID = 3; +uint256 constant _LSP8_TOKENID_SCHEMA_HASH = 4; -uint256 constant _LSP8_TOKENID_TYPE_NUMBER = 0; -uint256 constant _LSP8_TOKENID_TYPE_STRING = 1; -uint256 constant _LSP8_TOKENID_TYPE_UNIQUE_ID = 2; -uint256 constant _LSP8_TOKENID_TYPE_HASH = 3; -uint256 constant _LSP8_TOKENID_TYPE_ADDRESS = 4; +uint256 constant _LSP8_TOKENID_SCHEMA_MIXED_DEFAULT_NUMBER = 100; +uint256 constant _LSP8_TOKENID_SCHEMA_MIXED_DEFAULT_STRING = 101; +uint256 constant _LSP8_TOKENID_SCHEMA_MIXED_DEFAULT_ADDRESS = 102; +uint256 constant _LSP8_TOKENID_SCHEMA_MIXED_DEFAULT_UNIQUE_ID = 103; +uint256 constant _LSP8_TOKENID_SCHEMA_MIXED_DEFAULT_HASH = 104; diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol index 3a37b8ca3..06c526426 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol @@ -82,8 +82,8 @@ error LSP8TokenOwnerCannotBeOperator(); error LSP8TokenContractCannotHoldValue(); /** - * @dev Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. - * The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. + * @dev Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. + * The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. * It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. */ -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol index 2b9d741d5..77833fa4f 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol @@ -19,12 +19,12 @@ import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol"; import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol"; // constants -import {_INTERFACEID_LSP8, _LSP8_TOKENID_TYPE_KEY} from "./LSP8Constants.sol"; +import {_INTERFACEID_LSP8, _LSP8_TOKENID_SCHEMA_KEY} from "./LSP8Constants.sol"; // errors import { LSP8TokenContractCannotHoldValue, - LSP8TokenIdTypeNotEditable + LSP8TokenIdSchemaNotEditable } from "./LSP8Errors.sol"; import { @@ -57,19 +57,18 @@ abstract contract LSP8IdentifiableDigitalAsset is { /** * @notice Deploying a LSP8IdentifiableDigitalAsset with name `name_`, symbol `symbol_`, owned by address `newOwner_` - * with tokenId type `lsp8TokenIdType_`. + * with tokenId schema `lsp8TokenIdSchema_`. * - * @dev Deploy a `LSP8IdentifiableDigitalAsset` contract and set the tokenId type inside the ERC725Y storage of the contract. + * @dev Deploy a `LSP8IdentifiableDigitalAsset` contract and set the tokenId schema inside the ERC725Y storage of the contract. * This will also set the token `name_` and `symbol_` under the ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol`. * * @param name_ The name of the token * @param symbol_ The symbol of the token * @param newOwner_ The owner of the the token-Metadata * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. * - * @custom:warning Make sure the tokenId type provided on deployment is correct, as it can only be set once + * @custom:warning Make sure the tokenId schema provided on deployment is correct, as it can only be set once * and cannot be changed in the ERC725Y storage after the contract has been deployed. */ constructor( @@ -77,11 +76,11 @@ abstract contract LSP8IdentifiableDigitalAsset is string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP4DigitalAssetMetadata(name_, symbol_, newOwner_, lsp4TokenType_) { LSP4DigitalAssetMetadata._setData( - _LSP8_TOKENID_TYPE_KEY, - abi.encode(lsp8TokenIdType_) + _LSP8_TOKENID_SCHEMA_KEY, + abi.encode(lsp8TokenIdSchema_) ); } @@ -217,15 +216,15 @@ abstract contract LSP8IdentifiableDigitalAsset is /** * @inheritdoc LSP4DigitalAssetMetadata - * @dev The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed + * @dev The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed * once the identifiable digital asset contract has been deployed. */ function _setData( bytes32 dataKey, bytes memory dataValue ) internal virtual override { - if (dataKey == _LSP8_TOKENID_TYPE_KEY) { - revert LSP8TokenIdTypeNotEditable(); + if (dataKey == _LSP8_TOKENID_SCHEMA_KEY) { + revert LSP8TokenIdSchemaNotEditable(); } LSP4DigitalAssetMetadata._setData(dataKey, dataValue); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol index ed0e43260..eb7ff56e7 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol @@ -19,12 +19,12 @@ import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol"; import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol"; // constants -import {_INTERFACEID_LSP8, _LSP8_TOKENID_TYPE_KEY} from "./LSP8Constants.sol"; +import {_INTERFACEID_LSP8, _LSP8_TOKENID_SCHEMA_KEY} from "./LSP8Constants.sol"; // errors import { LSP8TokenContractCannotHoldValue, - LSP8TokenIdTypeNotEditable + LSP8TokenIdSchemaNotEditable } from "./LSP8Errors.sol"; import { @@ -56,17 +56,16 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is LSP17Extendable { /** - * @dev Initialize a `LSP8IdentifiableDigitalAsset` contract and set the tokenId type inside the ERC725Y storage of the contract. + * @dev Initialize a `LSP8IdentifiableDigitalAsset` contract and set the tokenId schema inside the ERC725Y storage of the contract. * This will also set the token `name_` and `symbol_` under the ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol`. * * @param name_ The name of the token * @param symbol_ The symbol of the token * @param newOwner_ The owner of the the token-Metadata * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. * - * @custom:warning Make sure the tokenId type provided on deployment is correct, as it can only be set once + * @custom:warning Make sure the tokenId schema provided on deployment is correct, as it can only be set once * and cannot be changed in the ERC725Y storage after the contract has been initialized. */ function _initialize( @@ -74,7 +73,7 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) internal virtual onlyInitializing { LSP4DigitalAssetMetadataInitAbstract._initialize( name_, @@ -84,8 +83,8 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is ); LSP4DigitalAssetMetadataInitAbstract._setData( - _LSP8_TOKENID_TYPE_KEY, - abi.encode(lsp8TokenIdType_) + _LSP8_TOKENID_SCHEMA_KEY, + abi.encode(lsp8TokenIdSchema_) ); } @@ -221,15 +220,15 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is /** * @inheritdoc LSP4DigitalAssetMetadataInitAbstract - * @dev The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed + * @dev The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed * once the identifiable digital asset contract has been deployed. */ function _setData( bytes32 dataKey, bytes memory dataValue ) internal virtual override { - if (dataKey == _LSP8_TOKENID_TYPE_KEY) { - revert LSP8TokenIdTypeNotEditable(); + if (dataKey == _LSP8_TOKENID_SCHEMA_KEY) { + revert LSP8TokenIdSchemaNotEditable(); } LSP4DigitalAssetMetadataInitAbstract._setData(dataKey, dataValue); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol index cb7bb01c6..7de822e24 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol @@ -65,22 +65,21 @@ abstract contract LSP8CompatibleERC721 is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ constructor( string memory name_, string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) {} diff --git a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol index ceef8f14e..c59f76a6d 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol @@ -65,8 +65,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ function _initialize( @@ -74,14 +73,14 @@ abstract contract LSP8CompatibleERC721InitAbstract is string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) internal virtual override onlyInitializing { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol index 32c34d705..66c2f3659 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol @@ -15,22 +15,21 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ constructor( string memory name_, string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP8CompatibleERC721( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) {} diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol index bc9355ee5..9fb6d9011 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol @@ -27,22 +27,21 @@ contract LSP8CompatibleERC721MintableInit is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ function initialize( string memory name_, string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) external virtual initializer { LSP8CompatibleERC721MintableInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol index 9777aa926..67838e84c 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol @@ -20,14 +20,14 @@ contract LSP8CompatibleERC721MintableInitAbstract is string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) internal virtual override onlyInitializing { LSP8CompatibleERC721InitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol index 275a3a229..ca9a9ea9c 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol @@ -22,22 +22,21 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ constructor( string memory name_, string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) {} diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol index 75bea8902..b3d986feb 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol @@ -24,22 +24,21 @@ contract LSP8MintableInit is LSP8MintableInitAbstract { * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ function initialize( string memory name_, string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) external virtual initializer { LSP8MintableInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } } diff --git a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol index 5284e265a..5fd5dff0b 100644 --- a/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +++ b/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol @@ -24,22 +24,21 @@ abstract contract LSP8MintableInitAbstract is * @param symbol_ The symbol of the token. * @param newOwner_ The owner of the token contract. * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). - * @param lsp8TokenIdType_ The type of tokenIds (= NFTs) that this contract will create. - * Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. + * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create. */ function _initialize( string memory name_, string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) internal virtual override onlyInitializing { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } diff --git a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol b/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol index b0526f8ea..137bbdfb0 100644 --- a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol @@ -16,14 +16,14 @@ contract LSP8BurnableInitTester is LSP8BurnableInitAbstract { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } } diff --git a/contracts/Mocks/Tokens/LSP8BurnableTester.sol b/contracts/Mocks/Tokens/LSP8BurnableTester.sol index e6b0ad3a7..728338172 100644 --- a/contracts/Mocks/Tokens/LSP8BurnableTester.sol +++ b/contracts/Mocks/Tokens/LSP8BurnableTester.sol @@ -16,14 +16,14 @@ contract LSP8BurnableTester is LSP8Burnable { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) {} } diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol b/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol index b59edd2d1..217b5cf99 100644 --- a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol @@ -16,7 +16,7 @@ contract LSP8CappedSupplyInitTester is LSP8CappedSupplyInitAbstract { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_, + uint256 lsp8TokenIdSchema_, uint256 tokenSupplyCap_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( @@ -24,7 +24,7 @@ contract LSP8CappedSupplyInitTester is LSP8CappedSupplyInitAbstract { symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); LSP8CappedSupplyInitAbstract._initialize(tokenSupplyCap_); } diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol b/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol index f29e9459b..02d51fefe 100644 --- a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol +++ b/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol @@ -16,7 +16,7 @@ contract LSP8CappedSupplyTester is LSP8CappedSupply { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_, + uint256 lsp8TokenIdSchema_, uint256 tokenSupplyCap_ ) LSP8IdentifiableDigitalAsset( @@ -24,7 +24,7 @@ contract LSP8CappedSupplyTester is LSP8CappedSupply { symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) LSP8CappedSupply(tokenSupplyCap_) {} diff --git a/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol b/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol index 611b1b06e..61112dfee 100644 --- a/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol +++ b/contracts/Mocks/Tokens/LSP8CompatibleERC721Tester.sol @@ -18,7 +18,7 @@ contract LSP8CompatibleERC721Tester is LSP8CompatibleERC721 { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_, + uint256 lsp8TokenIdSchema_, bytes memory tokenURIValue_ ) LSP8CompatibleERC721( @@ -26,7 +26,7 @@ contract LSP8CompatibleERC721Tester is LSP8CompatibleERC721 { symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) { _setData(_LSP4_METADATA_KEY, tokenURIValue_); diff --git a/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol b/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol index 2f65ee39e..7e62b9fe4 100644 --- a/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol +++ b/contracts/Mocks/Tokens/LSP8CompatibleERC721TesterInit.sol @@ -25,7 +25,7 @@ contract LSP8CompatibleERC721InitTester is LSP8CompatibleERC721InitAbstract { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_, + uint256 lsp8TokenIdSchema_, bytes memory tokenURIValue_ ) public virtual initializer { LSP8CompatibleERC721InitAbstract._initialize( @@ -33,7 +33,7 @@ contract LSP8CompatibleERC721InitTester is LSP8CompatibleERC721InitAbstract { symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); _setData(_LSP4_METADATA_KEY, tokenURIValue_); diff --git a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol b/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol index 99aa816f2..33ab82d75 100644 --- a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol +++ b/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol @@ -16,14 +16,14 @@ contract LSP8EnumerableInitTester is LSP8EnumerableInitAbstract { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) public virtual initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } diff --git a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol b/contracts/Mocks/Tokens/LSP8EnumerableTester.sol index a8edcde1b..4abcb8059 100644 --- a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol +++ b/contracts/Mocks/Tokens/LSP8EnumerableTester.sol @@ -16,14 +16,14 @@ contract LSP8EnumerableTester is LSP8Enumerable { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) {} diff --git a/contracts/Mocks/Tokens/LSP8InitTester.sol b/contracts/Mocks/Tokens/LSP8InitTester.sol index 5036ea8e4..137d770ed 100644 --- a/contracts/Mocks/Tokens/LSP8InitTester.sol +++ b/contracts/Mocks/Tokens/LSP8InitTester.sol @@ -19,14 +19,14 @@ contract LSP8InitTester is string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) public initializer { LSP8IdentifiableDigitalAssetInitAbstract._initialize( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ); } diff --git a/contracts/Mocks/Tokens/LSP8Tester.sol b/contracts/Mocks/Tokens/LSP8Tester.sol index ae1d18a5b..0127b9a3c 100644 --- a/contracts/Mocks/Tokens/LSP8Tester.sol +++ b/contracts/Mocks/Tokens/LSP8Tester.sol @@ -16,14 +16,14 @@ contract LSP8Tester is LSP8IdentifiableDigitalAsset, LSP8Burnable { string memory symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ) LSP8IdentifiableDigitalAsset( name_, symbol_, newOwner_, lsp4TokenType_, - lsp8TokenIdType_ + lsp8TokenIdSchema_ ) {} diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md b/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md index d23daffa0..4327af20d 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.md @@ -723,7 +723,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -1707,22 +1707,22 @@ Error occurs when sending native tokens to the LSP8 contract without sending any
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8IdentifiableDigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md index 9048c572c..c079595ef 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.md @@ -749,7 +749,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -1733,22 +1733,22 @@ Error occurs when sending native tokens to the LSP8 contract without sending any
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md index bec910f83..6062a1089 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.md @@ -748,7 +748,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -1749,22 +1749,22 @@ Error occurs when sending native tokens to the LSP8 contract without sending any
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md index d878c5ad2..8916ad08f 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md @@ -1099,7 +1099,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -2098,22 +2098,22 @@ Error occurs when sending native tokens to the LSP8 contract without sending any
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8CompatibleERC721.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md index 5f4e9fa89..4b9c5107a 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.md @@ -754,7 +754,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -1735,22 +1735,22 @@ Error occurs when sending native tokens to the LSP8 contract without sending any
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8Enumerable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md index 402cbbfe5..d1b9153fb 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md @@ -36,7 +36,7 @@ constructor( string symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ); ``` @@ -44,13 +44,13 @@ _Deploying a `LSP8CompatibleERC721Mintable` token contract with: token name = `n #### Parameters -| Name | Type | Description | -| ------------------ | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | -| `lsp8TokenIdType_` | `uint256` | The type of tokenIds (= NFTs) that this contract will create. Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. | +| Name | Type | Description | +| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| `lsp8TokenIdSchema_` | `uint256` | The schema of tokenIds (= NFTs) that this contract will create. |
@@ -1143,7 +1143,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -2167,22 +2167,22 @@ Reverts when `tokenId` has already been minted.
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8CompatibleERC721Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md index c669f007b..f77f2fff1 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.md @@ -36,7 +36,7 @@ constructor( string symbol_, address newOwner_, uint256 lsp4TokenType_, - uint256 lsp8TokenIdType_ + uint256 lsp8TokenIdSchema_ ); ``` @@ -44,13 +44,13 @@ _Deploying a `LSP8Mintable` token contract with: token name = `name_`, token sym #### Parameters -| Name | Type | Description | -| ------------------ | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | -| `lsp8TokenIdType_` | `uint256` | The type of tokenIds (= NFTs) that this contract will create. Available options are: NUMBER = `0`; STRING = `1`; UNIQUE_ID = `2`; HASH = `3`; ADDRESS = `4`. | +| Name | Type | Description | +| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `name_` | `string` | The name of the token. | +| `symbol_` | `string` | The symbol of the token. | +| `newOwner_` | `address` | The owner of the token contract. | +| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection). | +| `lsp8TokenIdSchema_` | `uint256` | The schema of tokenIds (= NFTs) that this contract will create. |
@@ -789,7 +789,7 @@ mapping(bytes32 => bytes) _store function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; ``` -The ERC725Y data key `_LSP8_TOKENID_TYPE_KEY` cannot be changed +The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed once the identifiable digital asset contract has been deployed.
@@ -1798,22 +1798,22 @@ Reverts when `tokenId` has already been minted.
-### LSP8TokenIdTypeNotEditable +### LSP8TokenIdSchemaNotEditable :::note References -- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidtypenoteditable) +- Specification details: [**LSP-8-IdentifiableDigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidschemanoteditable) - Solidity implementation: [`LSP8Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol) -- Error signature: `LSP8TokenIdTypeNotEditable()` -- Error hash: `0x53bc1122` +- Error signature: `LSP8TokenIdSchemaNotEditable()` +- Error hash: `0xce0c7552` ::: ```solidity -error LSP8TokenIdTypeNotEditable(); +error LSP8TokenIdSchemaNotEditable(); ``` -Reverts when trying to edit the data key `LSP8TokenIdType` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdType` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed. +Reverts when trying to edit the data key `LSP8TokenIdSchema` after the identifiable digital asset contract has been deployed. The `LSP8TokenIdSchema` data key is located inside the ERC725Y Data key-value store of the identifiable digital asset contract. It can be set only once inside the constructor/initializer when the identifiable digital asset contract is being deployed.
diff --git a/tests/Benchmark.test.ts b/tests/Benchmark.test.ts index 52e99959c..bf8c45335 100644 --- a/tests/Benchmark.test.ts +++ b/tests/Benchmark.test.ts @@ -21,7 +21,7 @@ import { OPERATION_TYPES, PERMISSIONS, CALLTYPE, - LSP8_TOKEN_ID_TYPES, + LSP8_TOKEN_ID_SCHEMA, LSP4_TOKEN_TYPES, } from '../constants'; import { LSP6TestContext } from './utils/context'; @@ -144,7 +144,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNFT', accounts[0].address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.NUMBER, + LSP8_TOKEN_ID_SCHEMA.NUMBER, ); const lsp8DeployTransaction = lsp8Mintable.deployTransaction; @@ -564,7 +564,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNFT', context.mainController.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); universalProfile1 = await new UniversalProfile__factory(context.mainController).deploy( @@ -718,7 +718,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNF', context.mainController.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); // mint some tokens to the UP @@ -921,7 +921,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNF', context.mainController.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); lsp8LyxPunks = await new LSP8Mintable__factory(context.mainController).deploy( @@ -929,7 +929,7 @@ describe('⛽📊 Gas Benchmark', () => { 'LPK', context.mainController.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); [ diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts index f37dcbe96..56485a261 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts @@ -35,7 +35,7 @@ import { INTERFACE_IDS, OPERATION_TYPES, LSP1_TYPE_IDS, - LSP8_TOKEN_ID_TYPES, + LSP8_TOKEN_ID_SCHEMA, LSP4_TOKEN_TYPES, } from '../../constants'; @@ -1789,7 +1789,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TA', context.accounts.random.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); lsp8TokenB = await new LSP8Tester__factory(context.accounts.random).deploy( @@ -1797,7 +1797,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TB', context.accounts.random.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); lsp8TokenC = await new LSP8Tester__factory(context.accounts.random).deploy( @@ -1805,7 +1805,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TA', context.accounts.random.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP8_TOKEN_ID_SCHEMA.UNIQUE_ID, ); }); @@ -3130,7 +3130,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'MTK', context.universalProfile1.address, LSP4_TOKEN_TYPES.NFT, - LSP8_TOKEN_ID_TYPES.NUMBER, + LSP8_TOKEN_ID_SCHEMA.NUMBER, ); // Mint token for UP1 await LSP8.mint(context.universalProfile1.address, '0x' + '0'.repeat(64), true, '0x'); diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts index bafca29bd..6c0dab7d0 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts @@ -24,7 +24,7 @@ import { INTERFACE_IDS, OPERATION_TYPES, LSP1_TYPE_IDS, - LSP8_TOKEN_ID_TYPES, + LSP8_TOKEN_ID_SCHEMA, LSP4_TOKEN_TYPES, } from '../../constants'; import { callPayload, getLSP5MapAndArrayKeysValue } from '../utils/fixtures'; @@ -1175,7 +1175,7 @@ export const shouldBehaveLikeLSP1Delegate = (buildContext: () => Promise Promise Promise Promise Promise Promise { - it('should not allow to update the `LSP8TokenIdType` after deployment', async () => { + it('should not allow to update the `lsp8TokenIdSchema` after deployment', async () => { await expect( - context.lsp8CompatibleERC721.setData(ERC725YDataKeys.LSP8.LSP8TokenIdType, '0xdeadbeef'), - ).to.be.revertedWithCustomError(context.lsp8CompatibleERC721, 'LSP8TokenIdTypeNotEditable'); + context.lsp8CompatibleERC721.setData(ERC725YDataKeys.LSP8.LSP8TokenIdSchema, '0xdeadbeef'), + ).to.be.revertedWithCustomError(context.lsp8CompatibleERC721, 'LSP8TokenIdSchemaNotEditable'); }); }); describe('when setting data', () => { - it('should not allow to update the `LSP8TokenIdType` after deployment', async () => { + it('should not allow to update the `lsp8TokenIdSchema` after deployment', async () => { await expect( - context.lsp8CompatibleERC721.setData(ERC725YDataKeys.LSP8.LSP8TokenIdType, '0xdeadbeef'), - ).to.be.revertedWithCustomError(context.lsp8CompatibleERC721, 'LSP8TokenIdTypeNotEditable'); + context.lsp8CompatibleERC721.setData(ERC725YDataKeys.LSP8.LSP8TokenIdSchema, '0xdeadbeef'), + ).to.be.revertedWithCustomError(context.lsp8CompatibleERC721, 'LSP8TokenIdSchemaNotEditable'); }); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts index 623c8098c..c7e52c599 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts @@ -19,7 +19,7 @@ export type LSP8EnumerableDeployParams = { symbol: string; newOwner: string; lsp4TokenType: number; - lsp8TokenIdType: number; + lsp8TokenIdSchema: number; }; export type LSP8EnumerableTestContext = { diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts index e504a73bd..c730d6d43 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts @@ -43,7 +43,7 @@ export type LSP8DeployParams = { symbol: string; newOwner: string; lsp4TokenType: number; - lsp8TokenIdType: number; + lsp8TokenIdSchema: number; }; export type LSP8TestContext = { @@ -71,18 +71,18 @@ export const shouldBehaveLikeLSP8 = ( }); describe('when setting data', () => { - it('should not allow to update the `LSP8TokenIdType` after deployment', async () => { + it('should not allow to update the `LSP8TokenIdSchema` after deployment', async () => { await expect( - context.lsp8.setData(ERC725YDataKeys.LSP8.LSP8TokenIdType, '0xdeadbeef'), - ).to.be.revertedWithCustomError(context.lsp8, 'LSP8TokenIdTypeNotEditable'); + context.lsp8.setData(ERC725YDataKeys.LSP8.LSP8TokenIdSchema, '0xdeadbeef'), + ).to.be.revertedWithCustomError(context.lsp8, 'LSP8TokenIdSchemaNotEditable'); }); }); describe('when setting data', () => { - it('should not allow to update the `LSP8TokenIdType` after deployment', async () => { + it('should not allow to update the `LSP8TokenIdSchema` after deployment', async () => { await expect( - context.lsp8.setData(ERC725YDataKeys.LSP8.LSP8TokenIdType, '0xdeadbeef'), - ).to.be.revertedWithCustomError(context.lsp8, 'LSP8TokenIdTypeNotEditable'); + context.lsp8.setData(ERC725YDataKeys.LSP8.LSP8TokenIdSchema, '0xdeadbeef'), + ).to.be.revertedWithCustomError(context.lsp8, 'LSP8TokenIdSchemaNotEditable'); }); }); @@ -1867,15 +1867,17 @@ export const shouldInitializeLikeLSP8 = ( .withArgs(lsp4TokenTypeKey, expectedTokenTypeValue); expect(await context.lsp8.getData(lsp4TokenTypeKey)).to.equal(expectedTokenTypeValue); - const lsp8TokenIdTypeDataKey = ERC725YDataKeys.LSP8['LSP8TokenIdType']; + const lsp8TokenIdSchemaDataKey = ERC725YDataKeys.LSP8['LSP8TokenIdSchema']; const expectedTokenIdDataValue = abiCoder.encode( ['uint256'], - [context.deployParams.lsp8TokenIdType], + [context.deployParams.lsp8TokenIdSchema], ); await expect(context.initializeTransaction) .to.emit(context.lsp8, 'DataChanged') - .withArgs(lsp8TokenIdTypeDataKey, expectedTokenIdDataValue); - expect(await context.lsp8.getData(lsp8TokenIdTypeDataKey)).to.equal(expectedTokenIdDataValue); + .withArgs(lsp8TokenIdSchemaDataKey, expectedTokenIdDataValue); + expect(await context.lsp8.getData(lsp8TokenIdSchemaDataKey)).to.equal( + expectedTokenIdDataValue, + ); }); }); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts index c43537782..e8af41d58 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts @@ -29,7 +29,7 @@ export type LSP8MintableDeployParams = { symbol: string; newOwner: string; lsp4TokenType: number; - lsp8TokenIdType: number; + lsp8TokenIdSchema: number; }; export type LSP8MintableTestContext = { diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts index 9d9d99c88..d7b01b8f6 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts @@ -7,7 +7,7 @@ import { LSP8BurnableInitTester, LSP8BurnableInitTester__factory } from '../../. import { shouldInitializeLikeLSP8 } from '../LSP8IdentifiableDigitalAsset.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; type LSP8BurnableInitTestContext = { accounts: SignerWithAddress[]; @@ -17,7 +17,7 @@ type LSP8BurnableInitTestContext = { symbol: string; newOwner: string; lsp4TokenType: number; - lsp8TokenIdType: number; + lsp8TokenIdSchema: number; }; }; @@ -29,7 +29,7 @@ describe('LSP8BurnableInit with proxy', () => { symbol: 'BRN', newOwner: accounts[0].address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const lsp8BurnableImplementation = await new LSP8BurnableInitTester__factory( @@ -47,7 +47,7 @@ describe('LSP8BurnableInit with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.lsp4TokenType, - context.deployParams.lsp8TokenIdType, + context.deployParams.lsp8TokenIdSchema, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts index 60a959160..bc74500f6 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts @@ -10,7 +10,7 @@ import { } from '../LSP8CappedSupply.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8CappedSupplyInit with proxy', () => { const buildTestContext = async () => { @@ -20,7 +20,7 @@ describe('LSP8CappedSupplyInit with proxy', () => { symbol: 'CAP', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, tokenSupplyCap: ethers.BigNumber.from('2'), }; const lsp8CappedSupplyInit = await new LSP8CappedSupplyInitTester__factory( @@ -38,7 +38,7 @@ describe('LSP8CappedSupplyInit with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.lsp4TokenType, - context.deployParams.lsp8TokenIdType, + context.deployParams.lsp8TokenIdSchema, context.deployParams.tokenSupplyCap, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts index 55237103d..9f751f48f 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CompatibleERC721Init.test.ts @@ -14,7 +14,7 @@ import { } from '../LSP8CompatibleERC721.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8CompatibleERC721Init with proxy', () => { const buildTestContext = async (): Promise => { @@ -33,7 +33,7 @@ describe('LSP8CompatibleERC721Init with proxy', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, lsp4MetadataValue, }; @@ -55,7 +55,7 @@ describe('LSP8CompatibleERC721Init with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.lsp4TokenType, - context.deployParams.lsp8TokenIdType, + context.deployParams.lsp8TokenIdSchema, context.deployParams.lsp4MetadataValue, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts index 144374655..0bd2e8c4e 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts @@ -9,7 +9,7 @@ import { } from '../LSP8Enumerable.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8EnumerableInit with proxy', () => { const buildTestContext = async () => { @@ -19,7 +19,7 @@ describe('LSP8EnumerableInit with proxy', () => { symbol: 'LSP8 NMRBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const LSP8EnumerableInit: LSP8EnumerableInitTester = @@ -37,7 +37,7 @@ describe('LSP8EnumerableInit with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.lsp4TokenType, - context.deployParams.lsp8TokenIdType, + context.deployParams.lsp8TokenIdSchema, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts index bb2362d2c..47170638b 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts @@ -26,7 +26,7 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: nftType, + lsp8TokenIdSchema: nftType, }; const lsp8TesterInit = await new LSP8InitTester__factory(accounts.owner).deploy(); @@ -59,7 +59,7 @@ describe('LSP8IdentifiableDigitalAssetInit with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.lsp4TokenType, - context.deployParams.lsp8TokenIdType, + context.deployParams.lsp8TokenIdSchema, ); }; diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts index a51cd4f8b..41134e3f3 100644 --- a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts @@ -10,7 +10,7 @@ import { } from '../LSP8Mintable.behaviour'; import { deployProxy } from '../../utils/fixtures'; -import { ERC725YDataKeys, LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { ERC725YDataKeys, LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8MintableInit with proxy', () => { const buildTestContext = async () => { @@ -20,7 +20,7 @@ describe('LSP8MintableInit with proxy', () => { symbol: 'MNTBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const LSP8MintableInit: LSP8MintableInit = await new LSP8MintableInit__factory( @@ -39,7 +39,7 @@ describe('LSP8MintableInit with proxy', () => { context.deployParams.symbol, context.deployParams.newOwner, context.deployParams.lsp4TokenType, - context.deployParams.lsp8TokenIdType, + context.deployParams.lsp8TokenIdSchema, ); }; @@ -53,7 +53,7 @@ describe('LSP8MintableInit with proxy', () => { expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenSymbol)).to.equal('0x'); expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4Metadata)).to.equal('0x'); expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP4.LSP4TokenType)).to.equal('0x'); - expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP8.LSP8TokenIdType)).to.equal('0x'); + expect(await lsp8MintableInit.getData(ERC725YDataKeys.LSP8.LSP8TokenIdSchema)).to.equal('0x'); expect(await lsp8MintableInit.owner()).to.equal(ethers.constants.AddressZero); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts index d423d2961..44304d035 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts @@ -4,7 +4,7 @@ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { LSP8BurnableTester, LSP8BurnableTester__factory } from '../../../types'; import { shouldInitializeLikeLSP8 } from '../LSP8IdentifiableDigitalAsset.behaviour'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; type LSP8BurnableTestContext = { accounts: SignerWithAddress[]; @@ -14,7 +14,7 @@ type LSP8BurnableTestContext = { symbol: string; newOwner: string; lsp4TokenType: number; - lsp8TokenIdType: number; + lsp8TokenIdSchema: number; }; }; @@ -26,7 +26,7 @@ describe('LSP8Burnable with constructor', () => { symbol: 'BRN', newOwner: accounts[0].address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const lsp8Burnable = await new LSP8BurnableTester__factory(accounts[0]).deploy( @@ -34,7 +34,7 @@ describe('LSP8Burnable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, ); return { accounts, lsp8Burnable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts index ddb5bcd45..d269c75eb 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts @@ -8,7 +8,7 @@ import { LSP8CappedSupplyTestContext, getNamedAccounts, } from '../LSP8CappedSupply.behaviour'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8CappedSupply with constructor', () => { const buildTestContext = async () => { @@ -18,7 +18,7 @@ describe('LSP8CappedSupply with constructor', () => { symbol: 'CAP', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, tokenSupplyCap: ethers.BigNumber.from('2'), }; const lsp8CappedSupply = await new LSP8CappedSupplyTester__factory(accounts.owner).deploy( @@ -26,7 +26,7 @@ describe('LSP8CappedSupply with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, deployParams.tokenSupplyCap, ); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts index 25e8891df..b009e0bcc 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CompatibleERC721.test.ts @@ -8,7 +8,7 @@ import { shouldInitializeLikeLSP8CompatibleERC721, LSP8CompatibleERC721TestContext, } from '../LSP8CompatibleERC721.behaviour'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8CompatibleERC721 with constructor', () => { const buildTestContext = async (): Promise => { @@ -27,7 +27,7 @@ describe('LSP8CompatibleERC721 with constructor', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, lsp4MetadataValue, }; @@ -38,7 +38,7 @@ describe('LSP8CompatibleERC721 with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, deployParams.lsp4MetadataValue, ); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts index 1e290c049..98e9425fa 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts @@ -6,7 +6,7 @@ import { LSP8EnumerableTestContext, getNamedAccounts, } from '../LSP8Enumerable.behaviour'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8Enumerable with constructor', () => { const buildTestContext = async () => { @@ -17,7 +17,7 @@ describe('LSP8Enumerable with constructor', () => { symbol: 'LSP8 NMRBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const lsp8Enumerable: LSP8EnumerableTester = await new LSP8EnumerableTester__factory( @@ -27,7 +27,7 @@ describe('LSP8Enumerable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, ); return { accounts, lsp8Enumerable, deployParams }; diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts index 86016cefc..0b7553e19 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts @@ -19,7 +19,7 @@ import { LS4DigitalAssetMetadataTestContext, shouldBehaveLikeLSP4DigitalAssetMetadata, } from '../../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour'; -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; describe('LSP8IdentifiableDigitalAsset with constructor', () => { const buildTestContext = async (nftType: number): Promise => { @@ -29,14 +29,14 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { symbol: 'NFT', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: nftType, + lsp8TokenIdSchema: nftType, }; const lsp8 = await new LSP8Tester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, ); return { accounts, lsp8, deployParams }; @@ -44,7 +44,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { const buildLSP4DigitalAssetMetadataTestContext = async (): Promise => { - const { lsp8 } = await buildTestContext(LSP8_TOKEN_ID_TYPES.NUMBER); + const { lsp8 } = await buildTestContext(LSP8_TOKEN_ID_SCHEMA.NUMBER); const accounts = await ethers.getSigners(); const deployParams = { @@ -67,14 +67,14 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { symbol: 'NFT', owner: accounts[0], lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const contract = await new LSP8Tester__factory(accounts[0]).deploy( deployParams.name, deployParams.symbol, deployParams.owner.address, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, ); return { accounts, contract, deployParams }; @@ -99,7 +99,7 @@ describe('LSP8IdentifiableDigitalAsset with constructor', () => { deployParams.symbol, ethers.constants.AddressZero, deployParams.lsp4TokenType, - LSP8_TOKEN_ID_TYPES.NUMBER, + LSP8_TOKEN_ID_SCHEMA.NUMBER, ), ).to.be.revertedWithCustomError(contractToDeploy, 'OwnableCannotSetZeroAddressAsOwner'); }); diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts index 136748419..19a12372d 100644 --- a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts +++ b/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts @@ -1,4 +1,4 @@ -import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_TYPES } from '../../../constants'; +import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_SCHEMA } from '../../../constants'; import { LSP8Mintable, LSP8Mintable__factory } from '../../../types'; import { shouldInitializeLikeLSP8 } from '../LSP8IdentifiableDigitalAsset.behaviour'; @@ -17,7 +17,7 @@ describe('LSP8Mintable with constructor', () => { symbol: 'LSP8 MNTBL', newOwner: accounts.owner.address, lsp4TokenType: LSP4_TOKEN_TYPES.NFT, - lsp8TokenIdType: LSP8_TOKEN_ID_TYPES.NUMBER, + lsp8TokenIdSchema: LSP8_TOKEN_ID_SCHEMA.NUMBER, }; const lsp8Mintable: LSP8Mintable = await new LSP8Mintable__factory(accounts.owner).deploy( @@ -25,7 +25,7 @@ describe('LSP8Mintable with constructor', () => { deployParams.symbol, deployParams.newOwner, deployParams.lsp4TokenType, - deployParams.lsp8TokenIdType, + deployParams.lsp8TokenIdSchema, ); return { accounts, lsp8Mintable, deployParams }; From 66b54ed844d1290998c2c7ad63fbe2347dffda62 Mon Sep 17 00:00:00 2001 From: YamenMerhi Date: Wed, 29 Nov 2023 16:27:56 +0200 Subject: [PATCH 10/12] chore: resolve merge conflicts --- .../LSP4DigitalAssetMetadata.sol | 7 ------- .../LSP4DigitalAssetMetadataCore.sol | 9 +++++++-- .../LSP4DigitalAssetMetadataInitAbstract.sol | 7 ------- .../extensions/LSP8CompatibleERC721.md | 2 +- .../presets/LSP8CompatibleERC721Mintable.md | 2 +- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol index 93a391a18..db7ce4fd7 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol @@ -15,13 +15,6 @@ import { _LSP4_TOKEN_TYPE_KEY } from "./LSP4Constants.sol"; -// errors -import { - LSP4TokenNameNotEditable, - LSP4TokenSymbolNotEditable, - LSP4TokenTypeNotEditable -} from "./LSP4Errors.sol"; - /** * @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store. * @author Matthew Stevens diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol index 8846aba51..a1ed4a24d 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol @@ -10,13 +10,15 @@ import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol"; // constants import { _LSP4_TOKEN_NAME_KEY, - _LSP4_TOKEN_SYMBOL_KEY + _LSP4_TOKEN_SYMBOL_KEY, + _LSP4_TOKEN_TYPE_KEY } from "./LSP4Constants.sol"; // errors import { LSP4TokenNameNotEditable, - LSP4TokenSymbolNotEditable + LSP4TokenSymbolNotEditable, + LSP4TokenTypeNotEditable } from "./LSP4Errors.sol"; /** @@ -39,8 +41,11 @@ abstract contract LSP4DigitalAssetMetadataCore is ERC725YCore { revert LSP4TokenNameNotEditable(); } else if (dataKey == _LSP4_TOKEN_SYMBOL_KEY) { revert LSP4TokenSymbolNotEditable(); + } else if (dataKey == _LSP4_TOKEN_TYPE_KEY) { + revert LSP4TokenTypeNotEditable(); } else { _store[dataKey] = dataValue; + emit DataChanged( dataKey, dataValue.length <= 256 diff --git a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol index ec5ec748f..8035e4dce 100644 --- a/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +++ b/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol @@ -19,13 +19,6 @@ import { _LSP4_TOKEN_TYPE_KEY } from "./LSP4Constants.sol"; -// errors -import { - LSP4TokenNameNotEditable, - LSP4TokenSymbolNotEditable, - LSP4TokenTypeNotEditable -} from "./LSP4Errors.sol"; - /** * @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store. * @author Matthew Stevens diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md index ea71513be..fa2856d71 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md @@ -1704,7 +1704,7 @@ Emitted when the allowance of a `spender` for an `owner` is set by a call to [`a event ApprovalForAll(address indexed owner, address indexed operator, bool approved); ``` -Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. +Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. #### Parameters diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md index f65035b57..d6aa6697c 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md @@ -1748,7 +1748,7 @@ Emitted when the allowance of a `spender` for an `owner` is set by a call to [`a event ApprovalForAll(address indexed owner, address indexed operator, bool approved); ``` -Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. +Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. #### Parameters From 2578252377a5ece31fb6c05b39928133ee04b3fd Mon Sep 17 00:00:00 2001 From: YamenMerhi Date: Wed, 29 Nov 2023 16:33:41 +0200 Subject: [PATCH 11/12] test: fix foundry tesst --- tests/foundry/GasTests/execute/RestrictedController.sol | 4 ++-- tests/foundry/GasTests/execute/UnrestrictedController.sol | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/foundry/GasTests/execute/RestrictedController.sol b/tests/foundry/GasTests/execute/RestrictedController.sol index 0f1f6b7bf..56b1ffda8 100644 --- a/tests/foundry/GasTests/execute/RestrictedController.sol +++ b/tests/foundry/GasTests/execute/RestrictedController.sol @@ -24,7 +24,7 @@ import { _PERMISSION_TRANSFERVALUE } from "../../../../contracts/LSP6KeyManager/LSP6Constants.sol"; import { - _LSP8_TOKENID_TYPE_NUMBER + _LSP8_TOKENID_SCHEMA_NUMBER } from "../../../../contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol"; import "../UniversalProfileTestsHelper.sol"; @@ -447,7 +447,7 @@ contract ExecuteRestrictedController is UniversalProfileTestsHelper { "TSTLSP8", digitalAssetsOwner, _LSP4_TOKEN_TYPE_NFT, - _LSP8_TOKENID_TYPE_NUMBER + _LSP8_TOKENID_SCHEMA_NUMBER ); bytes32 tokenID = bytes32(uint256(1)); diff --git a/tests/foundry/GasTests/execute/UnrestrictedController.sol b/tests/foundry/GasTests/execute/UnrestrictedController.sol index 892599d1f..103719fc0 100644 --- a/tests/foundry/GasTests/execute/UnrestrictedController.sol +++ b/tests/foundry/GasTests/execute/UnrestrictedController.sol @@ -22,7 +22,7 @@ import { _PERMISSION_SUPER_TRANSFERVALUE } from "../../../../contracts/LSP6KeyManager/LSP6Constants.sol"; import { - _LSP8_TOKENID_TYPE_NUMBER + _LSP8_TOKENID_SCHEMA_NUMBER } from "../../../../contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol"; import "../UniversalProfileTestsHelper.sol"; @@ -269,7 +269,7 @@ contract ExecuteUnrestrictedController is UniversalProfileTestsHelper { "TSTLSP8", digitalAssetsOwner, _LSP4_TOKEN_TYPE_NFT, - _LSP8_TOKENID_TYPE_NUMBER + _LSP8_TOKENID_SCHEMA_NUMBER ); bytes32 tokenID = bytes32(uint256(1)); From 62d0f093916bb0d9fcd6c12be58cd482fd538fb7 Mon Sep 17 00:00:00 2001 From: YamenMerhi Date: Wed, 29 Nov 2023 16:43:26 +0200 Subject: [PATCH 12/12] docs: add autogenerated docs --- .../extensions/LSP8CompatibleERC721.md | 2 +- .../presets/LSP8CompatibleERC721Mintable.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md index fa2856d71..ea71513be 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.md @@ -1704,7 +1704,7 @@ Emitted when the allowance of a `spender` for an `owner` is set by a call to [`a event ApprovalForAll(address indexed owner, address indexed operator, bool approved); ``` -Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. +Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. #### Parameters diff --git a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md index d6aa6697c..f65035b57 100644 --- a/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md +++ b/docs/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.md @@ -1748,7 +1748,7 @@ Emitted when the allowance of a `spender` for an `owner` is set by a call to [`a event ApprovalForAll(address indexed owner, address indexed operator, bool approved); ``` -Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. +Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. #### Parameters