@lukso/lsp7-contracts 0.16.6 → 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 (82) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +56 -6
  3. package/artifacts/IAccessControlExtended.json +285 -0
  4. package/artifacts/ILSP7CappedBalance.json +27 -0
  5. package/artifacts/ILSP7CappedSupply.json +27 -0
  6. package/artifacts/ILSP7DigitalAsset.json +6 -3
  7. package/artifacts/ILSP7Mintable.json +62 -0
  8. package/artifacts/ILSP7NonTransferable.json +110 -0
  9. package/artifacts/ILSP7Revokable.json +75 -0
  10. package/artifacts/LSP7Burnable.json +7 -4
  11. package/artifacts/LSP7BurnableInitAbstract.json +7 -4
  12. package/artifacts/LSP7CappedBalanceAbstract.json +1159 -0
  13. package/artifacts/LSP7CappedBalanceInitAbstract.json +1167 -0
  14. package/artifacts/{LSP7CappedSupply.json → LSP7CappedSupplyAbstract.json} +8 -15
  15. package/artifacts/LSP7CappedSupplyInitAbstract.json +7 -14
  16. package/artifacts/LSP7CustomizableToken.json +1604 -0
  17. package/artifacts/LSP7CustomizableTokenInit.json +1601 -0
  18. package/artifacts/LSP7DigitalAsset.json +6 -3
  19. package/artifacts/LSP7DigitalAssetInitAbstract.json +6 -3
  20. package/artifacts/LSP7Mintable.json +376 -5
  21. package/artifacts/LSP7MintableAbstract.json +1186 -0
  22. package/artifacts/LSP7MintableInit.json +369 -5
  23. package/artifacts/LSP7MintableInitAbstract.json +1194 -0
  24. package/artifacts/LSP7NonTransferableAbstract.json +1236 -0
  25. package/artifacts/LSP7NonTransferableInitAbstract.json +1244 -0
  26. package/artifacts/LSP7RevokableAbstract.json +1186 -0
  27. package/artifacts/LSP7RevokableInitAbstract.json +1194 -0
  28. package/artifacts/LSP7Votes.json +66 -4
  29. package/artifacts/LSP7VotesInitAbstract.json +66 -4
  30. package/contracts/LSP7DigitalAsset.sol +56 -65
  31. package/contracts/LSP7DigitalAssetInitAbstract.sol +49 -71
  32. package/contracts/extensions/AccessControlExtended/AccessControlExtendedAbstract.sol +368 -0
  33. package/contracts/extensions/AccessControlExtended/AccessControlExtendedConstants.sol +13 -0
  34. package/contracts/extensions/AccessControlExtended/AccessControlExtendedErrors.sol +23 -0
  35. package/contracts/extensions/AccessControlExtended/AccessControlExtendedInitAbstract.sol +389 -0
  36. package/contracts/extensions/AccessControlExtended/IAccessControlExtended.sol +51 -0
  37. package/contracts/extensions/{LSP7Burnable.sol → LSP7Burnable/LSP7Burnable.sol} +2 -2
  38. package/contracts/extensions/{LSP7BurnableInitAbstract.sol → LSP7Burnable/LSP7BurnableInitAbstract.sol} +2 -4
  39. package/contracts/extensions/LSP7CappedBalance/ILSP7CappedBalance.sol +11 -0
  40. package/contracts/extensions/LSP7CappedBalance/LSP7CappedBalanceAbstract.sol +129 -0
  41. package/contracts/extensions/LSP7CappedBalance/LSP7CappedBalanceErrors.sol +10 -0
  42. package/contracts/extensions/LSP7CappedBalance/LSP7CappedBalanceInitAbstract.sol +179 -0
  43. package/contracts/extensions/LSP7CappedSupply/ILSP7CappedSupply.sol +11 -0
  44. package/contracts/extensions/LSP7CappedSupply/LSP7CappedSupplyAbstract.sol +56 -0
  45. package/contracts/extensions/LSP7CappedSupply/LSP7CappedSupplyErrors.sol +6 -0
  46. package/contracts/extensions/LSP7CappedSupply/LSP7CappedSupplyInitAbstract.sol +96 -0
  47. package/contracts/extensions/LSP7Mintable/ILSP7Mintable.sol +27 -0
  48. package/contracts/extensions/LSP7Mintable/LSP7MintableAbstract.sol +105 -0
  49. package/contracts/extensions/LSP7Mintable/LSP7MintableErrors.sol +5 -0
  50. package/contracts/extensions/LSP7Mintable/LSP7MintableInitAbstract.sol +156 -0
  51. package/contracts/extensions/LSP7NonTransferable/ILSP7NonTransferable.sol +48 -0
  52. package/contracts/extensions/LSP7NonTransferable/LSP7NonTransferableAbstract.sol +183 -0
  53. package/contracts/extensions/LSP7NonTransferable/LSP7NonTransferableErrors.sol +14 -0
  54. package/contracts/extensions/LSP7NonTransferable/LSP7NonTransferableInitAbstract.sol +240 -0
  55. package/contracts/extensions/LSP7Revokable/ILSP7Revokable.sol +28 -0
  56. package/contracts/extensions/LSP7Revokable/LSP7RevokableAbstract.sol +130 -0
  57. package/contracts/extensions/LSP7Revokable/LSP7RevokableErrors.sol +4 -0
  58. package/contracts/extensions/LSP7Revokable/LSP7RevokableInitAbstract.sol +183 -0
  59. package/contracts/extensions/{LSP7Votes.sol → LSP7Votes/LSP7Votes.sol} +37 -20
  60. package/contracts/extensions/LSP7Votes/LSP7VotesErrors.sol +24 -0
  61. package/contracts/extensions/{LSP7VotesInitAbstract.sol → LSP7Votes/LSP7VotesInitAbstract.sol} +37 -21
  62. package/contracts/presets/LSP7CustomizableToken.sol +262 -0
  63. package/contracts/presets/LSP7CustomizableTokenConstants.sol +32 -0
  64. package/contracts/presets/LSP7CustomizableTokenInit.sol +294 -0
  65. package/contracts/presets/LSP7Mintable.sol +14 -23
  66. package/contracts/presets/LSP7MintableInit.sol +16 -11
  67. package/dist/abi.cjs +7519 -54
  68. package/dist/abi.d.cts +11109 -338
  69. package/dist/abi.d.mts +11109 -338
  70. package/dist/abi.d.ts +11109 -338
  71. package/dist/abi.mjs +7503 -54
  72. package/dist/constants.cjs +21 -0
  73. package/dist/constants.d.cts +12 -1
  74. package/dist/constants.d.mts +12 -1
  75. package/dist/constants.d.ts +12 -1
  76. package/dist/constants.mjs +16 -1
  77. package/package.json +39 -15
  78. package/contracts/extensions/LSP7CappedSupply.sol +0 -83
  79. package/contracts/extensions/LSP7CappedSupplyInitAbstract.sol +0 -86
  80. package/contracts/presets/ILSP7Mintable.sol +0 -32
  81. package/contracts/presets/LSP7MintableInitAbstract.sol +0 -57
  82. /package/contracts/extensions/{LSP7VotesConstants.sol → LSP7Votes/LSP7VotesConstants.sol} +0 -0
@@ -1,10 +1,25 @@
1
1
  'use strict';
2
2
 
3
3
  const INTERFACE_ID_LSP7 = "0xc52d6008";
4
+ const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
4
5
  const INTERFACE_ID_LSP7_PREVIOUS = {
5
6
  "v0.14.0": "0xb3c4928f",
6
7
  "v0.12.0": "0xdaa746b7"
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 LSP7_TYPE_IDS = {
9
24
  // keccak256('LSP7Tokens_SenderNotification')
10
25
  LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea",
@@ -18,6 +33,12 @@ const LSP7_TYPE_IDS = {
18
33
  LSP7Tokens_VotesDelegateeNotification: "0x72cad372b29cde295ff0839b7b194597766b88f5fad4f7d6aef013e0c55dc492"
19
34
  };
20
35
 
36
+ exports.INTERFACE_ID_ACCESS_CONTROL_EXTENDED = INTERFACE_ID_ACCESS_CONTROL_EXTENDED;
21
37
  exports.INTERFACE_ID_LSP7 = INTERFACE_ID_LSP7;
22
38
  exports.INTERFACE_ID_LSP7_PREVIOUS = INTERFACE_ID_LSP7_PREVIOUS;
23
39
  exports.LSP7_TYPE_IDS = LSP7_TYPE_IDS;
40
+ exports.MINTER_ROLE = MINTER_ROLE;
41
+ exports.NON_TRANSFERABLE_BYPASS_ROLE = NON_TRANSFERABLE_BYPASS_ROLE;
42
+ exports.REVOKER_ROLE = REVOKER_ROLE;
43
+ exports.ROLES = ROLES;
44
+ exports.UNCAPPED_BALANCE_ROLE = UNCAPPED_BALANCE_ROLE;
@@ -1,8 +1,19 @@
1
1
  declare const INTERFACE_ID_LSP7 = "0xc52d6008";
2
+ declare const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  declare const INTERFACE_ID_LSP7_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 LSP7_TYPE_IDS: {
7
18
  readonly LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea";
8
19
  readonly LSP7Tokens_RecipientNotification: "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c";
@@ -11,4 +22,4 @@ declare const LSP7_TYPE_IDS: {
11
22
  readonly LSP7Tokens_VotesDelegateeNotification: "0x72cad372b29cde295ff0839b7b194597766b88f5fad4f7d6aef013e0c55dc492";
12
23
  };
13
24
 
14
- export { INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS };
25
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
@@ -1,8 +1,19 @@
1
1
  declare const INTERFACE_ID_LSP7 = "0xc52d6008";
2
+ declare const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  declare const INTERFACE_ID_LSP7_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 LSP7_TYPE_IDS: {
7
18
  readonly LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea";
8
19
  readonly LSP7Tokens_RecipientNotification: "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c";
@@ -11,4 +22,4 @@ declare const LSP7_TYPE_IDS: {
11
22
  readonly LSP7Tokens_VotesDelegateeNotification: "0x72cad372b29cde295ff0839b7b194597766b88f5fad4f7d6aef013e0c55dc492";
12
23
  };
13
24
 
14
- export { INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS };
25
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
@@ -1,8 +1,19 @@
1
1
  declare const INTERFACE_ID_LSP7 = "0xc52d6008";
2
+ declare const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  declare const INTERFACE_ID_LSP7_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 LSP7_TYPE_IDS: {
7
18
  readonly LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea";
8
19
  readonly LSP7Tokens_RecipientNotification: "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c";
@@ -11,4 +22,4 @@ declare const LSP7_TYPE_IDS: {
11
22
  readonly LSP7Tokens_VotesDelegateeNotification: "0x72cad372b29cde295ff0839b7b194597766b88f5fad4f7d6aef013e0c55dc492";
12
23
  };
13
24
 
14
- export { INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS };
25
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS, MINTER_ROLE, NON_TRANSFERABLE_BYPASS_ROLE, REVOKER_ROLE, ROLES, UNCAPPED_BALANCE_ROLE };
@@ -1,8 +1,23 @@
1
1
  const INTERFACE_ID_LSP7 = "0xc52d6008";
2
+ const INTERFACE_ID_ACCESS_CONTROL_EXTENDED = "0x90832245";
2
3
  const INTERFACE_ID_LSP7_PREVIOUS = {
3
4
  "v0.14.0": "0xb3c4928f",
4
5
  "v0.12.0": "0xdaa746b7"
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 LSP7_TYPE_IDS = {
7
22
  // keccak256('LSP7Tokens_SenderNotification')
8
23
  LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea",
@@ -16,4 +31,4 @@ const LSP7_TYPE_IDS = {
16
31
  LSP7Tokens_VotesDelegateeNotification: "0x72cad372b29cde295ff0839b7b194597766b88f5fad4f7d6aef013e0c55dc492"
17
32
  };
18
33
 
19
- export { INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_TYPE_IDS };
34
+ export { INTERFACE_ID_ACCESS_CONTROL_EXTENDED, INTERFACE_ID_LSP7, INTERFACE_ID_LSP7_PREVIOUS, LSP7_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/lsp7-contracts",
3
- "version": "0.16.6",
3
+ "version": "0.17.3",
4
4
  "description": "Package for the LSP7 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/lsp7-contracts"
11
+ },
12
+ "type": "module",
7
13
  "keywords": [
8
14
  "LUKSO",
9
15
  "LSP",
@@ -27,39 +33,57 @@
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",
57
+ "build:foundry": "forge build",
50
58
  "build:js": "unbuild",
51
59
  "build:types": "wagmi generate",
52
- "clean": "hardhat clean && rm -Rf dist/ cache/ node_modules/ .turbo/ types/ typechain/ build/ artifacts/ abi.ts",
60
+ "clean": "rm -Rf dist/ cache/ node_modules/ .turbo/ types/ build/ artifacts/ abi.ts",
53
61
  "format": "prettier --write .",
54
62
  "lint": "eslint . --ext .ts,.js",
55
63
  "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
56
- "build:package": "hardhat prepare-package"
64
+ "test": "hardhat test --no-compile tests/*.test.ts",
65
+ "test:foundry": "FOUNDRY_PROFILE=lsp7 forge test -vvvv",
66
+ "build:package": "hardhat prepare-package",
67
+ "verify-balance": "npx hardhat verify-balance",
68
+ "deploy": "npx hardhat ignition deploy --verify",
69
+ "deploy:base": "npx hardhat ignition deploy ignition/modules/base.ts --strategy create2 --verify"
57
70
  },
58
71
  "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"
72
+ "@lukso/lsp1-contracts": "~0.16.0",
73
+ "@lukso/lsp17contractextension-contracts": "~0.17.0",
74
+ "@lukso/lsp2-contracts": "~0.16.0",
75
+ "@lukso/lsp4-contracts": "~0.17.0",
76
+ "@openzeppelin/contracts": "^4.9.6"
77
+ },
78
+ "resolutions": {
79
+ "solidity-bytes-utils": "0.8.4"
80
+ },
81
+ "devDependencies": {
82
+ "@lukso/hardhat-packager-v3": "*",
83
+ "@lukso/hardhat-verify-balance": "*",
84
+ "@nomicfoundation/hardhat-ignition-ethers": "^3.0.0",
85
+ "@nomicfoundation/hardhat-toolbox-mocha-ethers": "^3.0.0",
86
+ "eslint-config-custom": "*",
87
+ "hardhat": "^3.1.2"
64
88
  }
65
89
  }
@@ -1,83 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
-
3
- pragma solidity ^0.8.4;
4
-
5
- // modules
6
- import {LSP7DigitalAsset} from "../LSP7DigitalAsset.sol";
7
-
8
- /**
9
- * @dev LSP7 token extension to add a max token supply cap.
10
- */
11
- abstract contract LSP7CappedSupply is LSP7DigitalAsset {
12
- // --- Errors
13
-
14
- /**
15
- * @notice The `tokenSupplyCap` must be set and cannot be `0`.
16
- * @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
17
- */
18
- error LSP7CappedSupplyRequired();
19
-
20
- /**
21
- * @notice Cannot mint anymore as total supply reached the maximum cap.
22
- * @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
23
- */
24
- error LSP7CappedSupplyCannotMintOverCap();
25
-
26
- // --- Storage
27
- uint256 private immutable _TOKEN_SUPPLY_CAP;
28
-
29
- /**
30
- * @notice Deploying a `LSP7CappedSupply` token contract with max token supply cap set to `tokenSupplyCap_`.
31
- * @dev Deploy a `LSP7CappedSupply` token contract and set the maximum token supply token cap up to which
32
- * it is not possible to mint more tokens.
33
- *
34
- * @param tokenSupplyCap_ The maximum token supply.
35
- *
36
- * @custom:requirements
37
- * - `tokenSupplyCap_` MUST NOT be 0.
38
- */
39
- constructor(uint256 tokenSupplyCap_) {
40
- if (tokenSupplyCap_ == 0) {
41
- revert LSP7CappedSupplyRequired();
42
- }
43
-
44
- _TOKEN_SUPPLY_CAP = tokenSupplyCap_;
45
- }
46
-
47
- // --- Token queries
48
-
49
- /**
50
- * @notice The maximum supply amount of tokens allowed to exist is `_TOKEN_SUPPLY_CAP`.
51
- *
52
- * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
53
- * reaches {totalSupplyCap}, it is not possible to mint more tokens.
54
- *
55
- * @return The maximum number of tokens that can exist in the contract.
56
- */
57
- function tokenSupplyCap() public view virtual returns (uint256) {
58
- return _TOKEN_SUPPLY_CAP;
59
- }
60
-
61
- // --- Transfer functionality
62
-
63
- /**
64
- * @dev Same as {_mint} but allows to mint only if the {totalSupply} does not exceed the {tokenSupplyCap}
65
- * after `amount` of tokens have been minted.
66
- *
67
- * @custom:requirements
68
- * - {tokenSupplyCap} - {totalSupply} must be greater than zero.
69
- * - `to` cannot be the zero address.
70
- */
71
- function _mint(
72
- address to,
73
- uint256 amount,
74
- bool force,
75
- bytes memory data
76
- ) internal virtual override {
77
- if (totalSupply() + amount > tokenSupplyCap()) {
78
- revert LSP7CappedSupplyCannotMintOverCap();
79
- }
80
-
81
- super._mint(to, amount, force, data);
82
- }
83
- }
@@ -1,86 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
-
3
- pragma solidity ^0.8.4;
4
-
5
- // modules
6
- import {
7
- LSP7DigitalAssetInitAbstract
8
- } from "../LSP7DigitalAssetInitAbstract.sol";
9
-
10
- /**
11
- * @dev LSP7 token extension to add a max token supply cap (proxy version).
12
- */
13
- abstract contract LSP7CappedSupplyInitAbstract is LSP7DigitalAssetInitAbstract {
14
- // --- Errors
15
-
16
- /**
17
- * @notice The `tokenSupplyCap` must be set and cannot be `0`.
18
- * @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
19
- */
20
- error LSP7CappedSupplyRequired();
21
-
22
- /**
23
- * @notice Cannot mint anymore as total supply reached the maximum cap.
24
- * @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
25
- */
26
- error LSP7CappedSupplyCannotMintOverCap();
27
-
28
- // --- Storage
29
- uint256 private _tokenSupplyCap;
30
-
31
- /**
32
- * @notice Deploying a `LSP7CappedSupply` token contract with max token supply cap set to `tokenSupplyCap_`.
33
- * @dev Deploy a `LSP7CappedSupply` 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 LSP7CappedSupplyRequired();
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
- * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
56
- * reaches {totalSupplyCap}, it is not possible to mint more tokens.
57
- *
58
- * @return The maximum number of tokens that can exist in the contract.
59
- */
60
- function tokenSupplyCap() public view virtual returns (uint256) {
61
- return _tokenSupplyCap;
62
- }
63
-
64
- // --- Transfer functionality
65
-
66
- /**
67
- * @dev Same as {_mint} but allows to mint only if the {totalSupply} does not exceed the {tokenSupplyCap}
68
- * after `amount` of tokens have been minted.
69
- *
70
- * @custom:requirements
71
- * - {tokenSupplyCap} - {totalSupply} must be greater than zero.
72
- * - `to` cannot be the zero address.
73
- */
74
- function _mint(
75
- address to,
76
- uint256 amount,
77
- bool force,
78
- bytes memory data
79
- ) internal virtual override {
80
- if (totalSupply() + amount > tokenSupplyCap()) {
81
- revert LSP7CappedSupplyCannotMintOverCap();
82
- }
83
-
84
- super._mint(to, amount, force, data);
85
- }
86
- }
@@ -1,32 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
-
3
- pragma solidity ^0.8.4;
4
-
5
- // interfaces
6
- import {ILSP7DigitalAsset} from "../ILSP7DigitalAsset.sol";
7
-
8
- /**
9
- * @dev LSP7 extension, Mintable version.
10
- */
11
- interface ILSP7Mintable is ILSP7DigitalAsset {
12
- /**
13
- * @param to The address to mint tokens
14
- * @param amount The amount to mint
15
- * @param force When set to TRUE, to may be any address but
16
- * when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
17
- * @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
18
- * @dev Mints `amount` tokens and transfers it to `to`.
19
- *
20
- * Requirements:
21
- *
22
- * - `to` cannot be the zero address.
23
- *
24
- * Emits a {Transfer} event.
25
- */
26
- function mint(
27
- address to,
28
- uint256 amount,
29
- bool force,
30
- bytes memory data
31
- ) external;
32
- }
@@ -1,57 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
-
3
- pragma solidity ^0.8.4;
4
-
5
- // interfaces
6
- import {ILSP7Mintable} from "./ILSP7Mintable.sol";
7
-
8
- // modules
9
- import {
10
- LSP7DigitalAssetInitAbstract
11
- } from "../LSP7DigitalAssetInitAbstract.sol";
12
-
13
- /**
14
- * @dev LSP7DigitalAsset deployable preset contract (inheritable proxy version) with a public {mint} function callable only by the contract {owner}.
15
- */
16
- abstract contract LSP7MintableInitAbstract is
17
- LSP7DigitalAssetInitAbstract,
18
- ILSP7Mintable
19
- {
20
- /**
21
- * @notice Initialize a `LSP7MintableInitAbstract` token contract with: token name = `name_`, token symbol = `symbol_`, and
22
- * address `newOwner_` as the token contract owner.
23
- *
24
- * @param name_ The name of the token.
25
- * @param symbol_ The symbol of the token.
26
- * @param newOwner_ The owner of the token contract.
27
- * @param lsp4TokenType_ The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection).
28
- * @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token.
29
- */
30
- function _initialize(
31
- string memory name_,
32
- string memory symbol_,
33
- address newOwner_,
34
- uint256 lsp4TokenType_,
35
- bool isNonDivisible_
36
- ) internal virtual override onlyInitializing {
37
- LSP7DigitalAssetInitAbstract._initialize(
38
- name_,
39
- symbol_,
40
- newOwner_,
41
- lsp4TokenType_,
42
- isNonDivisible_
43
- );
44
- }
45
-
46
- /**
47
- * @dev Public {_mint} function only callable by the {owner}.
48
- */
49
- function mint(
50
- address to,
51
- uint256 amount,
52
- bool force,
53
- bytes memory data
54
- ) public virtual override onlyOwner {
55
- _mint(to, amount, force, data);
56
- }
57
- }