@lukso/lsp8-contracts 0.16.7 → 0.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +54 -4
  3. package/artifacts/IAccessControlExtended.json +285 -0
  4. package/artifacts/ILSP8CappedBalance.json +27 -0
  5. package/artifacts/ILSP8CappedSupply.json +27 -0
  6. package/artifacts/ILSP8IdentifiableDigitalAsset.json +6 -3
  7. package/artifacts/ILSP8Mintable.json +62 -0
  8. package/artifacts/ILSP8NonTransferable.json +110 -0
  9. package/artifacts/ILSP8Revokable.json +75 -0
  10. package/artifacts/LSP8Burnable.json +7 -4
  11. package/artifacts/LSP8BurnableInitAbstract.json +7 -4
  12. package/artifacts/LSP8CappedBalanceAbstract.json +1285 -0
  13. package/artifacts/LSP8CappedBalanceInitAbstract.json +1293 -0
  14. package/artifacts/{LSP8CappedSupply.json → LSP8CappedSupplyAbstract.json} +8 -15
  15. package/artifacts/LSP8CappedSupplyInitAbstract.json +7 -14
  16. package/artifacts/LSP8CustomizableToken.json +1738 -0
  17. package/artifacts/LSP8CustomizableTokenInit.json +1733 -0
  18. package/artifacts/LSP8Enumerable.json +7 -4
  19. package/artifacts/LSP8EnumerableInitAbstract.json +7 -4
  20. package/artifacts/LSP8IdentifiableDigitalAsset.json +6 -3
  21. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +6 -3
  22. package/artifacts/LSP8Mintable.json +369 -5
  23. package/artifacts/LSP8MintableAbstract.json +1328 -0
  24. package/artifacts/LSP8MintableInit.json +369 -5
  25. package/artifacts/LSP8MintableInitAbstract.json +1336 -0
  26. package/artifacts/LSP8NonTransferableAbstract.json +1367 -0
  27. package/artifacts/LSP8NonTransferableInitAbstract.json +1375 -0
  28. package/artifacts/LSP8RevokableAbstract.json +1317 -0
  29. package/artifacts/LSP8RevokableInitAbstract.json +1325 -0
  30. package/artifacts/LSP8Votes.json +7 -4
  31. package/artifacts/LSP8VotesInitAbstract.json +7 -4
  32. package/contracts/ILSP8IdentifiableDigitalAsset.sol +1 -1
  33. package/contracts/LSP8Constants.sol +1 -1
  34. package/contracts/LSP8Errors.sol +1 -1
  35. package/contracts/LSP8IdentifiableDigitalAsset.sol +73 -114
  36. package/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol +69 -116
  37. package/contracts/extensions/AccessControlExtended/AccessControlExtendedAbstract.sol +378 -0
  38. package/contracts/extensions/AccessControlExtended/AccessControlExtendedConstants.sol +13 -0
  39. package/contracts/extensions/AccessControlExtended/AccessControlExtendedErrors.sol +23 -0
  40. package/contracts/extensions/AccessControlExtended/AccessControlExtendedInitAbstract.sol +390 -0
  41. package/contracts/extensions/AccessControlExtended/IAccessControlExtended.sol +51 -0
  42. package/contracts/extensions/{LSP8Burnable.sol → LSP8Burnable/LSP8Burnable.sol} +7 -6
  43. package/contracts/extensions/{LSP8BurnableInitAbstract.sol → LSP8Burnable/LSP8BurnableInitAbstract.sol} +7 -6
  44. package/contracts/extensions/LSP8CappedBalance/ILSP8CappedBalance.sol +11 -0
  45. package/contracts/extensions/LSP8CappedBalance/LSP8CappedBalanceAbstract.sol +124 -0
  46. package/contracts/extensions/LSP8CappedBalance/LSP8CappedBalanceErrors.sol +9 -0
  47. package/contracts/extensions/LSP8CappedBalance/LSP8CappedBalanceInitAbstract.sol +174 -0
  48. package/contracts/extensions/LSP8CappedSupply/ILSP8CappedSupply.sol +11 -0
  49. package/contracts/extensions/LSP8CappedSupply/LSP8CappedSupplyAbstract.sol +59 -0
  50. package/contracts/extensions/LSP8CappedSupply/LSP8CappedSupplyErrors.sol +6 -0
  51. package/contracts/extensions/LSP8CappedSupply/LSP8CappedSupplyInitAbstract.sol +97 -0
  52. package/contracts/extensions/{LSP8Enumerable.sol → LSP8Enumerable/LSP8Enumerable.sol} +2 -2
  53. package/contracts/extensions/{LSP8EnumerableInitAbstract.sol → LSP8Enumerable/LSP8EnumerableInitAbstract.sol} +2 -2
  54. package/contracts/extensions/LSP8Mintable/ILSP8Mintable.sol +27 -0
  55. package/contracts/extensions/LSP8Mintable/LSP8MintableAbstract.sol +105 -0
  56. package/contracts/extensions/LSP8Mintable/LSP8MintableErrors.sol +5 -0
  57. package/contracts/extensions/LSP8Mintable/LSP8MintableInitAbstract.sol +155 -0
  58. package/contracts/extensions/LSP8NonTransferable/ILSP8NonTransferable.sol +48 -0
  59. package/contracts/extensions/LSP8NonTransferable/LSP8NonTransferableAbstract.sol +190 -0
  60. package/contracts/extensions/LSP8NonTransferable/LSP8NonTransferableErrors.sol +14 -0
  61. package/contracts/extensions/LSP8NonTransferable/LSP8NonTransferableInitAbstract.sol +246 -0
  62. package/contracts/extensions/LSP8Revokable/ILSP8Revokable.sol +28 -0
  63. package/contracts/extensions/LSP8Revokable/LSP8RevokableAbstract.sol +132 -0
  64. package/contracts/extensions/LSP8Revokable/LSP8RevokableErrors.sol +4 -0
  65. package/contracts/extensions/LSP8Revokable/LSP8RevokableInitAbstract.sol +178 -0
  66. package/contracts/extensions/{LSP8Votes.sol → LSP8Votes/LSP8Votes.sol} +3 -4
  67. package/contracts/extensions/{LSP8VotesConstants.sol → LSP8Votes/LSP8VotesConstants.sol} +1 -1
  68. package/contracts/extensions/{LSP8VotesInitAbstract.sol → LSP8Votes/LSP8VotesInitAbstract.sol} +3 -3
  69. package/contracts/presets/LSP8CustomizableToken.sol +277 -0
  70. package/contracts/presets/LSP8CustomizableTokenConstants.sol +32 -0
  71. package/contracts/presets/LSP8CustomizableTokenInit.sol +318 -0
  72. package/contracts/presets/LSP8Mintable.sol +13 -28
  73. package/contracts/presets/LSP8MintableInit.sol +13 -6
  74. package/dist/abi.cjs +8233 -158
  75. package/dist/abi.d.cts +12004 -323
  76. package/dist/abi.d.mts +12004 -323
  77. package/dist/abi.d.ts +12004 -323
  78. package/dist/abi.mjs +8217 -158
  79. package/dist/constants.cjs +21 -0
  80. package/dist/constants.d.cts +12 -1
  81. package/dist/constants.d.mts +12 -1
  82. package/dist/constants.d.ts +12 -1
  83. package/dist/constants.mjs +16 -1
  84. package/package.json +32 -9
  85. package/contracts/extensions/LSP8CappedSupply.sol +0 -85
  86. package/contracts/extensions/LSP8CappedSupplyInitAbstract.sol +0 -88
  87. package/contracts/presets/ILSP8Mintable.sol +0 -33
  88. package/contracts/presets/LSP8MintableInitAbstract.sol +0 -62
@@ -0,0 +1,318 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.27;
3
+
4
+ // modules
5
+ import {
6
+ OwnableUpgradeable
7
+ } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
8
+ import {
9
+ LSP8IdentifiableDigitalAssetInitAbstract
10
+ } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
11
+
12
+ // extensions
13
+ import {
14
+ LSP8BurnableInitAbstract
15
+ } from "../extensions/LSP8Burnable/LSP8BurnableInitAbstract.sol";
16
+ import {
17
+ LSP8MintableInitAbstract
18
+ } from "../extensions/LSP8Mintable/LSP8MintableInitAbstract.sol";
19
+ import {
20
+ LSP8CappedSupplyInitAbstract
21
+ } from "../extensions/LSP8CappedSupply/LSP8CappedSupplyInitAbstract.sol";
22
+ import {
23
+ LSP8CappedBalanceInitAbstract
24
+ } from "../extensions/LSP8CappedBalance/LSP8CappedBalanceInitAbstract.sol";
25
+ import {
26
+ LSP8NonTransferableInitAbstract
27
+ } from "../extensions/LSP8NonTransferable/LSP8NonTransferableInitAbstract.sol";
28
+ import {
29
+ LSP8RevokableInitAbstract
30
+ } from "../extensions/LSP8Revokable/LSP8RevokableInitAbstract.sol";
31
+
32
+ // constants
33
+ import {
34
+ LSP8MintableParams,
35
+ LSP8NonTransferableParams,
36
+ LSP8CappedParams,
37
+ LSP8RevokableParams
38
+ } from "./LSP8CustomizableTokenConstants.sol";
39
+
40
+ // errors
41
+ import {
42
+ LSP8MintDisabled
43
+ } from "../extensions/LSP8Mintable/LSP8MintableErrors.sol";
44
+ import {
45
+ LSP8CappedSupplyCannotMintOverCap
46
+ } from "../extensions/LSP8CappedSupply/LSP8CappedSupplyErrors.sol";
47
+
48
+ /// @title LSP8CustomizableTokenInit
49
+ /// @dev A customizable LSP8 token that implements multiple features and uses role-based exemptions. This version of the contract is the implementation to use behind proxies.
50
+ /// Implements {LSP8BurnableInitAbstract} to allow burning.
51
+ /// Implements {LSP8MintableInitAbstract} to allow minting.
52
+ /// Implements {LSP8CappedSupplyInitAbstract} to set total supply cap.
53
+ /// Implements {LSP8CappedBalanceInitAbstract} to set balance caps.
54
+ /// Implements {LSP8NonTransferableInitAbstract} to restrict transfers.
55
+ /// Implements {LSP8RevokableInitAbstract} to allow revoking tokens.
56
+ contract LSP8CustomizableTokenInit is
57
+ LSP8BurnableInitAbstract,
58
+ LSP8MintableInitAbstract,
59
+ LSP8CappedBalanceInitAbstract,
60
+ LSP8CappedSupplyInitAbstract,
61
+ LSP8NonTransferableInitAbstract,
62
+ LSP8RevokableInitAbstract
63
+ {
64
+ /// @dev Locks the base implementation contract from being initialized.
65
+ constructor() {
66
+ _disableInitializers();
67
+ }
68
+
69
+ /// @notice Initializes the token with name, symbol, owner, and customizable features.
70
+ /// @dev Sets up minting, balance cap, transfer restrictions and supply cap. Mints initial tokens if specified. Reverts if initialMintTokenIds length exceeds tokenSupplyCap.
71
+ /// @param name_ The name of the token.
72
+ /// @param symbol_ The symbol of the token.
73
+ /// @param newOwner_ The initial owner of the token.
74
+ /// @param lsp4TokenType_ The LSP4 token type (e.g., 1 for NFT, 2 for Collection).
75
+ /// @param lsp8TokenIdFormat_ The format of tokenIds (= NFTs) that this contract will create.
76
+ /// @param mintableParams Deployment configuration for minting feature (see above).
77
+ /// @param nonTransferableParams Deployment configuration for non-transferable feature (see above).
78
+ /// @param cappedParams Deployment configuration for capped balance and capped supply features (see above).
79
+ function initialize(
80
+ string calldata name_,
81
+ string calldata symbol_,
82
+ address newOwner_,
83
+ uint256 lsp4TokenType_,
84
+ uint256 lsp8TokenIdFormat_,
85
+ LSP8MintableParams calldata mintableParams,
86
+ LSP8CappedParams calldata cappedParams,
87
+ LSP8NonTransferableParams calldata nonTransferableParams,
88
+ LSP8RevokableParams calldata revokableParams
89
+ ) external virtual initializer {
90
+ __LSP8CustomizableToken_init(
91
+ name_,
92
+ symbol_,
93
+ newOwner_,
94
+ lsp4TokenType_,
95
+ lsp8TokenIdFormat_,
96
+ mintableParams,
97
+ cappedParams,
98
+ nonTransferableParams,
99
+ revokableParams
100
+ );
101
+ }
102
+
103
+ /// @dev Internal initialization function.
104
+ function __LSP8CustomizableToken_init(
105
+ string calldata name_,
106
+ string calldata symbol_,
107
+ address newOwner_,
108
+ uint256 lsp4TokenType_,
109
+ uint256 lsp8TokenIdFormat_,
110
+ LSP8MintableParams calldata mintableParams,
111
+ LSP8CappedParams calldata cappedParams,
112
+ LSP8NonTransferableParams calldata nonTransferableParams,
113
+ LSP8RevokableParams calldata revokableParams
114
+ ) internal virtual onlyInitializing {
115
+ LSP8IdentifiableDigitalAssetInitAbstract._initialize(
116
+ name_,
117
+ symbol_,
118
+ newOwner_,
119
+ lsp4TokenType_,
120
+ lsp8TokenIdFormat_
121
+ );
122
+ __AccessControlExtended_init_unchained();
123
+ __LSP8Mintable_init_unchained(mintableParams.isMintable);
124
+ __LSP8CappedSupply_init_unchained(cappedParams.tokenSupplyCap);
125
+ __LSP8CappedBalance_init_unchained(cappedParams.tokenBalanceCap);
126
+ __LSP8NonTransferable_init_unchained(
127
+ nonTransferableParams.transferLockStart,
128
+ nonTransferableParams.transferLockEnd
129
+ );
130
+ __LSP8Revokable_init_unchained(revokableParams.isRevokable);
131
+
132
+ _initialMint({
133
+ to: newOwner_,
134
+ initialMintTokenIds: mintableParams.initialMintTokenIds
135
+ });
136
+ }
137
+
138
+ /// @inheritdoc LSP8CappedSupplyInitAbstract
139
+ /// @notice Returns the token supply cap.
140
+ /// @dev If minting is enabled, returns the configured supply cap defining the maximum number of NFTs that can be minted.
141
+ /// If minting is disabled, returns the current total supply as the effective cap (no more NFTs can be created).
142
+ function tokenSupplyCap() public view virtual override returns (uint256) {
143
+ return isMintable ? super.tokenSupplyCap() : totalSupply();
144
+ }
145
+
146
+ /// @dev Required override to resolve multiple inheritance. Calls every parent {supportsInterface} functions
147
+ /// via `super` to aggregate the interface IDs supported across all inherited modules.
148
+ function supportsInterface(
149
+ bytes4 interfaceId
150
+ )
151
+ public
152
+ view
153
+ virtual
154
+ override(
155
+ LSP8IdentifiableDigitalAssetInitAbstract,
156
+ LSP8MintableInitAbstract,
157
+ LSP8CappedBalanceInitAbstract,
158
+ LSP8NonTransferableInitAbstract,
159
+ LSP8RevokableInitAbstract
160
+ )
161
+ returns (bool)
162
+ {
163
+ return super.supportsInterface(interfaceId);
164
+ }
165
+
166
+ /// @dev Override to bypass the non transferable check when revokers revoke users' tokens.
167
+ function _nonTransferableCheck(
168
+ address from,
169
+ address to,
170
+ bytes32 tokenId,
171
+ bool force,
172
+ bytes memory data
173
+ ) internal virtual override {
174
+ if (_isRevocationBypass(to)) return;
175
+ super._nonTransferableCheck(from, to, tokenId, force, data);
176
+ }
177
+
178
+ /// @dev Override to bypass the token balance cap check when revokers revoke users' tokens.
179
+ function _tokenBalanceCapCheck(
180
+ address from,
181
+ address to,
182
+ bytes32 tokenId,
183
+ bool force,
184
+ bytes memory data
185
+ ) internal virtual override {
186
+ if (_isRevocationBypass(to)) return;
187
+ super._tokenBalanceCapCheck(from, to, tokenId, force, data);
188
+ }
189
+
190
+ /// @inheritdoc LSP8MintableInitAbstract
191
+ /// @dev Overridden function to allow minting only if:
192
+ /// - the minting feature is enabled, from {LSP8MintableInitAbstract}
193
+ /// - the total number of NFTs does not exceed the capped supply after minting, from {LSP8CappedSupplyInitAbstract}
194
+ function _mint(
195
+ address to,
196
+ bytes32 tokenId,
197
+ bool force,
198
+ bytes memory data
199
+ )
200
+ internal
201
+ virtual
202
+ override(
203
+ LSP8IdentifiableDigitalAssetInitAbstract,
204
+ LSP8MintableInitAbstract,
205
+ LSP8CappedSupplyInitAbstract
206
+ )
207
+ {
208
+ require(isMintable, LSP8MintDisabled());
209
+ LSP8CappedSupplyInitAbstract._mint(to, tokenId, force, data);
210
+ }
211
+
212
+ /// @notice Hook called before a token transfer to enforce restrictions.
213
+ /// @dev Combines checks from {LSP8CappedBalanceInitAbstract} and {LSP8NonTransferableInitAbstract}.
214
+ /// - Bypasses {LSP8NonTransferableInitAbstract} checks for senders (`from`) holding the `NON_TRANSFERABLE_BYPASS_ROLE` role.
215
+ /// - Bypasses {LSP8CappedBalanceInitAbstract} checks for recipients (`to`) holding the `UNCAPPED_BALANCE_ROLE` role.
216
+ /// - Allows minting (from address(0)) and burning to address(0) regardless of restrictions.
217
+ /// @param from The address sending the token.
218
+ /// @param to The address receiving the token.
219
+ /// @param tokenId The unique identifier of the token being transferred.
220
+ /// @param force Whether to force the transfer.
221
+ /// @param data Additional data for the transfer.
222
+ function _beforeTokenTransfer(
223
+ address from,
224
+ address to,
225
+ bytes32 tokenId,
226
+ bool force,
227
+ bytes memory data
228
+ )
229
+ internal
230
+ virtual
231
+ override(
232
+ LSP8IdentifiableDigitalAssetInitAbstract,
233
+ LSP8CappedBalanceInitAbstract,
234
+ LSP8NonTransferableInitAbstract
235
+ )
236
+ {
237
+ super._beforeTokenTransfer(from, to, tokenId, force, data);
238
+ }
239
+
240
+ /// @dev Required override to resolve multiple inheritance. Calls every parent {_transferOwnership} function
241
+ /// via `super` so that each inherited module updates its ownership-dependent state.
242
+ ///
243
+ /// When contract ownership changes, this will:
244
+ /// - clear the admin role for: `MINTER_ROLE`, `REVOKER_ROLE`, `NON_TRANSFERABLE_BYPASS_ROLE`, `UNCAPPED_BALANCE_ROLE`
245
+ /// - clear the list of addresses holding the `REVOKER_ROLE`
246
+ function _transferOwnership(
247
+ address newOwner
248
+ )
249
+ internal
250
+ virtual
251
+ override(
252
+ OwnableUpgradeable,
253
+ LSP8MintableInitAbstract,
254
+ LSP8CappedBalanceInitAbstract,
255
+ LSP8NonTransferableInitAbstract,
256
+ LSP8RevokableInitAbstract
257
+ )
258
+ {
259
+ super._transferOwnership(newOwner);
260
+ }
261
+
262
+ /// @dev Mint initial NFTs without enforcing check if the token contract is mintable or not.
263
+ /// Enforces the configured capped-supply value directly (not {tokenSupplyCap} when minting is disabled).
264
+ function _initialMint(
265
+ address to,
266
+ bytes32[] memory initialMintTokenIds
267
+ ) private {
268
+ uint256 configuredTokenSupplyCap = LSP8CappedSupplyInitAbstract
269
+ .tokenSupplyCap();
270
+ bool isCappedSupplyConfigured = configuredTokenSupplyCap > 0;
271
+
272
+ if (isCappedSupplyConfigured) {
273
+ bool mintingExceedsSupplyCap = initialMintTokenIds.length >
274
+ configuredTokenSupplyCap;
275
+
276
+ require(
277
+ !mintingExceedsSupplyCap,
278
+ LSP8CappedSupplyCannotMintOverCap()
279
+ );
280
+ }
281
+ for (uint256 ii = 0; ii < initialMintTokenIds.length; ++ii) {
282
+ LSP8IdentifiableDigitalAssetInitAbstract._mint(
283
+ to,
284
+ initialMintTokenIds[ii],
285
+ true,
286
+ ""
287
+ );
288
+
289
+ if (isCappedSupplyConfigured) {
290
+ // CHECK if the `to` address is a contract that minted more tokens
291
+ // through its `universalReceiver(...)` function after being notified via LSP1.
292
+ bool currentSupplyExceedsSupplyCap = totalSupply() >
293
+ configuredTokenSupplyCap;
294
+
295
+ require(
296
+ !currentSupplyExceedsSupplyCap,
297
+ LSP8CappedSupplyCannotMintOverCap()
298
+ );
299
+ }
300
+ }
301
+ }
302
+
303
+ /// @dev Returns whether the current call is a legitimate revocation that should bypass the
304
+ /// {LSP8NonTransferableInitAbstract} and {LSP8CappedBalanceInitAbstract} restrictions when revoking tokens from a token holder.
305
+ ///
306
+ /// Returns `true` only when all of the following conditions are met:
307
+ /// - the function being called is {revoke}.
308
+ /// - the revoking feature is enabled.
309
+ /// - the caller (`msg.sender`) holds the `REVOKER_ROLE`.
310
+ /// - the recipient (`to`) is either the contract `owner()` or a revoker (an address holding the `REVOKER_ROLE`).
311
+ function _isRevocationBypass(address to) private view returns (bool) {
312
+ return
313
+ msg.sig == this.revoke.selector &&
314
+ isRevokable() &&
315
+ hasRole(REVOKER_ROLE, msg.sender) &&
316
+ (to == owner() || hasRole(REVOKER_ROLE, to));
317
+ }
318
+ }
@@ -1,22 +1,24 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.12;
3
-
4
- // interfaces
5
- import {ILSP8Mintable} from "./ILSP8Mintable.sol";
2
+ pragma solidity ^0.8.27;
6
3
 
7
4
  // modules
8
5
  import {
9
6
  LSP8IdentifiableDigitalAsset
10
7
  } from "../LSP8IdentifiableDigitalAsset.sol";
8
+ import {
9
+ LSP8MintableAbstract
10
+ } from "../extensions/LSP8Mintable/LSP8MintableAbstract.sol";
11
+ import {
12
+ AccessControlExtendedAbstract
13
+ } from "../extensions/AccessControlExtended/AccessControlExtendedAbstract.sol";
11
14
 
12
15
  /**
13
- * @title LSP8IdentifiableDigitalAsset deployable preset contract with a public {mint} function callable only by the contract {owner}.
16
+ * @title LSP8IdentifiableDigitalAsset deployable preset contract with a public {mint} function callable by addresses holding `MINTER_ROLE`.
14
17
  */
15
- contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
18
+ contract LSP8Mintable is LSP8MintableAbstract {
16
19
  /**
17
- * @notice Deploying a `LSP8Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and
18
- * address `newOwner_` as the token contract owner.
19
- *
20
+ * @notice Deploying a `LSP8Mintable` token contract.
21
+ * @dev Set the token to be mintable to allow minting more tokens after deployment.
20
22
  * @param name_ The name of the token.
21
23
  * @param symbol_ The symbol of the token.
22
24
  * @param newOwner_ The owner of the token contract.
@@ -37,24 +39,7 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
37
39
  lsp4TokenType_,
38
40
  lsp8TokenIdFormat_
39
41
  )
42
+ AccessControlExtendedAbstract()
43
+ LSP8MintableAbstract(true)
40
44
  {}
41
-
42
- /**
43
- * @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
44
- *
45
- * @dev Public {_mint} function only callable by the {owner}.
46
- *
47
- * @param to The address that will receive the minted `tokenId`.
48
- * @param tokenId The tokenId to mint.
49
- * @param force Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting.
50
- * @param data Any addition data to be sent alongside the minting.
51
- */
52
- function mint(
53
- address to,
54
- bytes32 tokenId,
55
- bool force,
56
- bytes memory data
57
- ) public virtual override onlyOwner {
58
- _mint(to, tokenId, force, data);
59
- }
60
45
  }
@@ -1,11 +1,16 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.12;
2
+ pragma solidity ^0.8.27;
3
3
 
4
4
  // modules
5
- import {LSP8MintableInitAbstract} from "./LSP8MintableInitAbstract.sol";
5
+ import {
6
+ LSP8IdentifiableDigitalAssetInitAbstract
7
+ } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
8
+ import {
9
+ LSP8MintableInitAbstract
10
+ } from "../extensions/LSP8Mintable/LSP8MintableInitAbstract.sol";
6
11
 
7
12
  /**
8
- * @dev LSP8IdentifiableDigitalAsset deployable preset contract (proxy version) with a public {mint} function callable only by the contract {owner}.
13
+ * @dev LSP8IdentifiableDigitalAsset deployable preset contract (proxy version) with a public {mint} function callable by addresses holding `MINTER_ROLE`.
9
14
  */
10
15
  contract LSP8MintableInit is LSP8MintableInitAbstract {
11
16
  /**
@@ -26,18 +31,20 @@ contract LSP8MintableInit is LSP8MintableInitAbstract {
26
31
  * @param lsp8TokenIdFormat_ The format of tokenIds (= NFTs) that this contract will create.
27
32
  */
28
33
  function initialize(
29
- string memory name_,
30
- string memory symbol_,
34
+ string calldata name_,
35
+ string calldata symbol_,
31
36
  address newOwner_,
32
37
  uint256 lsp4TokenType_,
33
38
  uint256 lsp8TokenIdFormat_
34
39
  ) external virtual initializer {
35
- LSP8MintableInitAbstract._initialize(
40
+ LSP8IdentifiableDigitalAssetInitAbstract._initialize(
36
41
  name_,
37
42
  symbol_,
38
43
  newOwner_,
39
44
  lsp4TokenType_,
40
45
  lsp8TokenIdFormat_
41
46
  );
47
+ __AccessControlExtended_init();
48
+ __LSP8Mintable_init_unchained(true);
42
49
  }
43
50
  }