@lukso/lsp8-contracts 0.15.0 → 0.16.2

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 (45) hide show
  1. package/README.md +2 -2
  2. package/artifacts/ILSP8IdentifiableDigitalAsset.json +0 -112
  3. package/artifacts/LSP8Burnable.json +0 -11
  4. package/artifacts/LSP8BurnableInitAbstract.json +0 -16
  5. package/artifacts/LSP8CappedSupply.json +0 -11
  6. package/artifacts/LSP8CappedSupplyInitAbstract.json +0 -16
  7. package/artifacts/LSP8Enumerable.json +0 -11
  8. package/artifacts/LSP8EnumerableInitAbstract.json +0 -16
  9. package/artifacts/LSP8IdentifiableDigitalAsset.json +0 -11
  10. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +0 -16
  11. package/artifacts/LSP8Mintable.json +2 -13
  12. package/artifacts/LSP8MintableInit.json +2 -13
  13. package/artifacts/LSP8Votes.json +1230 -0
  14. package/artifacts/LSP8VotesInitAbstract.json +1222 -0
  15. package/contracts/ILSP8IdentifiableDigitalAsset.sol +2 -8
  16. package/contracts/LSP8Constants.sol +4 -0
  17. package/contracts/LSP8IdentifiableDigitalAsset.sol +796 -36
  18. package/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol +806 -36
  19. package/contracts/extensions/LSP8CappedSupply.sol +1 -1
  20. package/contracts/extensions/LSP8CappedSupplyInitAbstract.sol +1 -1
  21. package/contracts/extensions/LSP8Enumerable.sol +6 -5
  22. package/contracts/extensions/LSP8EnumerableInitAbstract.sol +5 -5
  23. package/contracts/extensions/LSP8Votes.sol +94 -0
  24. package/contracts/extensions/LSP8VotesConstants.sol +8 -0
  25. package/contracts/extensions/LSP8VotesInitAbstract.sol +116 -0
  26. package/dist/index.cjs +5 -1
  27. package/dist/index.d.cts +18 -16
  28. package/dist/index.d.mts +18 -16
  29. package/dist/index.d.ts +18 -16
  30. package/dist/index.mjs +5 -1
  31. package/package.json +5 -6
  32. package/types/index.ts +3958 -1854
  33. package/contracts/LSP8IdentifiableDigitalAssetCore.sol +0 -809
  34. package/types/common.ts +0 -131
  35. package/types/contracts/ILSP8IdentifiableDigitalAsset.ts +0 -706
  36. package/types/contracts/LSP8IdentifiableDigitalAsset.ts +0 -778
  37. package/types/contracts/LSP8IdentifiableDigitalAssetInitAbstract.ts +0 -813
  38. package/types/contracts/extensions/LSP8Burnable.ts +0 -797
  39. package/types/contracts/extensions/LSP8BurnableInitAbstract.ts +0 -829
  40. package/types/contracts/extensions/LSP8CappedSupply.ts +0 -792
  41. package/types/contracts/extensions/LSP8CappedSupplyInitAbstract.ts +0 -824
  42. package/types/contracts/extensions/LSP8Enumerable.ts +0 -790
  43. package/types/contracts/extensions/LSP8EnumerableInitAbstract.ts +0 -821
  44. package/types/contracts/presets/LSP8Mintable.ts +0 -797
  45. package/types/contracts/presets/LSP8MintableInit.ts +0 -860
@@ -51,7 +51,7 @@ abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset {
51
51
  * @notice The maximum supply amount of tokens allowed to exist is `_TOKEN_SUPPLY_CAP`.
52
52
  *
53
53
  * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
54
- * reaches {totalSuuplyCap}, it is not possible to mint more tokens.
54
+ * reaches {totalSupplyCap}, it is not possible to mint more tokens.
55
55
  *
56
56
  * @return The maximum number of tokens that can exist in the contract.
57
57
  */
@@ -54,7 +54,7 @@ abstract contract LSP8CappedSupplyInitAbstract is
54
54
  * @notice The maximum supply amount of tokens allowed to exist is `_tokenSupplyCap`.
55
55
  *
56
56
  * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
57
- * reaches {totalSuuplyCap}, it is not possible to mint more tokens.
57
+ * reaches {totalSupplyCap}, it is not possible to mint more tokens.
58
58
  *
59
59
  * @return The maximum number of tokens that can exist in the contract.
60
60
  */
@@ -3,8 +3,7 @@ pragma solidity ^0.8.12;
3
3
 
4
4
  // modules
5
5
  import {
6
- LSP8IdentifiableDigitalAsset,
7
- LSP8IdentifiableDigitalAssetCore
6
+ LSP8IdentifiableDigitalAsset
8
7
  } from "../LSP8IdentifiableDigitalAsset.sol";
9
8
 
10
9
  /**
@@ -31,19 +30,21 @@ abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
31
30
  }
32
31
 
33
32
  /**
34
- * @inheritdoc LSP8IdentifiableDigitalAssetCore
33
+ * @inheritdoc LSP8IdentifiableDigitalAsset
35
34
  *
36
35
  * @param from The address sending the `tokenId` (`address(0)` when `tokenId` is being minted).
37
36
  * @param to The address receiving the `tokenId` (`address(0)` when `tokenId` is being burnt).
38
37
  * @param tokenId The bytes32 identifier of the token being transferred.
38
+ * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not.
39
39
  * @param data The data sent alongside the the token transfer.
40
40
  */
41
41
  function _beforeTokenTransfer(
42
42
  address from,
43
43
  address to,
44
44
  bytes32 tokenId,
45
+ bool force,
45
46
  bytes memory data
46
- ) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
47
+ ) internal virtual override {
47
48
  // `tokenId` being minted
48
49
  if (from == address(0)) {
49
50
  uint256 index = totalSupply();
@@ -64,6 +65,6 @@ abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
64
65
  delete _tokenIndex[tokenId];
65
66
  }
66
67
 
67
- super._beforeTokenTransfer(from, to, tokenId, data);
68
+ super._beforeTokenTransfer(from, to, tokenId, force, data);
68
69
  }
69
70
  }
@@ -3,8 +3,7 @@ pragma solidity ^0.8.12;
3
3
 
4
4
  // modules
5
5
  import {
6
- LSP8IdentifiableDigitalAssetInitAbstract,
7
- LSP8IdentifiableDigitalAssetCore
6
+ LSP8IdentifiableDigitalAssetInitAbstract
8
7
  } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
9
8
 
10
9
  /**
@@ -31,7 +30,7 @@ abstract contract LSP8EnumerableInitAbstract is
31
30
  }
32
31
 
33
32
  /**
34
- * @inheritdoc LSP8IdentifiableDigitalAssetCore
33
+ * @inheritdoc LSP8IdentifiableDigitalAssetInitAbstract
35
34
  *
36
35
  * @param from The address sending the `tokenId` (`address(0)` when `tokenId` is being minted).
37
36
  * @param to The address receiving the `tokenId` (`address(0)` when `tokenId` is being burnt).
@@ -42,8 +41,9 @@ abstract contract LSP8EnumerableInitAbstract is
42
41
  address from,
43
42
  address to,
44
43
  bytes32 tokenId,
44
+ bool force,
45
45
  bytes memory data
46
- ) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
46
+ ) internal virtual override {
47
47
  if (from == address(0)) {
48
48
  uint256 index = totalSupply();
49
49
  _indexToken[index] = tokenId;
@@ -59,6 +59,6 @@ abstract contract LSP8EnumerableInitAbstract is
59
59
  delete _indexToken[lastIndex];
60
60
  delete _tokenIndex[tokenId];
61
61
  }
62
- super._beforeTokenTransfer(from, to, tokenId, data);
62
+ super._beforeTokenTransfer(from, to, tokenId, force, data);
63
63
  }
64
64
  }
@@ -0,0 +1,94 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^0.8.0;
4
+
5
+ import {
6
+ LSP8IdentifiableDigitalAsset
7
+ } from "../LSP8IdentifiableDigitalAsset.sol";
8
+ import {Votes} from "@openzeppelin/contracts/governance/utils/Votes.sol";
9
+ import {
10
+ _TYPEID_LSP8_VOTESDELEGATOR,
11
+ _TYPEID_LSP8_VOTESDELEGATEE
12
+ } from "./LSP8VotesConstants.sol";
13
+ import {LSP1Utils} from "@lukso/lsp1-contracts/contracts/LSP1Utils.sol";
14
+
15
+ /**
16
+ * @dev Extension of LSP8 to support voting and delegation as implemented by {Votes}, where each individual NFT counts
17
+ * as 1 vote unit.
18
+ *
19
+ * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost
20
+ * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of
21
+ * the votes in governance decisions, or they can delegate to themselves to be their own representative.
22
+ */
23
+ abstract contract LSP8Votes is LSP8IdentifiableDigitalAsset, Votes {
24
+ /**
25
+ * @dev Adjusts votes when tokens are transferred.
26
+ *
27
+ * @custom:events {DelegateVotesChanged} event.
28
+ */
29
+ function _afterTokenTransfer(
30
+ address from,
31
+ address to,
32
+ bytes32 tokenId,
33
+ bool force,
34
+ bytes memory data
35
+ ) internal virtual override {
36
+ _transferVotingUnits(from, to, 1);
37
+ super._afterTokenTransfer(from, to, tokenId, force, data);
38
+ }
39
+
40
+ /**
41
+ * @dev Returns the balance of `account`.
42
+ *
43
+ * @custom:warning Overriding this function will likely result in incorrect vote tracking.
44
+ */
45
+ function _getVotingUnits(
46
+ address account
47
+ ) internal view virtual override returns (uint256) {
48
+ return balanceOf(account);
49
+ }
50
+
51
+ /**
52
+ * @dev Override of the {_delegate} function that includes notification via LSP1.
53
+ * The delegator and delegatee are both notified via their `universalReceiver(...)` function if they contracts implementing the LSP1 interface.
54
+ *
55
+ * @custom:events {DelegateChanged} event.
56
+ */
57
+ function _delegate(
58
+ address delegator,
59
+ address delegatee
60
+ ) internal virtual override {
61
+ uint256 delegatorBalance = balanceOf(delegator);
62
+
63
+ super._delegate(delegator, delegatee);
64
+
65
+ // Notify the delegator if it's not address(0)
66
+ if (delegator != address(0)) {
67
+ bytes memory delegatorNotificationData = abi.encode(
68
+ msg.sender,
69
+ delegatee,
70
+ delegatorBalance
71
+ );
72
+ LSP1Utils.notifyUniversalReceiver(
73
+ delegator,
74
+ _TYPEID_LSP8_VOTESDELEGATOR,
75
+ delegatorNotificationData
76
+ );
77
+ }
78
+
79
+ // Only notify the new delegatee if it's not address(0) and if there's actual voting power
80
+ if (delegatee != address(0) && delegatorBalance > 0) {
81
+ bytes memory delegateeNotificationData = abi.encode(
82
+ msg.sender,
83
+ delegator,
84
+ delegatorBalance
85
+ );
86
+
87
+ LSP1Utils.notifyUniversalReceiver(
88
+ delegatee,
89
+ _TYPEID_LSP8_VOTESDELEGATEE,
90
+ delegateeNotificationData
91
+ );
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,8 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.4;
3
+
4
+ // keccak256('LSP8Tokens_VotesDelegatorNotification')
5
+ bytes32 constant _TYPEID_LSP8_VOTESDELEGATOR = 0x2f6d3f668c2e57dbae4c255f2d9e0b69d47a8848d69a2251cce137529e34743e;
6
+
7
+ // keccak256('LSP8Tokens_VotesDelegateeNotification')
8
+ bytes32 constant _TYPEID_LSP8_VOTESDELEGATEE = 0x19419598f788eae88574bbb83ec563ad0cb43cd7ddbbc88857b2efa2d8faa8eb;
@@ -0,0 +1,116 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.0;
3
+
4
+ import {
5
+ LSP8IdentifiableDigitalAssetInitAbstract
6
+ } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
7
+ import {
8
+ VotesUpgradeable
9
+ } from "@openzeppelin/contracts-upgradeable/governance/utils/VotesUpgradeable.sol";
10
+ import {
11
+ _TYPEID_LSP8_VOTESDELEGATOR,
12
+ _TYPEID_LSP8_VOTESDELEGATEE
13
+ } from "./LSP8VotesConstants.sol";
14
+ import {LSP1Utils} from "@lukso/lsp1-contracts/contracts/LSP1Utils.sol";
15
+
16
+ /**
17
+ * @dev Extension of LSP8 to support voting and delegation as implemented by {Votes}, where each individual NFT counts
18
+ * as 1 vote unit.
19
+ *
20
+ * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost
21
+ * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of
22
+ * the votes in governance decisions, or they can delegate to themselves to be their own representative.
23
+ */
24
+ abstract contract LSP8VotesInitAbstract is
25
+ LSP8IdentifiableDigitalAssetInitAbstract,
26
+ VotesUpgradeable
27
+ {
28
+ function _initialize(
29
+ string memory name_,
30
+ string memory symbol_,
31
+ address newOwner_,
32
+ uint256 tokenIdType_,
33
+ uint256 tokenIdFormat_,
34
+ string memory version_
35
+ ) internal virtual onlyInitializing {
36
+ LSP8IdentifiableDigitalAssetInitAbstract._initialize(
37
+ name_,
38
+ symbol_,
39
+ newOwner_,
40
+ tokenIdType_,
41
+ tokenIdFormat_
42
+ );
43
+ __EIP712_init(name_, version_);
44
+ }
45
+
46
+ /**
47
+ * @dev Adjusts votes when tokens are transferred.
48
+ *
49
+ * Emits a {IVotes-DelegateVotesChanged} event.
50
+ */
51
+ function _afterTokenTransfer(
52
+ address from,
53
+ address to,
54
+ bytes32 tokenId,
55
+ bool force,
56
+ bytes memory data
57
+ ) internal virtual override {
58
+ _transferVotingUnits(from, to, 1);
59
+ super._afterTokenTransfer(from, to, tokenId, force, data);
60
+ }
61
+
62
+ /**
63
+ * @dev Returns the balance of `account`.
64
+ *
65
+ * @custom:warning Overriding this function will likely result in incorrect vote tracking.
66
+ */
67
+ function _getVotingUnits(
68
+ address account
69
+ ) internal view virtual override returns (uint256) {
70
+ return balanceOf(account);
71
+ }
72
+
73
+ /**
74
+ * @dev Override of the {_delegate} function that includes notification via LSP1.
75
+ * The delegator and delegatee are both notified via their `universalReceiver(...)` function if they contracts implementing the LSP1 interface.
76
+ *
77
+ * @custom:events {DelegateChanged} event.
78
+ */
79
+ function _delegate(
80
+ address delegator,
81
+ address delegatee
82
+ ) internal virtual override {
83
+ uint256 delegatorBalance = balanceOf(delegator);
84
+
85
+ super._delegate(delegator, delegatee);
86
+
87
+ // Notify the delegator if it's not address(0)
88
+ if (delegator != address(0)) {
89
+ bytes memory delegatorNotificationData = abi.encode(
90
+ msg.sender,
91
+ delegatee,
92
+ delegatorBalance
93
+ );
94
+ LSP1Utils.notifyUniversalReceiver(
95
+ delegator,
96
+ _TYPEID_LSP8_VOTESDELEGATOR,
97
+ delegatorNotificationData
98
+ );
99
+ }
100
+
101
+ // Only notify the new delegatee if it's not address(0) and if there's actual voting power
102
+ if (delegatee != address(0) && delegatorBalance > 0) {
103
+ bytes memory delegateeNotificationData = abi.encode(
104
+ msg.sender,
105
+ delegator,
106
+ delegatorBalance
107
+ );
108
+
109
+ LSP1Utils.notifyUniversalReceiver(
110
+ delegatee,
111
+ _TYPEID_LSP8_VOTESDELEGATEE,
112
+ delegateeNotificationData
113
+ );
114
+ }
115
+ }
116
+ }
package/dist/index.cjs CHANGED
@@ -16,7 +16,11 @@ const LSP8_TYPE_IDS = {
16
16
  // keccak256('LSP8Tokens_RecipientNotification')
17
17
  LSP8Tokens_RecipientNotification: "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d",
18
18
  // keccak256('LSP8Tokens_OperatorNotification')
19
- LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970"
19
+ LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970",
20
+ // keccak256('LSP8Tokens_VotesDelegateeNotification')
21
+ LSP8Tokens_VotesDelegateeNotification: "0x19419598f788eae88574bbb83ec563ad0cb43cd7ddbbc88857b2efa2d8faa8eb",
22
+ // keccak256('LSP8Tokens_VotesDelegatorNotification')
23
+ LSP8Tokens_VotesDelegatorNotification: "0x2f6d3f668c2e57dbae4c255f2d9e0b69d47a8848d69a2251cce137529e34743e"
20
24
  };
21
25
  const LSP8_TOKEN_ID_FORMAT = {
22
26
  NUMBER: 0,
package/dist/index.d.cts CHANGED
@@ -4,30 +4,32 @@ declare const INTERFACE_ID_LSP8_PREVIOUS: {
4
4
  'v0.12.0': string;
5
5
  };
6
6
  declare const LSP8DataKeys: {
7
- LSP8TokenIdFormat: string;
8
- LSP8TokenMetadataBaseURI: string;
9
- LSP8ReferenceContract: string;
7
+ readonly LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
8
+ readonly LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843";
9
+ readonly LSP8ReferenceContract: "0x708e7b881795f2e6b6c2752108c177ec89248458de3bf69d0d43480b3e5034e6";
10
10
  };
11
11
  declare const LSP8_TYPE_IDS: {
12
- LSP8Tokens_SenderNotification: string;
13
- LSP8Tokens_RecipientNotification: string;
14
- LSP8Tokens_OperatorNotification: string;
12
+ readonly LSP8Tokens_SenderNotification: "0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00";
13
+ readonly LSP8Tokens_RecipientNotification: "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d";
14
+ readonly LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970";
15
+ readonly LSP8Tokens_VotesDelegateeNotification: "0x19419598f788eae88574bbb83ec563ad0cb43cd7ddbbc88857b2efa2d8faa8eb";
16
+ readonly LSP8Tokens_VotesDelegatorNotification: "0x2f6d3f668c2e57dbae4c255f2d9e0b69d47a8848d69a2251cce137529e34743e";
15
17
  };
16
18
  /**
17
19
  * @dev List of LSP8 Token ID Formats that can be used to create different types of NFTs and represent each NFT identifiers (= tokenIds) differently.
18
20
  * @see For details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformat
19
21
  */
20
22
  declare const LSP8_TOKEN_ID_FORMAT: {
21
- NUMBER: number;
22
- STRING: number;
23
- ADDRESS: number;
24
- UNIQUE_ID: number;
25
- HASH: number;
26
- MIXED_DEFAULT_NUMBER: number;
27
- MIXED_DEFAULT_STRING: number;
28
- MIXED_DEFAULT_ADDRESS: number;
29
- MIXED_DEFAULT_UNIQUE_ID: number;
30
- MIXED_DEFAULT_HASH: number;
23
+ readonly NUMBER: 0;
24
+ readonly STRING: 1;
25
+ readonly ADDRESS: 2;
26
+ readonly UNIQUE_ID: 3;
27
+ readonly HASH: 4;
28
+ readonly MIXED_DEFAULT_NUMBER: 100;
29
+ readonly MIXED_DEFAULT_STRING: 101;
30
+ readonly MIXED_DEFAULT_ADDRESS: 102;
31
+ readonly MIXED_DEFAULT_UNIQUE_ID: 103;
32
+ readonly MIXED_DEFAULT_HASH: 104;
31
33
  };
32
34
 
33
35
  export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
package/dist/index.d.mts CHANGED
@@ -4,30 +4,32 @@ declare const INTERFACE_ID_LSP8_PREVIOUS: {
4
4
  'v0.12.0': string;
5
5
  };
6
6
  declare const LSP8DataKeys: {
7
- LSP8TokenIdFormat: string;
8
- LSP8TokenMetadataBaseURI: string;
9
- LSP8ReferenceContract: string;
7
+ readonly LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
8
+ readonly LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843";
9
+ readonly LSP8ReferenceContract: "0x708e7b881795f2e6b6c2752108c177ec89248458de3bf69d0d43480b3e5034e6";
10
10
  };
11
11
  declare const LSP8_TYPE_IDS: {
12
- LSP8Tokens_SenderNotification: string;
13
- LSP8Tokens_RecipientNotification: string;
14
- LSP8Tokens_OperatorNotification: string;
12
+ readonly LSP8Tokens_SenderNotification: "0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00";
13
+ readonly LSP8Tokens_RecipientNotification: "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d";
14
+ readonly LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970";
15
+ readonly LSP8Tokens_VotesDelegateeNotification: "0x19419598f788eae88574bbb83ec563ad0cb43cd7ddbbc88857b2efa2d8faa8eb";
16
+ readonly LSP8Tokens_VotesDelegatorNotification: "0x2f6d3f668c2e57dbae4c255f2d9e0b69d47a8848d69a2251cce137529e34743e";
15
17
  };
16
18
  /**
17
19
  * @dev List of LSP8 Token ID Formats that can be used to create different types of NFTs and represent each NFT identifiers (= tokenIds) differently.
18
20
  * @see For details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformat
19
21
  */
20
22
  declare const LSP8_TOKEN_ID_FORMAT: {
21
- NUMBER: number;
22
- STRING: number;
23
- ADDRESS: number;
24
- UNIQUE_ID: number;
25
- HASH: number;
26
- MIXED_DEFAULT_NUMBER: number;
27
- MIXED_DEFAULT_STRING: number;
28
- MIXED_DEFAULT_ADDRESS: number;
29
- MIXED_DEFAULT_UNIQUE_ID: number;
30
- MIXED_DEFAULT_HASH: number;
23
+ readonly NUMBER: 0;
24
+ readonly STRING: 1;
25
+ readonly ADDRESS: 2;
26
+ readonly UNIQUE_ID: 3;
27
+ readonly HASH: 4;
28
+ readonly MIXED_DEFAULT_NUMBER: 100;
29
+ readonly MIXED_DEFAULT_STRING: 101;
30
+ readonly MIXED_DEFAULT_ADDRESS: 102;
31
+ readonly MIXED_DEFAULT_UNIQUE_ID: 103;
32
+ readonly MIXED_DEFAULT_HASH: 104;
31
33
  };
32
34
 
33
35
  export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
package/dist/index.d.ts CHANGED
@@ -4,30 +4,32 @@ declare const INTERFACE_ID_LSP8_PREVIOUS: {
4
4
  'v0.12.0': string;
5
5
  };
6
6
  declare const LSP8DataKeys: {
7
- LSP8TokenIdFormat: string;
8
- LSP8TokenMetadataBaseURI: string;
9
- LSP8ReferenceContract: string;
7
+ readonly LSP8TokenIdFormat: "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
8
+ readonly LSP8TokenMetadataBaseURI: "0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843";
9
+ readonly LSP8ReferenceContract: "0x708e7b881795f2e6b6c2752108c177ec89248458de3bf69d0d43480b3e5034e6";
10
10
  };
11
11
  declare const LSP8_TYPE_IDS: {
12
- LSP8Tokens_SenderNotification: string;
13
- LSP8Tokens_RecipientNotification: string;
14
- LSP8Tokens_OperatorNotification: string;
12
+ readonly LSP8Tokens_SenderNotification: "0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00";
13
+ readonly LSP8Tokens_RecipientNotification: "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d";
14
+ readonly LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970";
15
+ readonly LSP8Tokens_VotesDelegateeNotification: "0x19419598f788eae88574bbb83ec563ad0cb43cd7ddbbc88857b2efa2d8faa8eb";
16
+ readonly LSP8Tokens_VotesDelegatorNotification: "0x2f6d3f668c2e57dbae4c255f2d9e0b69d47a8848d69a2251cce137529e34743e";
15
17
  };
16
18
  /**
17
19
  * @dev List of LSP8 Token ID Formats that can be used to create different types of NFTs and represent each NFT identifiers (= tokenIds) differently.
18
20
  * @see For details see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md#lsp8tokenidformat
19
21
  */
20
22
  declare const LSP8_TOKEN_ID_FORMAT: {
21
- NUMBER: number;
22
- STRING: number;
23
- ADDRESS: number;
24
- UNIQUE_ID: number;
25
- HASH: number;
26
- MIXED_DEFAULT_NUMBER: number;
27
- MIXED_DEFAULT_STRING: number;
28
- MIXED_DEFAULT_ADDRESS: number;
29
- MIXED_DEFAULT_UNIQUE_ID: number;
30
- MIXED_DEFAULT_HASH: number;
23
+ readonly NUMBER: 0;
24
+ readonly STRING: 1;
25
+ readonly ADDRESS: 2;
26
+ readonly UNIQUE_ID: 3;
27
+ readonly HASH: 4;
28
+ readonly MIXED_DEFAULT_NUMBER: 100;
29
+ readonly MIXED_DEFAULT_STRING: 101;
30
+ readonly MIXED_DEFAULT_ADDRESS: 102;
31
+ readonly MIXED_DEFAULT_UNIQUE_ID: 103;
32
+ readonly MIXED_DEFAULT_HASH: 104;
31
33
  };
32
34
 
33
35
  export { INTERFACE_ID_LSP8, INTERFACE_ID_LSP8_PREVIOUS, LSP8DataKeys, LSP8_TOKEN_ID_FORMAT, LSP8_TYPE_IDS };
package/dist/index.mjs CHANGED
@@ -14,7 +14,11 @@ const LSP8_TYPE_IDS = {
14
14
  // keccak256('LSP8Tokens_RecipientNotification')
15
15
  LSP8Tokens_RecipientNotification: "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d",
16
16
  // keccak256('LSP8Tokens_OperatorNotification')
17
- LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970"
17
+ LSP8Tokens_OperatorNotification: "0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970",
18
+ // keccak256('LSP8Tokens_VotesDelegateeNotification')
19
+ LSP8Tokens_VotesDelegateeNotification: "0x19419598f788eae88574bbb83ec563ad0cb43cd7ddbbc88857b2efa2d8faa8eb",
20
+ // keccak256('LSP8Tokens_VotesDelegatorNotification')
21
+ LSP8Tokens_VotesDelegatorNotification: "0x2f6d3f668c2e57dbae4c255f2d9e0b69d47a8848d69a2251cce137529e34743e"
18
22
  };
19
23
  const LSP8_TOKEN_ID_FORMAT = {
20
24
  NUMBER: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/lsp8-contracts",
3
- "version": "0.15.0",
3
+ "version": "0.16.2",
4
4
  "description": "Package for the LSP8 Identifiable Digital Asset standard",
5
5
  "license": "Apache-2.0",
6
6
  "author": "",
@@ -40,18 +40,17 @@
40
40
  "build": "hardhat compile --show-stack-traces",
41
41
  "build:js": "unbuild",
42
42
  "build:types": "npx wagmi generate",
43
- "clean": "hardhat clean && rm -Rf dist/",
43
+ "clean": "hardhat clean && rm -Rf dist/ cache/ node_modules/ .turbo/ types/ typechain/ build/ artifacts/",
44
44
  "format": "prettier --write .",
45
45
  "lint": "eslint . --ext .ts,.js",
46
46
  "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
47
47
  "package": "hardhat prepare-package"
48
48
  },
49
49
  "dependencies": {
50
- "@erc725/smart-contracts": "^7.0.0",
51
- "@openzeppelin/contracts": "^4.9.3",
50
+ "@openzeppelin/contracts": "^4.9.6",
52
51
  "@lukso/lsp1-contracts": "~0.15.0",
53
52
  "@lukso/lsp2-contracts": "~0.15.0",
54
- "@lukso/lsp4-contracts": "~0.15.0",
55
- "@lukso/lsp17contractextension-contracts": "~0.15.0"
53
+ "@lukso/lsp4-contracts": "~0.16.0",
54
+ "@lukso/lsp17contractextension-contracts": "~0.16.0"
56
55
  }
57
56
  }