@lukso/lsp8-contracts 0.16.5 → 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 +55 -5
  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 +38 -15
  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
@@ -1,10 +1,25 @@
1
1
  'use strict';
2
2
 
3
3
  const INTERFACE_ID_LSP8 = "0x3a271706";
4
+ const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
4
5
  const INTERFACE_ID_LSP8_PREVIOUS = {
5
6
  "v0.14.0": "0xecad9f75",
6
7
  "v0.12.0": "0x30dc5278"
7
8
  };
9
+ const ROLES = {
10
+ // keccak256("MINTER_ROLE")
11
+ MINTER: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6",
12
+ // keccak256("UNCAPPED_BALANCE_ROLE")
13
+ UNCAPPED_BALANCE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad",
14
+ // keccak256("NON_TRANSFERABLE_BYPASS_ROLE")
15
+ NON_TRANSFERABLE_BYPASS: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659",
16
+ // keccak256("REVOKER_ROLE")
17
+ REVOKER: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30"
18
+ };
19
+ const MINTER_ROLE = ROLES.MINTER;
20
+ const UNCAPPED_BALANCE_ROLE = ROLES.UNCAPPED_BALANCE;
21
+ const NON_TRANSFERABLE_BYPASS_ROLE = ROLES.NON_TRANSFERABLE_BYPASS;
22
+ const REVOKER_ROLE = ROLES.REVOKER;
8
23
  const LSP8DataKeys = {
9
24
  LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d",
10
25
  LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843",
@@ -35,8 +50,14 @@ const LSP8_TOKEN_ID_FORMAT = {
35
50
  MIXED_DEFAULT_HASH: 104
36
51
  };
37
52
 
53
+ exports.INTERFACE_ID_ACCESS_CONTROL_EXTENDED = INTERFACE_ID_ACCESS_CONTROL_EXTENDED;
38
54
  exports.INTERFACE_ID_LSP8 = INTERFACE_ID_LSP8;
39
55
  exports.INTERFACE_ID_LSP8_PREVIOUS = INTERFACE_ID_LSP8_PREVIOUS;
40
56
  exports.LSP8DataKeys = LSP8DataKeys;
41
57
  exports.LSP8_TOKEN_ID_FORMAT = LSP8_TOKEN_ID_FORMAT;
42
58
  exports.LSP8_TYPE_IDS = LSP8_TYPE_IDS;
59
+ exports.MINTER_ROLE = MINTER_ROLE;
60
+ exports.NON_TRANSFERABLE_BYPASS_ROLE = NON_TRANSFERABLE_BYPASS_ROLE;
61
+ exports.REVOKER_ROLE = REVOKER_ROLE;
62
+ exports.ROLES = ROLES;
63
+ exports.UNCAPPED_BALANCE_ROLE = UNCAPPED_BALANCE_ROLE;
@@ -1,8 +1,19 @@
1
1
  declare const INTERFACE_ID_LSP8 = "0x3a271706";
2
+ declare const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  declare const INTERFACE_ID_LSP8_PREVIOUS: {
3
4
  'v0.14.0': string;
4
5
  'v0.12.0': string;
5
6
  };
7
+ declare const ROLES: {
8
+ readonly MINTER: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6";
9
+ readonly UNCAPPED_BALANCE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad";
10
+ readonly NON_TRANSFERABLE_BYPASS: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659";
11
+ readonly REVOKER: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30";
12
+ };
13
+ declare const MINTER_ROLE: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6";
14
+ declare const UNCAPPED_BALANCE_ROLE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad";
15
+ declare const NON_TRANSFERABLE_BYPASS_ROLE: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659";
16
+ declare const REVOKER_ROLE: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30";
6
17
  declare const LSP8DataKeys: {
7
18
  readonly LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
8
19
  readonly LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843";
@@ -32,4 +43,4 @@ declare const LSP8_TOKEN_ID_FORMAT: {
32
43
  readonly MIXED_DEFAULT_HASH: 104;
33
44
  };
34
45
 
35
- export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
46
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
@@ -1,8 +1,19 @@
1
1
  declare const INTERFACE_ID_LSP8 = "0x3a271706";
2
+ declare const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  declare const INTERFACE_ID_LSP8_PREVIOUS: {
3
4
  'v0.14.0': string;
4
5
  'v0.12.0': string;
5
6
  };
7
+ declare const ROLES: {
8
+ readonly MINTER: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6";
9
+ readonly UNCAPPED_BALANCE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad";
10
+ readonly NON_TRANSFERABLE_BYPASS: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659";
11
+ readonly REVOKER: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30";
12
+ };
13
+ declare const MINTER_ROLE: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6";
14
+ declare const UNCAPPED_BALANCE_ROLE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad";
15
+ declare const NON_TRANSFERABLE_BYPASS_ROLE: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659";
16
+ declare const REVOKER_ROLE: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30";
6
17
  declare const LSP8DataKeys: {
7
18
  readonly LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
8
19
  readonly LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843";
@@ -32,4 +43,4 @@ declare const LSP8_TOKEN_ID_FORMAT: {
32
43
  readonly MIXED_DEFAULT_HASH: 104;
33
44
  };
34
45
 
35
- export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
46
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
@@ -1,8 +1,19 @@
1
1
  declare const INTERFACE_ID_LSP8 = "0x3a271706";
2
+ declare const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  declare const INTERFACE_ID_LSP8_PREVIOUS: {
3
4
  'v0.14.0': string;
4
5
  'v0.12.0': string;
5
6
  };
7
+ declare const ROLES: {
8
+ readonly MINTER: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6";
9
+ readonly UNCAPPED_BALANCE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad";
10
+ readonly NON_TRANSFERABLE_BYPASS: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659";
11
+ readonly REVOKER: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30";
12
+ };
13
+ declare const MINTER_ROLE: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6";
14
+ declare const UNCAPPED_BALANCE_ROLE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad";
15
+ declare const NON_TRANSFERABLE_BYPASS_ROLE: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659";
16
+ declare const REVOKER_ROLE: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30";
6
17
  declare const LSP8DataKeys: {
7
18
  readonly LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
8
19
  readonly LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843";
@@ -32,4 +43,4 @@ declare const LSP8_TOKEN_ID_FORMAT: {
32
43
  readonly MIXED_DEFAULT_HASH: 104;
33
44
  };
34
45
 
35
- export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
46
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
@@ -1,8 +1,23 @@
1
1
  const INTERFACE_ID_LSP8 = "0x3a271706";
2
+ const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  const INTERFACE_ID_LSP8_PREVIOUS = {
3
4
  "v0.14.0": "0xecad9f75",
4
5
  "v0.12.0": "0x30dc5278"
5
6
  };
7
+ const ROLES = {
8
+ // keccak256("MINTER_ROLE")
9
+ MINTER: "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6",
10
+ // keccak256("UNCAPPED_BALANCE_ROLE")
11
+ UNCAPPED_BALANCE: "0x975773d1e0a917a74b57f36a377f439ffff6271648aebdbff75a52ab58eb7bad",
12
+ // keccak256("NON_TRANSFERABLE_BYPASS_ROLE")
13
+ NON_TRANSFERABLE_BYPASS: "0xb4b3a36d7c2b72add3151898671aaed843238e580f7d6d4bc5077ce2023b0659",
14
+ // keccak256("REVOKER_ROLE")
15
+ REVOKER: "0xce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee30"
16
+ };
17
+ const MINTER_ROLE = ROLES.MINTER;
18
+ const UNCAPPED_BALANCE_ROLE = ROLES.UNCAPPED_BALANCE;
19
+ const NON_TRANSFERABLE_BYPASS_ROLE = ROLES.NON_TRANSFERABLE_BYPASS;
20
+ const REVOKER_ROLE = ROLES.REVOKER;
6
21
  const LSP8DataKeys = {
7
22
  LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d",
8
23
  LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843",
@@ -33,4 +48,4 @@ const LSP8_TOKEN_ID_FORMAT = {
33
48
  MIXED_DEFAULT_HASH: 104
34
49
  };
35
50
 
36
- export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
51
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "@lukso/lsp8-contracts",
3
- "version": "0.16.5",
3
+ "version": "0.17.3",
4
4
  "description": "Package for the LSP8 Identifiable Digital Asset standard",
5
5
  "license": "Apache-2.0",
6
6
  "author": "",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/lukso-network/lsp-smart-contracts.git",
10
+ "directory": "packages/lsp8-contracts"
11
+ },
12
+ "type": "module",
7
13
  "keywords": [
8
14
  "LUKSO",
9
15
  "LSP",
@@ -27,39 +33,56 @@
27
33
  "typings": "./dist/constants.d.ts",
28
34
  "exports": {
29
35
  ".": {
36
+ "types": "./dist/constants.d.ts",
30
37
  "require": "./dist/constants.cjs",
31
- "import": "./dist/constants.mjs",
32
- "types": "./dist/constants.d.ts"
38
+ "import": "./dist/constants.mjs"
33
39
  },
34
40
  "./constants": {
41
+ "types": "./dist/constants.d.ts",
35
42
  "require": "./dist/constants.cjs",
36
- "import": "./dist/constants.mjs",
37
- "types": "./dist/constants.d.ts"
43
+ "import": "./dist/constants.mjs"
38
44
  },
39
45
  "./abi": {
46
+ "types": "./dist/abi.d.ts",
40
47
  "require": "./dist/abi.cjs",
41
- "import": "./dist/abi.mjs",
42
- "types": "./dist/abi.d.ts"
48
+ "import": "./dist/abi.mjs"
43
49
  },
44
50
  "./artifacts/*": "./artifacts/*",
45
51
  "./dist/*": "./dist/*",
46
- "./package.json": "./package.json"
52
+ "./package.json": "./package.json",
53
+ "./contracts/*": "./contracts/*"
47
54
  },
48
55
  "scripts": {
49
56
  "build": "hardhat compile --show-stack-traces",
50
57
  "build:js": "unbuild",
51
58
  "build:types": "wagmi generate",
52
- "clean": "hardhat clean && rm -Rf dist/ cache/ node_modules/ .turbo/ types/ typechain/ build/ artifacts/ abi.ts",
59
+ "clean": "rm -Rf dist/ cache/ node_modules/ .turbo/ types/ build/ artifacts/ abi.ts",
53
60
  "format": "prettier --write .",
54
61
  "lint": "eslint . --ext .ts,.js",
55
62
  "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
56
- "build:package": "hardhat prepare-package"
63
+ "build:package": "hardhat prepare-package",
64
+ "verify-balance": "npx hardhat verify-balance",
65
+ "deploy": "npx hardhat ignition deploy --verify",
66
+ "deploy:base": "npx hardhat ignition deploy ignition/modules/base.ts --strategy create2 --verify",
67
+ "test": "hardhat test --no-compile tests/*.test.ts",
68
+ "test:foundry": "FOUNDRY_PROFILE=lsp8 forge test -vvvv"
57
69
  },
58
70
  "dependencies": {
59
- "@openzeppelin/contracts": "^4.9.6",
60
- "@lukso/lsp1-contracts": "~0.15.0",
61
- "@lukso/lsp2-contracts": "~0.15.0",
62
- "@lukso/lsp4-contracts": "~0.16.0",
63
- "@lukso/lsp17contractextension-contracts": "~0.16.0"
71
+ "@lukso/lsp1-contracts": "~0.16.0",
72
+ "@lukso/lsp17contractextension-contracts": "~0.17.0",
73
+ "@lukso/lsp2-contracts": "~0.16.0",
74
+ "@lukso/lsp4-contracts": "~0.17.0",
75
+ "@openzeppelin/contracts": "^4.9.6"
76
+ },
77
+ "resolutions": {
78
+ "solidity-bytes-utils": "0.8.4"
79
+ },
80
+ "devDependencies": {
81
+ "@lukso/hardhat-packager-v3": "*",
82
+ "@lukso/hardhat-verify-balance": "*",
83
+ "@nomicfoundation/hardhat-ignition-ethers": "^3.0.0",
84
+ "@nomicfoundation/hardhat-toolbox-mocha-ethers": "^3.0.0",
85
+ "eslint-config-custom": "*",
86
+ "hardhat": "^3.1.2"
64
87
  }
65
88
  }
@@ -1,85 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.12;
3
-
4
- // modules
5
- import {
6
- LSP8IdentifiableDigitalAsset
7
- } from "../LSP8IdentifiableDigitalAsset.sol";
8
-
9
- /**
10
- * @dev LSP8 token extension to add a max token supply cap.
11
- */
12
- abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset {
13
- // --- Errors
14
-
15
- /**
16
- * @notice The `tokenSupplyCap` must be set and cannot be `0`.
17
- * @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
18
- */
19
- error LSP8CappedSupplyRequired();
20
-
21
- /**
22
- * @notice Cannot mint anymore as total supply reached the maximum cap.
23
- * @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
24
- */
25
- error LSP8CappedSupplyCannotMintOverCap();
26
-
27
- // --- Storage
28
- uint256 private immutable _TOKEN_SUPPLY_CAP;
29
-
30
- /**
31
- * @notice Deploying a `LSP8CappedSupply` token contract with max token supply cap set to `tokenSupplyCap_`.
32
- * @dev Deploy a `LSP8CappedSupply` token contract and set the maximum token supply token cap up to which
33
- * it is not possible to mint more tokens.
34
- *
35
- * @param tokenSupplyCap_ The maximum token supply.
36
- *
37
- * @custom:requirements
38
- * - `tokenSupplyCap_` MUST NOT be 0.
39
- */
40
- constructor(uint256 tokenSupplyCap_) {
41
- if (tokenSupplyCap_ == 0) {
42
- revert LSP8CappedSupplyRequired();
43
- }
44
-
45
- _TOKEN_SUPPLY_CAP = tokenSupplyCap_;
46
- }
47
-
48
- // --- Token queries
49
-
50
- /**
51
- * @notice The maximum supply amount of tokens allowed to exist is `_TOKEN_SUPPLY_CAP`.
52
- *
53
- * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
54
- * reaches {totalSupplyCap}, it is not possible to mint more tokens.
55
- *
56
- * @return The maximum number of tokens that can exist in the contract.
57
- */
58
- function tokenSupplyCap() public view virtual returns (uint256) {
59
- return _TOKEN_SUPPLY_CAP;
60
- }
61
-
62
- // --- Transfer functionality
63
-
64
- /**
65
- * @dev Same as {_mint} but allows to mint only if newly minted `tokenId` does not increase the {totalSupply}
66
- * over the {tokenSupplyCap}.
67
- * after a new `tokenId` has of tokens have been minted.
68
- *
69
- * @custom:requirements
70
- * - {totalSupply} + 1 must not be greater than the {tokenSupplyCap} when calling this function.
71
- * - `to` cannot be the zero address.
72
- */
73
- function _mint(
74
- address to,
75
- bytes32 tokenId,
76
- bool force,
77
- bytes memory data
78
- ) internal virtual override {
79
- if (totalSupply() + 1 > tokenSupplyCap()) {
80
- revert LSP8CappedSupplyCannotMintOverCap();
81
- }
82
-
83
- super._mint(to, tokenId, force, data);
84
- }
85
- }
@@ -1,88 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.12;
3
-
4
- // modules
5
- import {
6
- LSP8IdentifiableDigitalAssetInitAbstract
7
- } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
8
-
9
- /**
10
- * @dev LSP8 token extension to add a max token supply cap.
11
- */
12
- abstract contract LSP8CappedSupplyInitAbstract is
13
- LSP8IdentifiableDigitalAssetInitAbstract
14
- {
15
- // --- Errors
16
-
17
- /**
18
- * @notice The `tokenSupplyCap` must be set and cannot be `0`.
19
- * @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
20
- */
21
- error LSP8CappedSupplyRequired();
22
-
23
- /**
24
- * @notice Cannot mint anymore as total supply reached the maximum cap.
25
- * @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
26
- */
27
- error LSP8CappedSupplyCannotMintOverCap();
28
-
29
- // --- Storage
30
- uint256 private _tokenSupplyCap;
31
-
32
- /**
33
- * @dev Initialize a `LSP8CappedSupplyInitAbstract` token contract and set the maximum token supply token cap up to which
34
- * it is not possible to mint more tokens.
35
- *
36
- * @param tokenSupplyCap_ The maximum token supply.
37
- *
38
- * @custom:requirements
39
- * - `tokenSupplyCap_` MUST NOT be 0.
40
- */
41
- function _initialize(
42
- uint256 tokenSupplyCap_
43
- ) internal virtual onlyInitializing {
44
- if (tokenSupplyCap_ == 0) {
45
- revert LSP8CappedSupplyRequired();
46
- }
47
-
48
- _tokenSupplyCap = tokenSupplyCap_;
49
- }
50
-
51
- // --- Token queries
52
-
53
- /**
54
- * @notice The maximum supply amount of tokens allowed to exist is `_tokenSupplyCap`.
55
- *
56
- * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
57
- * reaches {totalSupplyCap}, it is not possible to mint more tokens.
58
- *
59
- * @return The maximum number of tokens that can exist in the contract.
60
- */
61
- function tokenSupplyCap() public view virtual returns (uint256) {
62
- return _tokenSupplyCap;
63
- }
64
-
65
- // --- Transfer functionality
66
-
67
- /**
68
- * @dev Same as {_mint} but allows to mint only if newly minted `tokenId` does not increase the {totalSupply}
69
- * over the {tokenSupplyCap}.
70
- * after a new `tokenId` has of tokens have been minted.
71
- *
72
- * @custom:requirements
73
- * - {totalSupply} + 1 must not be greater than the {tokenSupplyCap} when calling this function.
74
- * - `to` cannot be the zero address.
75
- */
76
- function _mint(
77
- address to,
78
- bytes32 tokenId,
79
- bool force,
80
- bytes memory data
81
- ) internal virtual override {
82
- if (totalSupply() + 1 > tokenSupplyCap()) {
83
- revert LSP8CappedSupplyCannotMintOverCap();
84
- }
85
-
86
- super._mint(to, tokenId, force, data);
87
- }
88
- }
@@ -1,33 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.4;
3
-
4
- // interfaces
5
- import {
6
- ILSP8IdentifiableDigitalAsset
7
- } from "../ILSP8IdentifiableDigitalAsset.sol";
8
-
9
- /**
10
- * @dev LSP8 extension, mintable.
11
- */
12
- interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
13
- /**
14
- * @param to The address to mint tokens
15
- * @param tokenId The tokenId to mint
16
- * @param force When set to TRUE, to may be any address but
17
- * when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
18
- * @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
19
- * @dev Mints `amount` tokens and transfers it to `to`.
20
- *
21
- * Requirements:
22
- *
23
- * - `to` cannot be the zero address.
24
- *
25
- * Emits a {Transfer} event.
26
- */
27
- function mint(
28
- address to,
29
- bytes32 tokenId,
30
- bool force,
31
- bytes memory data
32
- ) external;
33
- }
@@ -1,62 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.12;
3
-
4
- // interfaces
5
- import {ILSP8Mintable} from "./ILSP8Mintable.sol";
6
- // modules
7
- import {
8
- LSP8IdentifiableDigitalAssetInitAbstract
9
- } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
10
-
11
- /**
12
- * @dev LSP8IdentifiableDigitalAsset deployable preset contract (inheritable proxy version) with a public {mint} function callable only by the contract {owner}.
13
- */
14
- abstract contract LSP8MintableInitAbstract is
15
- LSP8IdentifiableDigitalAssetInitAbstract,
16
- ILSP8Mintable
17
- {
18
- /**
19
- * @notice Initialize a `LSP7MintableInitAbstract` token contract with: token name = `name_`, token symbol = `symbol_`, and
20
- * address `newOwner_` as the token contract owner.
21
- *
22
- * @param name_ The name of the token.
23
- * @param symbol_ The symbol of the token.
24
- * @param newOwner_ The owner of the token contract.
25
- * @param lsp4TokenType_ The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection).
26
- * @param lsp8TokenIdFormat_ The format of tokenIds (= NFTs) that this contract will create.
27
- */
28
- function _initialize(
29
- string memory name_,
30
- string memory symbol_,
31
- address newOwner_,
32
- uint256 lsp4TokenType_,
33
- uint256 lsp8TokenIdFormat_
34
- ) internal virtual override onlyInitializing {
35
- LSP8IdentifiableDigitalAssetInitAbstract._initialize(
36
- name_,
37
- symbol_,
38
- newOwner_,
39
- lsp4TokenType_,
40
- lsp8TokenIdFormat_
41
- );
42
- }
43
-
44
- /**
45
- * @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
46
- *
47
- * @dev Public {_mint} function only callable by the {owner}.
48
- *
49
- * @param to The address that will receive the minted `tokenId`.
50
- * @param tokenId The tokenId to mint.
51
- * @param force Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting.
52
- * @param data Any addition data to be sent alongside the minting.
53
- */
54
- function mint(
55
- address to,
56
- bytes32 tokenId,
57
- bool force,
58
- bytes memory data
59
- ) public virtual override onlyOwner {
60
- _mint(to, tokenId, force, data);
61
- }
62
- }