@lukso/lsp-smart-contracts 0.6.1 → 0.6.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 (108) hide show
  1. package/artifacts/Create2Factory.json +2 -2
  2. package/artifacts/LSP0ERC725Account.json +8 -8
  3. package/artifacts/LSP0ERC725AccountInit.json +13 -8
  4. package/artifacts/LSP1UniversalReceiverDelegateUP.json +18 -2
  5. package/artifacts/LSP1UniversalReceiverDelegateVault.json +18 -2
  6. package/artifacts/LSP4DigitalAssetMetadata.json +10 -0
  7. package/artifacts/LSP4DigitalAssetMetadataInit.json +10 -0
  8. package/artifacts/LSP6KeyManager.json +82 -13
  9. package/artifacts/LSP6KeyManagerInit.json +87 -13
  10. package/artifacts/LSP7CappedSupply.json +10 -0
  11. package/artifacts/LSP7CappedSupplyInit.json +10 -28
  12. package/artifacts/LSP7CompatibleERC20.json +714 -0
  13. package/artifacts/LSP7CompatibleERC20Init.json +760 -0
  14. package/artifacts/LSP7CompatibleERC20Mintable.json +742 -0
  15. package/artifacts/LSP7CompatibleERC20MintableInit.json +783 -0
  16. package/artifacts/LSP7DigitalAsset.json +12 -2
  17. package/artifacts/LSP7DigitalAssetInit.json +17 -2
  18. package/artifacts/LSP7Mintable.json +12 -2
  19. package/artifacts/LSP7MintableInit.json +17 -2
  20. package/artifacts/LSP8CappedSupply.json +10 -0
  21. package/artifacts/LSP8CappedSupplyInit.json +10 -23
  22. package/artifacts/LSP8CompatibleERC721.json +842 -0
  23. package/artifacts/LSP8CompatibleERC721Init.json +883 -0
  24. package/artifacts/LSP8CompatibleERC721Mintable.json +881 -0
  25. package/artifacts/LSP8CompatibleERC721MintableInit.json +922 -0
  26. package/artifacts/LSP8IdentifiableDigitalAsset.json +12 -2
  27. package/artifacts/LSP8IdentifiableDigitalAssetInit.json +17 -2
  28. package/artifacts/LSP8Mintable.json +12 -2
  29. package/artifacts/LSP8MintableInit.json +17 -2
  30. package/artifacts/LSP9Vault.json +9 -9
  31. package/artifacts/LSP9VaultInit.json +14 -9
  32. package/artifacts/UniversalFactory.json +2 -2
  33. package/artifacts/UniversalProfile.json +8 -8
  34. package/artifacts/UniversalProfileInit.json +13 -8
  35. package/artifacts/UniversalReceiverAddressStore.json +2 -2
  36. package/constants.js +49 -14
  37. package/contracts/Custom/ClaimOwnership.sol +10 -7
  38. package/contracts/Custom/IClaimOwnership.sol +1 -1
  39. package/contracts/Factories/Create2Factory.sol +3 -13
  40. package/contracts/Factories/UniversalFactory.sol +16 -7
  41. package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +3 -3
  42. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +28 -19
  43. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +10 -3
  44. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +2 -2
  45. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +12 -3
  46. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/Handling/TokenHandling.sol +18 -16
  47. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +8 -2
  48. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +18 -4
  49. package/contracts/LSP2ERC725YJSONSchema/LSP2Errors.sol +9 -0
  50. package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +69 -73
  51. package/contracts/LSP3UniversalProfile/LSP3Constants.sol +1 -1
  52. package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -1
  53. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +14 -3
  54. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +16 -4
  55. package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +16 -0
  56. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +27 -1
  57. package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +15 -15
  58. package/contracts/LSP6KeyManager/LSP6Errors.sol +34 -5
  59. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +5 -3
  60. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +224 -234
  61. package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +10 -3
  62. package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +4 -2
  63. package/contracts/LSP6KeyManager/LSP6Utils.sol +22 -26
  64. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +4 -0
  65. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +3 -1
  66. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInit.sol +11 -0
  67. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +3 -1
  68. package/contracts/LSP7DigitalAsset/extensions/{ILSP7CompatibilityForERC20.sol → ILSP7CompatibleERC20.sol} +6 -6
  69. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +5 -2
  70. package/contracts/LSP7DigitalAsset/extensions/{LSP7CompatibilityForERC20.sol → LSP7CompatibleERC20.sol} +6 -7
  71. package/contracts/LSP7DigitalAsset/extensions/{LSP7CompatibilityForERC20Core.sol → LSP7CompatibleERC20Core.sol} +21 -16
  72. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20Init.sol +29 -0
  73. package/contracts/LSP7DigitalAsset/extensions/{LSP7CompatibilityForERC20InitAbstract.sol → LSP7CompatibleERC20InitAbstract.sol} +11 -10
  74. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +22 -0
  75. package/contracts/LSP7DigitalAsset/{extensions/LSP7CompatibilityForERC20Init.sol → presets/LSP7CompatibleERC20MintableInit.sol} +5 -4
  76. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +27 -0
  77. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +8 -1
  78. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +1 -1
  79. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +1 -1
  80. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInit.sol +10 -1
  81. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +3 -1
  82. package/contracts/LSP8IdentifiableDigitalAsset/extensions/{ILSP8CompatibilityForERC721.sol → ILSP8CompatibleERC721.sol} +1 -1
  83. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +4 -2
  84. package/contracts/LSP8IdentifiableDigitalAsset/extensions/{LSP8CompatibilityConstants.sol → LSP8CompatibleConstants.sol} +0 -0
  85. package/contracts/LSP8IdentifiableDigitalAsset/extensions/{LSP8CompatibilityForERC721.sol → LSP8CompatibleERC721.sol} +12 -11
  86. package/contracts/LSP8IdentifiableDigitalAsset/extensions/{LSP8CompatibilityForERC721Core.sol → LSP8CompatibleERC721Core.sol} +16 -16
  87. package/contracts/LSP8IdentifiableDigitalAsset/extensions/{LSP8CompatibilityForERC721Init.sol → LSP8CompatibleERC721Init.sol} +3 -3
  88. package/contracts/LSP8IdentifiableDigitalAsset/extensions/{LSP8CompatibilityForERC721InitAbstract.sol → LSP8CompatibleERC721InitAbstract.sol} +13 -9
  89. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +22 -0
  90. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +23 -0
  91. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +27 -0
  92. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +7 -0
  93. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +3 -1
  94. package/contracts/LSP9Vault/LSP9Constants.sol +1 -1
  95. package/contracts/LSP9Vault/LSP9Vault.sol +9 -5
  96. package/contracts/LSP9Vault/LSP9VaultCore.sol +37 -26
  97. package/contracts/LSP9Vault/LSP9VaultInit.sol +10 -3
  98. package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +8 -4
  99. package/contracts/Legacy/UniversalReceiverAddressStore.sol +3 -1
  100. package/contracts/UniversalProfile.sol +3 -4
  101. package/contracts/UniversalProfileInit.sol +10 -3
  102. package/contracts/UniversalProfileInitAbstract.sol +3 -5
  103. package/contracts/Utils/UtilsLib.sol +6 -34
  104. package/package.json +2 -2
  105. package/artifacts/LSP7CompatibilityForERC20.json +0 -686
  106. package/artifacts/LSP7CompatibilityForERC20Init.json +0 -727
  107. package/artifacts/LSP8CompatibilityForERC721.json +0 -832
  108. package/artifacts/LSP8CompatibilityForERC721Init.json +0 -873
@@ -5,9 +5,8 @@ pragma solidity ^0.8.0;
5
5
  import {LSP0ERC725Account} from "./LSP0ERC725Account/LSP0ERC725Account.sol";
6
6
 
7
7
  // constants
8
- // prettier-ignore
9
8
  import {
10
- _LSP3_SUPPORTED_STANDARDS_KEY,
9
+ _LSP3_SUPPORTED_STANDARDS_KEY,
11
10
  _LSP3_SUPPORTED_STANDARDS_VALUE
12
11
  } from "./LSP3UniversalProfile/LSP3Constants.sol";
13
12
 
@@ -19,9 +18,9 @@ import {
19
18
  contract UniversalProfile is LSP0ERC725Account {
20
19
  /**
21
20
  * @notice Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key
22
- * @param _newOwner the owner of the contract
21
+ * @param newOwner the owner of the contract
23
22
  */
24
- constructor(address _newOwner) LSP0ERC725Account(_newOwner) {
23
+ constructor(address newOwner) LSP0ERC725Account(newOwner) payable {
25
24
  // set key SupportedStandards:LSP3UniversalProfile
26
25
  _setData(_LSP3_SUPPORTED_STANDARDS_KEY, _LSP3_SUPPORTED_STANDARDS_VALUE);
27
26
  }
@@ -10,11 +10,18 @@ import {UniversalProfileInitAbstract} from "./UniversalProfileInitAbstract.sol";
10
10
  * @dev Implementation of the ERC725Account + LSP1 universalReceiver
11
11
  */
12
12
  contract UniversalProfileInit is UniversalProfileInitAbstract {
13
+ /**
14
+ * @dev initialize (= lock) base implementation contract on deployment
15
+ */
16
+ constructor() {
17
+ _disableInitializers();
18
+ }
19
+
13
20
  /**
14
21
  * @notice Sets the owner of the contract and sets the SupportedStandards:LSP3UniversalProfile key
15
- * @param _newOwner the owner of the contract
22
+ * @param newOwner the owner of the contract
16
23
  */
17
- function initialize(address _newOwner) public virtual initializer {
18
- UniversalProfileInitAbstract._initialize(_newOwner);
24
+ function initialize(address newOwner) public payable virtual initializer {
25
+ UniversalProfileInitAbstract._initialize(newOwner);
19
26
  }
20
27
  }
@@ -2,13 +2,11 @@
2
2
  pragma solidity ^0.8.0;
3
3
 
4
4
  // modules
5
- import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
6
5
  import {LSP0ERC725AccountInitAbstract} from "./LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol";
7
6
 
8
7
  // constants
9
- // prettier-ignore
10
8
  import {
11
- _LSP3_SUPPORTED_STANDARDS_KEY,
9
+ _LSP3_SUPPORTED_STANDARDS_KEY,
12
10
  _LSP3_SUPPORTED_STANDARDS_VALUE
13
11
  } from "./LSP3UniversalProfile/LSP3Constants.sol";
14
12
 
@@ -18,8 +16,8 @@ import {
18
16
  * @dev Implementation of the ERC725Account + LSP1 universalReceiver
19
17
  */
20
18
  abstract contract UniversalProfileInitAbstract is LSP0ERC725AccountInitAbstract {
21
- function _initialize(address _newOwner) internal virtual override onlyInitializing {
22
- LSP0ERC725AccountInitAbstract._initialize(_newOwner);
19
+ function _initialize(address newOwner) internal virtual override onlyInitializing {
20
+ LSP0ERC725AccountInitAbstract._initialize(newOwner);
23
21
 
24
22
  // set key SupportedStandards:LSP3UniversalProfile
25
23
  _setData(_LSP3_SUPPORTED_STANDARDS_KEY, _LSP3_SUPPORTED_STANDARDS_VALUE);
@@ -11,49 +11,21 @@ library UtilsLib {
11
11
  /**
12
12
  * @dev concatenate two bytes16
13
13
  */
14
- function concatTwoBytes16(bytes16 b1, bytes16 b2)
15
- internal
16
- pure
17
- returns (bytes memory result)
18
- {
19
- result = new bytes(32);
20
- assembly {
21
- mstore(add(result, 32), b1)
22
- mstore(add(result, 48), b2)
23
- }
14
+ function concatTwoBytes16(bytes16 b1, bytes16 b2) internal pure returns (bytes memory result) {
15
+ result = bytes.concat(b1, b2);
24
16
  }
25
17
 
26
18
  /**
27
19
  * @dev cast uint256 to bytes
28
20
  */
29
- function uint256ToBytes(uint256 num)
30
- internal
31
- pure
32
- returns (bytes memory bytes_)
33
- {
34
- bytes_ = new bytes(32);
35
- assembly {
36
- mstore(add(bytes_, 32), num)
37
- }
21
+ function uint256ToBytes(uint256 num) internal pure returns (bytes memory bytes_) {
22
+ bytes_ = bytes.concat(bytes32(num));
38
23
  }
39
24
 
40
25
  /**
41
26
  * @dev cast address to bytes
42
27
  */
43
- function addressToBytes(address addr)
44
- internal
45
- pure
46
- returns (bytes memory bytes_)
47
- {
48
- assembly {
49
- let m := mload(0x40)
50
- addr := and(addr, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
51
- mstore(
52
- add(m, 20),
53
- xor(0x140000000000000000000000000000000000000000, addr)
54
- )
55
- mstore(0x40, add(m, 52))
56
- bytes_ := m
57
- }
28
+ function addressToBytes(address addr) internal pure returns (bytes memory bytes_) {
29
+ bytes_ = bytes.concat(bytes20(addr));
58
30
  }
59
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/lsp-smart-contracts",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "The reference implementation for universal profiles smart contracts",
5
5
  "directories": {
6
6
  "test": "test"
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "homepage": "https://github.com/lukso-network/lsp-smart-contracts#readme",
58
58
  "dependencies": {
59
- "@erc725/smart-contracts": "^3.1.1",
59
+ "@erc725/smart-contracts": "^3.1.2",
60
60
  "@openzeppelin/contracts": "^4.6.0",
61
61
  "solidity-bytes-utils": "0.8.0"
62
62
  },