@lukso/lsp-smart-contracts 0.7.0 → 0.8.0

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 (164) hide show
  1. package/CONTRIBUTING.md +31 -0
  2. package/README.md +73 -20
  3. package/artifacts/Create2Factory.json +2 -2
  4. package/artifacts/LSP0ERC725Account.json +194 -15
  5. package/artifacts/LSP0ERC725AccountInit.json +194 -15
  6. package/artifacts/LSP11BasicSocialRecovery.json +493 -0
  7. package/artifacts/LSP11BasicSocialRecoveryInit.json +513 -0
  8. package/artifacts/LSP16UniversalFactory.json +236 -0
  9. package/artifacts/LSP1UniversalReceiverDelegateUP.json +134 -15
  10. package/artifacts/LSP1UniversalReceiverDelegateVault.json +80 -15
  11. package/artifacts/LSP4Compatibility.json +16 -0
  12. package/artifacts/LSP4DigitalAssetMetadata.json +16 -0
  13. package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +16 -0
  14. package/artifacts/LSP6KeyManager.json +177 -33
  15. package/artifacts/LSP6KeyManagerInit.json +177 -33
  16. package/artifacts/LSP7CappedSupply.json +21 -5
  17. package/artifacts/LSP7CappedSupplyInitAbstract.json +21 -5
  18. package/artifacts/LSP7CompatibleERC20.json +21 -5
  19. package/artifacts/LSP7CompatibleERC20InitAbstract.json +23 -7
  20. package/artifacts/LSP7CompatibleERC20Mintable.json +24 -8
  21. package/artifacts/LSP7CompatibleERC20MintableInit.json +24 -8
  22. package/artifacts/LSP7DigitalAsset.json +21 -5
  23. package/artifacts/LSP7DigitalAssetInitAbstract.json +21 -5
  24. package/artifacts/LSP7Mintable.json +24 -8
  25. package/artifacts/LSP7MintableInit.json +24 -8
  26. package/artifacts/LSP8CappedSupply.json +22 -6
  27. package/artifacts/LSP8CappedSupplyInitAbstract.json +22 -6
  28. package/artifacts/LSP8CompatibleERC721.json +23 -7
  29. package/artifacts/LSP8CompatibleERC721InitAbstract.json +25 -9
  30. package/artifacts/LSP8CompatibleERC721Mintable.json +26 -10
  31. package/artifacts/LSP8CompatibleERC721MintableInit.json +26 -10
  32. package/artifacts/LSP8IdentifiableDigitalAsset.json +22 -6
  33. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +22 -6
  34. package/artifacts/LSP8Mintable.json +25 -9
  35. package/artifacts/LSP8MintableInit.json +25 -9
  36. package/artifacts/LSP9Vault.json +202 -17
  37. package/artifacts/LSP9VaultInit.json +202 -17
  38. package/artifacts/UniversalProfile.json +194 -15
  39. package/artifacts/UniversalProfileInit.json +194 -15
  40. package/artifacts/UniversalReceiverAddressStore.json +3 -3
  41. package/constants.js +377 -115
  42. package/contracts/Custom/EIP191Signer.sol +12 -0
  43. package/contracts/Factories/Create2Factory.sol +1 -3
  44. package/contracts/LSP0ERC725Account/LSP0Constants.sol +13 -2
  45. package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +2 -1
  46. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +261 -63
  47. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +2 -2
  48. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +2 -1
  49. package/contracts/LSP10ReceivedVaults/LSP10Constants.sol +2 -2
  50. package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +214 -0
  51. package/contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol +177 -0
  52. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol +23 -0
  53. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +258 -0
  54. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol +26 -0
  55. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol +19 -0
  56. package/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol +6 -0
  57. package/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol +60 -0
  58. package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +53 -0
  59. package/contracts/LSP14Ownable2Step/LSP14Constants.sol +15 -0
  60. package/contracts/LSP14Ownable2Step/LSP14Errors.sol +12 -0
  61. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +212 -0
  62. package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +246 -0
  63. package/contracts/LSP17ContractExtension/LSP17Constants.sol +17 -0
  64. package/contracts/LSP17ContractExtension/LSP17Errors.sol +7 -0
  65. package/contracts/LSP17ContractExtension/LSP17Extendable.sol +104 -0
  66. package/contracts/LSP17ContractExtension/LSP17Extension.sol +45 -0
  67. package/contracts/LSP17ContractExtension/LSP17Utils.sol +20 -0
  68. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +5 -5
  69. package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +5 -3
  70. package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +21 -0
  71. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +157 -37
  72. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +64 -31
  73. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +53 -40
  74. package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +45 -23
  75. package/contracts/LSP3UniversalProfile/LSP3Constants.sol +1 -1
  76. package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +1 -1
  77. package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +1 -1
  78. package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -1
  79. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +2 -2
  80. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +2 -2
  81. package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +3 -3
  82. package/contracts/LSP5ReceivedAssets/LSP5Constants.sol +2 -2
  83. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +102 -114
  84. package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +25 -7
  85. package/contracts/LSP6KeyManager/LSP6Constants.sol +43 -38
  86. package/contracts/LSP6KeyManager/LSP6Errors.sol +90 -21
  87. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +2 -1
  88. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +772 -364
  89. package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +1 -1
  90. package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +3 -2
  91. package/contracts/LSP6KeyManager/LSP6Utils.sol +125 -34
  92. package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +8 -8
  93. package/contracts/LSP7DigitalAsset/LSP7Constants.sol +6 -6
  94. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +1 -1
  95. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +38 -34
  96. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +1 -1
  97. package/contracts/LSP7DigitalAsset/LSP7Errors.sol +28 -1
  98. package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +1 -1
  99. package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +24 -0
  100. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +28 -8
  101. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +28 -11
  102. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +87 -20
  103. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +97 -19
  104. package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +3 -3
  105. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +3 -4
  106. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +2 -2
  107. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +3 -3
  108. package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +3 -5
  109. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +2 -2
  110. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +3 -3
  111. package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +7 -7
  112. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +7 -7
  113. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +40 -2
  114. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +2 -2
  115. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +53 -50
  116. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +1 -1
  117. package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +5 -2
  118. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +20 -0
  119. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +27 -7
  120. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +27 -10
  121. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +236 -30
  122. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +240 -30
  123. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +32 -4
  124. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +35 -8
  125. package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +3 -3
  126. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +3 -4
  127. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +3 -3
  128. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +3 -3
  129. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +3 -4
  130. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +2 -2
  131. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +3 -3
  132. package/contracts/LSP9Vault/LSP9Constants.sol +10 -10
  133. package/contracts/LSP9Vault/LSP9Errors.sol +8 -0
  134. package/contracts/LSP9Vault/LSP9Vault.sol +6 -4
  135. package/contracts/LSP9Vault/LSP9VaultCore.sol +289 -126
  136. package/contracts/LSP9Vault/LSP9VaultInit.sol +2 -2
  137. package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +4 -3
  138. package/contracts/Legacy/Registries/AddressRegistry.sol +1 -1
  139. package/contracts/Legacy/Registries/AddressRegistryRequiresERC725.sol +1 -1
  140. package/contracts/Legacy/UniversalReceiverAddressStore.sol +4 -14
  141. package/contracts/UniversalProfile.sol +2 -2
  142. package/contracts/UniversalProfileInit.sol +2 -2
  143. package/contracts/UniversalProfileInitAbstract.sol +1 -1
  144. package/contracts/Utils/GasLib.sol +1 -1
  145. package/package.json +17 -9
  146. package/artifacts/UniversalFactory.json +0 -127
  147. package/contracts/Custom/ClaimOwnership.sol +0 -96
  148. package/contracts/Custom/ERC165Checker.sol +0 -130
  149. package/contracts/Custom/IClaimOwnership.sol +0 -12
  150. package/contracts/Factories/UniversalFactory.sol +0 -159
  151. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +0 -24
  152. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/Handling/TokenAndVaultHandling.sol +0 -82
  153. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/Handling/TokenHandling.sol +0 -73
  154. package/contracts/LSP2ERC725YJSONSchema/LSP2Errors.sol +0 -9
  155. package/contracts/LSP7DigitalAsset/extensions/ILSP7CappedSupply.sol +0 -17
  156. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyCore.sol +0 -57
  157. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20Core.sol +0 -111
  158. package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CappedSupply.sol +0 -17
  159. package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8Enumerable.sol +0 -17
  160. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyCore.sol +0 -58
  161. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleConstants.sol +0 -6
  162. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721Core.sol +0 -211
  163. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableCore.sol +0 -50
  164. package/contracts/Utils/UtilsLib.sol +0 -31
@@ -1,21 +1,49 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity ^0.8.0;
3
+ pragma solidity ^0.8.4;
4
4
 
5
5
  // modules
6
6
  import {LSP8IdentifiableDigitalAsset} from "../LSP8IdentifiableDigitalAsset.sol";
7
7
  import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
8
- import {LSP8EnumerableCore} from "./LSP8EnumerableCore.sol";
9
8
 
10
9
  /**
11
10
  * @dev LSP8 extension.
12
11
  */
13
- abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset, LSP8EnumerableCore {
12
+ abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
13
+ // Mapping from token index to token id
14
+ mapping(uint256 => bytes32) private _indexToken;
15
+
16
+ // Mapping from token id to index
17
+ mapping(bytes32 => uint256) private _tokenIndex;
18
+
19
+ /**
20
+ * @dev Returns a token id at index. See totalSupply() to get total number of minted tokens.
21
+ * @return TokenId or 0x00 if no token exist at the index `index`
22
+ */
23
+ function tokenAt(uint256 index) public view returns (bytes32) {
24
+ return _indexToken[index];
25
+ }
26
+
14
27
  function _beforeTokenTransfer(
15
28
  address from,
16
29
  address to,
17
30
  bytes32 tokenId
18
- ) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8EnumerableCore) {
31
+ ) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
32
+ if (from == address(0)) {
33
+ uint256 index = _existingTokens;
34
+ _indexToken[index] = tokenId;
35
+ _tokenIndex[tokenId] = index;
36
+ } else if (to == address(0)) {
37
+ uint256 lastIndex = _existingTokens - 1;
38
+ uint256 index = _tokenIndex[tokenId];
39
+ if (index < lastIndex) {
40
+ bytes32 lastTokenId = _indexToken[lastIndex];
41
+ _indexToken[index] = lastTokenId;
42
+ _tokenIndex[lastTokenId] = index;
43
+ }
44
+ delete _indexToken[lastIndex];
45
+ delete _tokenIndex[tokenId];
46
+ }
19
47
  super._beforeTokenTransfer(from, to, tokenId);
20
48
  }
21
49
  }
@@ -1,24 +1,51 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity ^0.8.0;
3
+ pragma solidity ^0.8.4;
4
4
 
5
5
  // modules
6
- import {LSP8IdentifiableDigitalAssetInitAbstract} from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
6
+ import {
7
+ LSP8IdentifiableDigitalAssetInitAbstract
8
+ } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
7
9
  import {LSP8IdentifiableDigitalAssetCore} from "../LSP8IdentifiableDigitalAssetCore.sol";
8
- import {LSP8EnumerableCore} from "./LSP8EnumerableCore.sol";
9
10
 
10
11
  /**
11
12
  * @dev LSP8 extension.
12
13
  */
13
- abstract contract LSP8EnumerableInitAbstract is
14
- LSP8IdentifiableDigitalAssetInitAbstract,
15
- LSP8EnumerableCore
16
- {
14
+ abstract contract LSP8EnumerableInitAbstract is LSP8IdentifiableDigitalAssetInitAbstract {
15
+ // Mapping from token index to token id
16
+ mapping(uint256 => bytes32) private _indexToken;
17
+
18
+ // Mapping from token id to index
19
+ mapping(bytes32 => uint256) private _tokenIndex;
20
+
21
+ /**
22
+ * @dev Returns a token id at index. See totalSupply() to get total number of minted tokens.
23
+ * @return TokenId or 0x00 if no token exist at the index `index`
24
+ */
25
+ function tokenAt(uint256 index) public view returns (bytes32) {
26
+ return _indexToken[index];
27
+ }
28
+
17
29
  function _beforeTokenTransfer(
18
30
  address from,
19
31
  address to,
20
32
  bytes32 tokenId
21
- ) internal virtual override(LSP8IdentifiableDigitalAssetCore, LSP8EnumerableCore) {
33
+ ) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
34
+ if (from == address(0)) {
35
+ uint256 index = _existingTokens;
36
+ _indexToken[index] = tokenId;
37
+ _tokenIndex[tokenId] = index;
38
+ } else if (to == address(0)) {
39
+ uint256 lastIndex = _existingTokens - 1;
40
+ uint256 index = _tokenIndex[tokenId];
41
+ if (index < lastIndex) {
42
+ bytes32 lastTokenId = _indexToken[lastIndex];
43
+ _indexToken[index] = lastTokenId;
44
+ _tokenIndex[lastTokenId] = index;
45
+ }
46
+ delete _indexToken[lastIndex];
47
+ delete _tokenIndex[tokenId];
48
+ }
22
49
  super._beforeTokenTransfer(from, to, tokenId);
23
50
  }
24
51
  }
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity ^0.8.0;
3
+ pragma solidity ^0.8.4;
4
4
 
5
5
  // interfaces
6
6
  import {ILSP8IdentifiableDigitalAsset} from "../ILSP8IdentifiableDigitalAsset.sol";
@@ -12,7 +12,7 @@ interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
12
12
  /**
13
13
  * @param to The address to mint tokens
14
14
  * @param tokenId The tokenId to mint
15
- * @param force When set to TRUE, to may be any address but
15
+ * @param allowNonLSP1Recipient When set to TRUE, to may be any address but
16
16
  * when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
17
17
  * @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
18
18
  * @dev Mints `amount` tokens and transfers it to `to`.
@@ -26,7 +26,7 @@ interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
26
26
  function mint(
27
27
  address to,
28
28
  bytes32 tokenId,
29
- bool force,
29
+ bool allowNonLSP1Recipient,
30
30
  bytes memory data
31
31
  ) external;
32
32
  }
@@ -1,10 +1,9 @@
1
1
  // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.8.0;
2
+ pragma solidity ^0.8.12;
3
3
 
4
4
  import {LSP8CompatibleERC721} from "../extensions/LSP8CompatibleERC721.sol";
5
5
 
6
6
  contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 {
7
- /* solhint-disable no-empty-blocks */
8
7
  constructor(
9
8
  string memory name_,
10
9
  string memory symbol_,
@@ -14,9 +13,9 @@ contract LSP8CompatibleERC721Mintable is LSP8CompatibleERC721 {
14
13
  function mint(
15
14
  address to,
16
15
  bytes32 tokenId,
17
- bool force,
16
+ bool allowNonLSP1Recipient,
18
17
  bytes memory data
19
18
  ) public onlyOwner {
20
- _mint(to, tokenId, force, data);
19
+ _mint(to, tokenId, allowNonLSP1Recipient, data);
21
20
  }
22
21
  }
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.8.0;
2
+ pragma solidity ^0.8.12;
3
3
 
4
4
  // modules
5
5
  import {
@@ -13,7 +13,7 @@ contract LSP8CompatibleERC721MintableInit is LSP8CompatibleERC721MintableInitAbs
13
13
  constructor() {
14
14
  _disableInitializers();
15
15
  }
16
-
16
+
17
17
  /**
18
18
  * @notice Sets the name, the symbol and the owner of the token
19
19
  * @param name_ The name of the token
@@ -24,7 +24,7 @@ contract LSP8CompatibleERC721MintableInit is LSP8CompatibleERC721MintableInitAbs
24
24
  string memory name_,
25
25
  string memory symbol_,
26
26
  address newOwner_
27
- ) public virtual initializer {
27
+ ) external virtual initializer {
28
28
  LSP8CompatibleERC721MintableInitAbstract._initialize(name_, symbol_, newOwner_);
29
29
  }
30
30
  }
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.8.0;
2
+ pragma solidity ^0.8.12;
3
3
 
4
4
  // modules
5
5
  import {LSP8CompatibleERC721InitAbstract} from "../extensions/LSP8CompatibleERC721InitAbstract.sol";
@@ -19,9 +19,9 @@ contract LSP8CompatibleERC721MintableInitAbstract is LSP8CompatibleERC721InitAbs
19
19
  function mint(
20
20
  address to,
21
21
  bytes32 tokenId,
22
- bool force,
22
+ bool allowNonLSP1Recipient,
23
23
  bytes memory data
24
24
  ) public onlyOwner {
25
- _mint(to, tokenId, force, data);
25
+ _mint(to, tokenId, allowNonLSP1Recipient, data);
26
26
  }
27
27
  }
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity ^0.8.0;
3
+ pragma solidity ^0.8.4;
4
4
 
5
5
  // interfaces
6
6
  import {ILSP8Mintable} from "./ILSP8Mintable.sol";
@@ -12,7 +12,6 @@ import {LSP8IdentifiableDigitalAsset} from "../LSP8IdentifiableDigitalAsset.sol"
12
12
  * @dev LSP8 extension.
13
13
  */
14
14
  contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
15
- // solhint-disable no-empty-blocks
16
15
  /**
17
16
  * @notice Sets the token-Metadata and register LSP8InterfaceId
18
17
  * @param name_ The name of the token
@@ -31,9 +30,9 @@ contract LSP8Mintable is LSP8IdentifiableDigitalAsset, ILSP8Mintable {
31
30
  function mint(
32
31
  address to,
33
32
  bytes32 tokenId,
34
- bool force,
33
+ bool allowNonLSP1Recipient,
35
34
  bytes memory data
36
35
  ) public virtual onlyOwner {
37
- _mint(to, tokenId, force, data);
36
+ _mint(to, tokenId, allowNonLSP1Recipient, data);
38
37
  }
39
38
  }
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity ^0.8.0;
3
+ pragma solidity ^0.8.4;
4
4
 
5
5
  // modules
6
6
  import {LSP8MintableInitAbstract} from "./LSP8MintableInitAbstract.sol";
@@ -26,7 +26,7 @@ contract LSP8MintableInit is LSP8MintableInitAbstract {
26
26
  string memory name_,
27
27
  string memory symbol_,
28
28
  address newOwner_
29
- ) public virtual initializer {
29
+ ) external virtual initializer {
30
30
  LSP8MintableInitAbstract._initialize(name_, symbol_, newOwner_);
31
31
  }
32
32
  }
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity ^0.8.0;
3
+ pragma solidity ^0.8.4;
4
4
 
5
5
  // interfaces
6
6
  import {ILSP8Mintable} from "./ILSP8Mintable.sol";
@@ -30,9 +30,9 @@ abstract contract LSP8MintableInitAbstract is
30
30
  function mint(
31
31
  address to,
32
32
  bytes32 tokenId,
33
- bool force,
33
+ bool allowNonLSP1Recipient,
34
34
  bytes memory data
35
35
  ) public virtual onlyOwner {
36
- _mint(to, tokenId, force, data);
36
+ _mint(to, tokenId, allowNonLSP1Recipient, data);
37
37
  }
38
38
  }
@@ -1,10 +1,10 @@
1
1
  // SPDX-License-Identifier: CC0-1.0
2
- pragma solidity ^0.8.0;
2
+ pragma solidity ^0.8.4;
3
3
 
4
4
  // --- ERC165 interface ids
5
- bytes4 constant _INTERFACEID_LSP9 = 0xfd4d5c50;
5
+ bytes4 constant _INTERFACEID_LSP9 = 0x7050cee9;
6
6
 
7
- // --- ERC725Y Keys
7
+ // --- ERC725Y Data Keys
8
8
 
9
9
  // bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP9Vault'))
10
10
  bytes32 constant _LSP9_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b600007c0334a14085fefa8b51ae5a40895018882bdb90;
@@ -12,13 +12,13 @@ bytes32 constant _LSP9_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b600007c033
12
12
  // bytes4(keccak256('LSP9Vault'))
13
13
  bytes constant _LSP9_SUPPORTED_STANDARDS_VALUE = hex"7c0334a1";
14
14
 
15
- // --- Vault Hooks
15
+ // Ownerhsip Transfer Type IDs
16
16
 
17
- // keccak256("LSP9VaultSender")
18
- bytes32 constant _TYPEID_LSP9_VAULTSENDER = 0x3ca9f769340018257ac15b3a00e502e8fb730d66086f774210f84d0205af31e7;
17
+ // keccak256('LSP9OwnershipTransferStarted')
18
+ bytes32 constant _TYPEID_LSP9_OwnershipTransferStarted = 0xaefd43f45fed1bcd8992f23c803b6f4ec45cf6b62b0d404d565f290a471e763f;
19
19
 
20
- // keccak256("LSP9VaultRecipient")
21
- bytes32 constant _TYPEID_LSP9_VAULTRECIPIENT = 0x09aaf55960715d8d86b57af40be36b0bfd469c9a3643445d8c65d39e27b4c56f;
20
+ // keccak256('LSP9OwnershipTransferred_SenderNotification')
21
+ bytes32 constant _TYPEID_LSP9_OwnershipTransferred_SenderNotification = 0x0c622e58e6b7089ae35f1af1c86d997be92fcdd8c9509652022d41aa65169471;
22
22
 
23
- // keccak256("LSP9VaultPendingOwner")
24
- bytes32 constant _TYPEID_LSP9_VAULTPENDINGOWNER = 0x50d401f7017708f51f2a7a1c24146f786926c831079107140037b8ebef9fd326;
23
+ // keccak256('LSP9OwnershipTransferred_RecipientNotification')
24
+ bytes32 constant _TYPEID_LSP9_OwnershipTransferred_RecipientNotification = 0x79855c97dbc259ce395421d933d7bc0699b0f1561f988f09a9e8633fd542fe5c;
@@ -0,0 +1,8 @@
1
+ // SPDX-License-Identifier: CC0-1.0
2
+ pragma solidity ^0.8.4;
3
+
4
+ /**
5
+ * @dev reverts when the UniversalReceiverDelegates of the Vault sets LSP1/6/17 Data Keys
6
+ * @param dataKey The data key that the UniversalReceiverDelegate is not allowed to set
7
+ */
8
+ error LSP1DelegateNotAllowedToSetDataKey(bytes32 dataKey);
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.0;
2
+ pragma solidity ^0.8.4;
3
3
 
4
4
  // interfaces
5
5
  import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
@@ -7,7 +7,7 @@ import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.so
7
7
  // modules
8
8
  import {OwnableUnset} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
9
9
  import {ERC725} from "@erc725/smart-contracts/contracts/ERC725.sol";
10
- import {LSP9VaultCore, ClaimOwnership} from "./LSP9VaultCore.sol";
10
+ import {LSP9VaultCore} from "./LSP9VaultCore.sol";
11
11
 
12
12
  // constants
13
13
  import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
@@ -27,12 +27,14 @@ contract LSP9Vault is LSP9VaultCore {
27
27
  * @notice Sets the owner of the contract and sets the SupportedStandards:LSP9Vault key
28
28
  * @param newOwner the owner of the contract
29
29
  */
30
- constructor(address newOwner) {
30
+ constructor(address newOwner) payable {
31
+ if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
32
+
31
33
  OwnableUnset._setOwner(newOwner);
32
34
 
33
35
  // set key SupportedStandards:LSP9Vault
34
36
  _setData(_LSP9_SUPPORTED_STANDARDS_KEY, _LSP9_SUPPORTED_STANDARDS_VALUE);
35
37
 
36
- _notifyVaultReceiver(newOwner);
38
+ _notifyLSP1RecipientOnOwnershipTransferCompletion(newOwner, "");
37
39
  }
38
40
  }