@lukso/lsp-smart-contracts 0.11.1 → 0.12.0-rc.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 (214) hide show
  1. package/CONTRIBUTING.md +4 -0
  2. package/README.md +10 -2
  3. package/artifacts/Create2Factory.json +2 -2
  4. package/artifacts/LSP0ERC725Account.json +52 -25
  5. package/artifacts/LSP0ERC725AccountInit.json +52 -25
  6. package/artifacts/LSP11BasicSocialRecovery.json +18 -2
  7. package/artifacts/LSP11BasicSocialRecoveryInit.json +18 -2
  8. package/artifacts/LSP16UniversalFactory.json +3 -3
  9. package/artifacts/LSP1UniversalReceiverDelegateUP.json +14 -46
  10. package/artifacts/LSP1UniversalReceiverDelegateVault.json +14 -46
  11. package/artifacts/LSP23LinkedContractsFactory.json +3 -3
  12. package/artifacts/LSP4DigitalAssetMetadata.json +16 -0
  13. package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +16 -0
  14. package/artifacts/LSP6KeyManager.json +14 -9
  15. package/artifacts/LSP6KeyManagerInit.json +14 -9
  16. package/artifacts/LSP7CappedSupply.json +29 -4
  17. package/artifacts/LSP7CappedSupplyInitAbstract.json +29 -4
  18. package/artifacts/LSP7CompatibleERC20.json +48 -23
  19. package/artifacts/LSP7CompatibleERC20InitAbstract.json +48 -23
  20. package/artifacts/LSP7CompatibleERC20Mintable.json +51 -26
  21. package/artifacts/LSP7CompatibleERC20MintableInit.json +51 -26
  22. package/artifacts/LSP7DigitalAsset.json +29 -4
  23. package/artifacts/LSP7DigitalAssetInitAbstract.json +29 -4
  24. package/artifacts/LSP7Mintable.json +32 -7
  25. package/artifacts/LSP7MintableInit.json +32 -7
  26. package/artifacts/LSP8CappedSupply.json +33 -3
  27. package/artifacts/LSP8CappedSupplyInitAbstract.json +33 -3
  28. package/artifacts/LSP8CompatibleERC721.json +55 -25
  29. package/artifacts/LSP8CompatibleERC721InitAbstract.json +55 -25
  30. package/artifacts/LSP8CompatibleERC721Mintable.json +63 -28
  31. package/artifacts/LSP8CompatibleERC721MintableInit.json +63 -28
  32. package/artifacts/LSP8IdentifiableDigitalAsset.json +33 -3
  33. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +33 -3
  34. package/artifacts/LSP8Mintable.json +41 -6
  35. package/artifacts/LSP8MintableInit.json +41 -6
  36. package/artifacts/LSP9Vault.json +38 -16
  37. package/artifacts/LSP9VaultInit.json +38 -16
  38. package/artifacts/UniversalProfile.json +52 -25
  39. package/artifacts/UniversalProfileInit.json +52 -25
  40. package/contracts/Factories/Create2Factory.sol +1 -1
  41. package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +0 -14
  42. package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
  43. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +122 -94
  44. package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +5 -3
  45. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +54 -14
  46. package/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol +1 -1
  47. package/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol +1 -1
  48. package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +2 -2
  49. package/contracts/LSP14Ownable2Step/LSP14Constants.sol +1 -1
  50. package/contracts/LSP14Ownable2Step/LSP14Errors.sol +9 -3
  51. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +16 -12
  52. package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +65 -96
  53. package/contracts/LSP17ContractExtension/LSP17Errors.sol +1 -1
  54. package/contracts/LSP17ContractExtension/LSP17Extendable.sol +10 -7
  55. package/contracts/LSP17ContractExtension/LSP17Extension.sol +4 -4
  56. package/contracts/LSP17Extensions/Extension4337.sol +101 -0
  57. package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +15 -0
  58. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +1 -2
  59. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +24 -0
  60. package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +1 -0
  61. package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +0 -6
  62. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +20 -27
  63. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +18 -21
  64. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +2 -46
  65. package/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +13 -9
  66. package/contracts/LSP20CallVerification/LSP20CallVerification.sol +39 -14
  67. package/contracts/LSP20CallVerification/LSP20Constants.sol +6 -6
  68. package/contracts/LSP20CallVerification/LSP20Errors.sol +9 -3
  69. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/ILSP23LinkedContractsFactory.sol +1 -1
  70. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/IPostDeploymentModule.sol +1 -1
  71. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/LSP23Errors.sol +1 -1
  72. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/LSP23LinkedContractsFactory.sol +5 -1
  73. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/modules/UniversalProfileInitPostDeploymentModule.sol +1 -1
  74. package/contracts/{LSP23LinkedContractsDeployment → LSP23LinkedContractsFactory}/modules/UniversalProfilePostDeploymentModule.sol +1 -1
  75. package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +1 -1
  76. package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +8 -3
  77. package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +1 -97
  78. package/contracts/LSP3ProfileMetadata/LSP3Constants.sol +1 -1
  79. package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -1
  80. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +8 -3
  81. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +8 -3
  82. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +4 -3
  83. package/contracts/LSP6KeyManager/LSP6Constants.sol +4 -3
  84. package/contracts/LSP6KeyManager/LSP6Errors.sol +2 -23
  85. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +0 -1
  86. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +134 -99
  87. package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +0 -1
  88. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +1 -2
  89. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol +27 -0
  90. package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +31 -25
  91. package/contracts/LSP6KeyManager/LSP6Utils.sol +29 -2
  92. package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +10 -10
  93. package/contracts/LSP7DigitalAsset/LSP7Constants.sol +1 -1
  94. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +22 -8
  95. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +180 -118
  96. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +21 -7
  97. package/contracts/LSP7DigitalAsset/LSP7Errors.sol +12 -3
  98. package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +5 -1
  99. package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +4 -1
  100. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +7 -7
  101. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +3 -3
  102. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +120 -53
  103. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +122 -53
  104. package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +3 -3
  105. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +4 -4
  106. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +2 -2
  107. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +4 -4
  108. package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +4 -4
  109. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +1 -1
  110. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +4 -4
  111. package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +11 -11
  112. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +12 -1
  113. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +32 -16
  114. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +61 -11
  115. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +113 -74
  116. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +63 -10
  117. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +1 -1
  118. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +1 -1
  119. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +7 -7
  120. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +3 -3
  121. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +162 -73
  122. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +168 -84
  123. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +7 -7
  124. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +7 -7
  125. package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +3 -3
  126. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +8 -7
  127. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +5 -3
  128. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +13 -7
  129. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +9 -8
  130. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +9 -3
  131. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +10 -8
  132. package/contracts/LSP9Vault/ILSP9Vault.sol +0 -13
  133. package/contracts/LSP9Vault/LSP9Constants.sol +1 -1
  134. package/contracts/LSP9Vault/LSP9Errors.sol +1 -1
  135. package/contracts/LSP9Vault/LSP9VaultCore.sol +58 -41
  136. package/devdocs/LSP0ERC725Account.json +73 -45
  137. package/devdocs/LSP0ERC725AccountInit.json +73 -45
  138. package/devdocs/LSP11BasicSocialRecovery.json +13 -0
  139. package/devdocs/LSP11BasicSocialRecoveryInit.json +13 -0
  140. package/devdocs/LSP16UniversalFactory.json +9 -9
  141. package/devdocs/LSP1UniversalReceiverDelegateUP.json +1 -6
  142. package/devdocs/LSP1UniversalReceiverDelegateVault.json +1 -6
  143. package/devdocs/LSP4DigitalAssetMetadata.json +32 -10
  144. package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +32 -10
  145. package/devdocs/LSP6KeyManager.json +12 -14
  146. package/devdocs/LSP6KeyManagerInit.json +12 -14
  147. package/devdocs/LSP7CappedSupply.json +47 -20
  148. package/devdocs/LSP7CappedSupplyInitAbstract.json +47 -20
  149. package/devdocs/LSP7CompatibleERC20.json +88 -24
  150. package/devdocs/LSP7CompatibleERC20InitAbstract.json +88 -24
  151. package/devdocs/LSP7CompatibleERC20Mintable.json +88 -24
  152. package/devdocs/LSP7CompatibleERC20MintableInit.json +88 -24
  153. package/devdocs/LSP7DigitalAsset.json +47 -20
  154. package/devdocs/LSP7DigitalAssetInitAbstract.json +47 -20
  155. package/devdocs/LSP7Mintable.json +47 -20
  156. package/devdocs/LSP7MintableInit.json +47 -20
  157. package/devdocs/LSP8CappedSupply.json +57 -25
  158. package/devdocs/LSP8CappedSupplyInitAbstract.json +57 -25
  159. package/devdocs/LSP8CompatibleERC721.json +84 -31
  160. package/devdocs/LSP8CompatibleERC721InitAbstract.json +84 -31
  161. package/devdocs/LSP8CompatibleERC721Mintable.json +86 -33
  162. package/devdocs/LSP8CompatibleERC721MintableInit.json +87 -34
  163. package/devdocs/LSP8IdentifiableDigitalAsset.json +61 -26
  164. package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +57 -25
  165. package/devdocs/LSP8Mintable.json +59 -27
  166. package/devdocs/LSP8MintableInit.json +60 -28
  167. package/devdocs/LSP9Vault.json +57 -35
  168. package/devdocs/LSP9VaultInit.json +57 -35
  169. package/devdocs/UniversalProfile.json +73 -45
  170. package/devdocs/UniversalProfileInit.json +73 -45
  171. package/dist/constants.cjs.js +4323 -2361
  172. package/dist/constants.d.ts +2933 -1022
  173. package/dist/constants.es.js +4322 -2361
  174. package/package.json +8 -6
  175. package/userdocs/LSP0ERC725Account.json +17 -8
  176. package/userdocs/LSP0ERC725AccountInit.json +17 -8
  177. package/userdocs/LSP16UniversalFactory.json +26 -1
  178. package/userdocs/LSP1UniversalReceiverDelegateUP.json +1 -11
  179. package/userdocs/LSP1UniversalReceiverDelegateVault.json +1 -11
  180. package/userdocs/LSP4DigitalAssetMetadata.json +7 -4
  181. package/userdocs/LSP4DigitalAssetMetadataInitAbstract.json +7 -4
  182. package/userdocs/LSP6KeyManager.json +0 -5
  183. package/userdocs/LSP6KeyManagerInit.json +0 -5
  184. package/userdocs/LSP7CappedSupply.json +14 -6
  185. package/userdocs/LSP7CappedSupplyInitAbstract.json +13 -5
  186. package/userdocs/LSP7CompatibleERC20.json +15 -5
  187. package/userdocs/LSP7CompatibleERC20InitAbstract.json +15 -5
  188. package/userdocs/LSP7CompatibleERC20Mintable.json +15 -5
  189. package/userdocs/LSP7CompatibleERC20MintableInit.json +15 -5
  190. package/userdocs/LSP7DigitalAsset.json +15 -5
  191. package/userdocs/LSP7DigitalAssetInitAbstract.json +15 -5
  192. package/userdocs/LSP7Mintable.json +15 -5
  193. package/userdocs/LSP7MintableInit.json +15 -5
  194. package/userdocs/LSP8CappedSupply.json +13 -5
  195. package/userdocs/LSP8CappedSupplyInitAbstract.json +12 -4
  196. package/userdocs/LSP8CompatibleERC721.json +27 -17
  197. package/userdocs/LSP8CompatibleERC721InitAbstract.json +27 -17
  198. package/userdocs/LSP8CompatibleERC721Mintable.json +28 -18
  199. package/userdocs/LSP8CompatibleERC721MintableInit.json +29 -19
  200. package/userdocs/LSP8IdentifiableDigitalAsset.json +15 -5
  201. package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +14 -4
  202. package/userdocs/LSP8Mintable.json +15 -5
  203. package/userdocs/LSP8MintableInit.json +16 -6
  204. package/userdocs/LSP9Vault.json +20 -11
  205. package/userdocs/LSP9VaultInit.json +20 -11
  206. package/userdocs/UniversalProfile.json +17 -8
  207. package/userdocs/UniversalProfileInit.json +17 -8
  208. package/artifacts/LSP4Compatibility.json +0 -216
  209. package/contracts/LSP4DigitalAssetMetadata/ILSP4Compatibility.sol +0 -25
  210. package/contracts/LSP4DigitalAssetMetadata/LSP4Compatibility.sol +0 -38
  211. package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +0 -83
  212. package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +0 -175
  213. package/devdocs/LSP4Compatibility.json +0 -79
  214. package/userdocs/LSP4Compatibility.json +0 -20
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
 
3
3
  pragma solidity ^0.8.4;
4
4
 
@@ -27,8 +27,14 @@ contract LSP8MintableInit is LSP8MintableInitAbstract {
27
27
  function initialize(
28
28
  string memory name_,
29
29
  string memory symbol_,
30
- address newOwner_
30
+ address newOwner_,
31
+ uint256 tokenIdType_
31
32
  ) external virtual initializer {
32
- LSP8MintableInitAbstract._initialize(name_, symbol_, newOwner_);
33
+ LSP8MintableInitAbstract._initialize(
34
+ name_,
35
+ symbol_,
36
+ newOwner_,
37
+ tokenIdType_
38
+ );
33
39
  }
34
40
  }
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
 
3
3
  pragma solidity ^0.8.4;
4
4
 
@@ -27,31 +27,33 @@ abstract contract LSP8MintableInitAbstract is
27
27
  function _initialize(
28
28
  string memory name_,
29
29
  string memory symbol_,
30
- address newOwner_
30
+ address newOwner_,
31
+ uint256 tokenIdType_
31
32
  ) internal virtual override onlyInitializing {
32
33
  LSP8IdentifiableDigitalAssetInitAbstract._initialize(
33
34
  name_,
34
35
  symbol_,
35
- newOwner_
36
+ newOwner_,
37
+ tokenIdType_
36
38
  );
37
39
  }
38
40
 
39
41
  /**
40
- * @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `allowNonLSP1Recipient`).
42
+ * @notice Minting tokenId `tokenId` for address `to` with the additional data `data` (Note: allow non-LSP1 recipient is set to `force`).
41
43
  *
42
44
  * @dev Public {_mint} function only callable by the {owner}.
43
45
  *
44
46
  * @param to The address that will receive the minted `tokenId`.
45
47
  * @param tokenId The tokenId to mint.
46
- * @param allowNonLSP1Recipient Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting.
48
+ * @param force Set to `false` to ensure that you are minting for a recipient that implements LSP1, `false` otherwise for forcing the minting.
47
49
  * @param data Any addition data to be sent alongside the minting.
48
50
  */
49
51
  function mint(
50
52
  address to,
51
53
  bytes32 tokenId,
52
- bool allowNonLSP1Recipient,
54
+ bool force,
53
55
  bytes memory data
54
- ) public virtual onlyOwner {
55
- _mint(to, tokenId, allowNonLSP1Recipient, data);
56
+ ) public virtual override onlyOwner {
57
+ _mint(to, tokenId, force, data);
56
58
  }
57
59
  }
@@ -1,19 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // interfaces
5
- import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
6
- import {
7
- IERC725X
8
- } from "@erc725/smart-contracts/contracts/interfaces/IERC725X.sol";
9
- import {
10
- IERC725Y
11
- } from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
12
- import {
13
- ILSP1UniversalReceiver
14
- } from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
15
- import {ILSP14Ownable2Step} from "../LSP14Ownable2Step/ILSP14Ownable2Step.sol";
16
-
17
4
  /**
18
5
  * @title Interface of LSP9 - Vault standard, a blockchain vault that can hold assets and interact with other smart contracts.
19
6
  * @dev Could be owned by an EOA or by a contract and is able to receive and send assets. Also allows for registering received assets by leveraging the key-value storage.
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: CC0-1.0
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  // --- ERC165 interface ids
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: CC0-1.0
1
+ // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
4
  /**
@@ -5,12 +5,14 @@ pragma solidity ^0.8.4;
5
5
  import {
6
6
  ILSP1UniversalReceiver
7
7
  } from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
8
+
9
+ import {
10
+ ILSP1UniversalReceiverDelegate
11
+ } from "../LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol";
8
12
  import {ILSP9Vault} from "./ILSP9Vault.sol";
9
13
 
10
14
  // libraries
11
15
  import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
12
-
13
- import {Address} from "@openzeppelin/contracts/utils/Address.sol";
14
16
  import {
15
17
  ERC165Checker
16
18
  } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
@@ -18,14 +20,8 @@ import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
18
20
  import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
19
21
 
20
22
  // modules
21
- import {
22
- ERC725XCore,
23
- IERC725X
24
- } from "@erc725/smart-contracts/contracts/ERC725XCore.sol";
25
- import {
26
- ERC725YCore,
27
- IERC725Y
28
- } from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
23
+ import {ERC725XCore} from "@erc725/smart-contracts/contracts/ERC725XCore.sol";
24
+ import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
29
25
  import {
30
26
  OwnableUnset
31
27
  } from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
@@ -33,7 +29,14 @@ import {LSP14Ownable2Step} from "../LSP14Ownable2Step/LSP14Ownable2Step.sol";
33
29
  import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
34
30
 
35
31
  // constants
36
- import "@erc725/smart-contracts/contracts/errors.sol";
32
+ import {
33
+ ERC725Y_MsgValueDisallowed,
34
+ ERC725Y_DataKeysValuesLengthMismatch,
35
+ ERC725X_CreateOperationsRequireEmptyRecipientAddress,
36
+ ERC725X_CreateOperationsRequireEmptyRecipientAddress,
37
+ ERC725X_MsgValueDisallowedInStaticCall,
38
+ ERC725X_UnknownOperationType
39
+ } from "@erc725/smart-contracts/contracts/errors.sol";
37
40
  import {
38
41
  OPERATION_0_CALL,
39
42
  OPERATION_1_CREATE,
@@ -42,6 +45,7 @@ import {
42
45
  } from "@erc725/smart-contracts/contracts/constants.sol";
43
46
  import {
44
47
  _INTERFACEID_LSP1,
48
+ _INTERFACEID_LSP1_DELEGATE,
45
49
  _LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX,
46
50
  _LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY
47
51
  } from "../LSP1UniversalReceiver/LSP1Constants.sol";
@@ -61,12 +65,11 @@ import {
61
65
  } from "../LSP17ContractExtension/LSP17Constants.sol";
62
66
 
63
67
  // errors
64
- import "./LSP9Errors.sol";
65
- import "../LSP17ContractExtension/LSP17Errors.sol";
68
+ import {LSP1DelegateNotAllowedToSetDataKey} from "./LSP9Errors.sol";
66
69
 
67
70
  import {
68
- LSP14MustAcceptOwnershipInSeparateTransaction
69
- } from "../LSP14Ownable2Step/LSP14Errors.sol";
71
+ NoExtensionFoundForFunctionSelector
72
+ } from "../LSP17ContractExtension/LSP17Errors.sol";
70
73
 
71
74
  /**
72
75
  * @title Core Implementation of LSP9Vault built on top of [ERC725], [LSP1UniversalReceiver]
@@ -94,11 +97,9 @@ contract LSP9VaultCore is
94
97
  * @custom:events {ValueReceived} when receiving native tokens.
95
98
  */
96
99
  receive() external payable virtual {
97
- if (msg.value > 0) emit ValueReceived(msg.sender, msg.value);
100
+ if (msg.value != 0) emit ValueReceived(msg.sender, msg.value);
98
101
  }
99
102
 
100
- // solhint-disable no-complex-fallback
101
-
102
103
  /**
103
104
  * @notice The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`.
104
105
  *
@@ -120,6 +121,7 @@ contract LSP9VaultCore is
120
121
  *
121
122
  * @custom:events {ValueReceived} event when receiving native tokens.
122
123
  */
124
+ // solhint-disable-next-line no-complex-fallback
123
125
  fallback(
124
126
  bytes calldata callData
125
127
  ) external payable virtual returns (bytes memory) {
@@ -141,7 +143,7 @@ contract LSP9VaultCore is
141
143
  */
142
144
  function batchCalls(
143
145
  bytes[] calldata data
144
- ) public virtual returns (bytes[] memory results) {
146
+ ) public virtual override returns (bytes[] memory results) {
145
147
  results = new bytes[](data.length);
146
148
  for (uint256 i; i < data.length; ) {
147
149
  (bool success, bytes memory result) = address(this).delegatecall(
@@ -150,7 +152,7 @@ contract LSP9VaultCore is
150
152
 
151
153
  if (!success) {
152
154
  // Look for revert reason and bubble it up if present
153
- if (result.length > 0) {
155
+ if (result.length != 0) {
154
156
  // The easiest way to bubble the revert reason is using memory via assembly
155
157
  // solhint-disable no-inline-assembly
156
158
  /// @solidity memory-safe-assembly
@@ -172,7 +174,7 @@ contract LSP9VaultCore is
172
174
  }
173
175
 
174
176
  /**
175
- * @inheritdoc IERC725X
177
+ * @inheritdoc ERC725XCore
176
178
  *
177
179
  * @custom:requirements
178
180
  * - Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
@@ -225,7 +227,7 @@ contract LSP9VaultCore is
225
227
  }
226
228
 
227
229
  /**
228
- * @inheritdoc IERC725Y
230
+ * @inheritdoc ERC725YCore
229
231
  *
230
232
  * @custom:requirements Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
231
233
  *
@@ -253,7 +255,7 @@ contract LSP9VaultCore is
253
255
  }
254
256
 
255
257
  /**
256
- * @inheritdoc IERC725Y
258
+ * @inheritdoc ERC725YCore
257
259
  *
258
260
  * @custom:requirements Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.
259
261
  *
@@ -324,7 +326,7 @@ contract LSP9VaultCore is
324
326
  function universalReceiver(
325
327
  bytes32 typeId,
326
328
  bytes calldata receivedData
327
- ) public payable virtual returns (bytes memory returnedValues) {
329
+ ) public payable virtual override returns (bytes memory returnedValues) {
328
330
  if (msg.value != 0) {
329
331
  emit ValueReceived(msg.sender, msg.value);
330
332
  }
@@ -341,16 +343,17 @@ contract LSP9VaultCore is
341
343
 
342
344
  if (
343
345
  universalReceiverDelegate.supportsERC165InterfaceUnchecked(
344
- _INTERFACEID_LSP1
346
+ _INTERFACEID_LSP1_DELEGATE
345
347
  )
346
348
  ) {
347
349
  _reentrantDelegate = universalReceiverDelegate;
348
- resultDefaultDelegate = universalReceiverDelegate
349
- .callUniversalReceiverWithCallerInfos(
350
- typeId,
351
- receivedData,
350
+ resultDefaultDelegate = ILSP1UniversalReceiverDelegate(
351
+ universalReceiverDelegate
352
+ ).universalReceiverDelegate(
352
353
  msg.sender,
353
- msg.value
354
+ msg.value,
355
+ typeId,
356
+ receivedData
354
357
  );
355
358
  }
356
359
  }
@@ -370,16 +373,17 @@ contract LSP9VaultCore is
370
373
 
371
374
  if (
372
375
  universalReceiverDelegate.supportsERC165InterfaceUnchecked(
373
- _INTERFACEID_LSP1
376
+ _INTERFACEID_LSP1_DELEGATE
374
377
  )
375
378
  ) {
376
379
  _reentrantDelegate = universalReceiverDelegate;
377
- resultTypeIdDelegate = universalReceiverDelegate
378
- .callUniversalReceiverWithCallerInfos(
379
- typeId,
380
- receivedData,
380
+ resultTypeIdDelegate = ILSP1UniversalReceiverDelegate(
381
+ universalReceiverDelegate
382
+ ).universalReceiverDelegate(
381
383
  msg.sender,
382
- msg.value
384
+ msg.value,
385
+ typeId,
386
+ receivedData
383
387
  );
384
388
  }
385
389
  }
@@ -508,11 +512,22 @@ contract LSP9VaultCore is
508
512
  /**
509
513
  * @dev Forwards the call to an extension mapped to a function selector.
510
514
  *
511
- * Calls {_getExtension} to get the address of the extension mapped to the function selector being called on the account. If there is no extension, the `address(0)` will be returned.
515
+ * Calls {_getExtension} to get the address of the extension mapped to the function selector being
516
+ * called on the account. If there is no extension, the `address(0)` will be returned.
512
517
  *
513
- * Reverts if there is no extension for the function being called, except for the bytes4(0) function selector, which passes even if there is no extension for it.
518
+ * Reverts if there is no extension for the function being called, except for the `bytes4(0)` function selector, which passes even if there is no extension for it.
514
519
  *
515
- * If there is an extension for the function selector being called, it calls the extension with the CALL opcode, passing the `msg.data` appended with the 20 bytes of the `msg.sender` and 32 bytes of the `msg.value`
520
+ * If there is an extension for the function selector being called, it calls the extension with the
521
+ * `CALL` opcode, passing the `msg.data` appended with the 20 bytes of the {msg.sender} and 32 bytes of the `msg.value`.
522
+ *
523
+ * @custom:hint This function does not forward to the extension contract the `msg.value` received by the contract that inherits `LSP17Extendable`.
524
+ * If you would like to forward the `msg.value` to the extension contract, you can override the code of this internal function as follow:
525
+ *
526
+ * ```solidity
527
+ * (bool success, bytes memory result) = extension.call{value: msg.value}(
528
+ * abi.encodePacked(callData, msg.sender, msg.value)
529
+ * );
530
+ * ```
516
531
  */
517
532
  function _fallbackLSP17Extendable(
518
533
  bytes calldata callData
@@ -626,15 +641,17 @@ contract LSP9VaultCore is
626
641
 
627
642
  // Deploy with CREATE
628
643
  if (operationType == uint256(OPERATION_1_CREATE)) {
629
- if (target != address(0))
644
+ if (target != address(0)) {
630
645
  revert ERC725X_CreateOperationsRequireEmptyRecipientAddress();
646
+ }
631
647
  return _deployCreate(value, data);
632
648
  }
633
649
 
634
650
  // Deploy with CREATE2
635
651
  if (operationType == uint256(OPERATION_2_CREATE2)) {
636
- if (target != address(0))
652
+ if (target != address(0)) {
637
653
  revert ERC725X_CreateOperationsRequireEmptyRecipientAddress();
654
+ }
638
655
  return _deployCreate2(value, data);
639
656
  }
640
657
 
@@ -2,63 +2,79 @@
2
2
  "author": "Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42)",
3
3
  "details": "A smart contract account including basic functionalities such as: - Detecting supported standards using [ERC-165] - Executing several operation on other addresses including creating contracts using [ERC-725X] - A generic data key-value store using [ERC-725Y] - Validating signatures using [ERC-1271] - Receiving notification and react on them using [LSP-1-UniversalReceiver] - Safer ownership management through 2-steps transfer using [LSP-14-Ownable2Step] - Extending the account with new functions and interfaceIds of future standards using [LSP-17-ContractExtension] - Verifying calls on the owner to make it easier to interact with the account directly using [LSP-20-CallVerification]",
4
4
  "errors": {
5
- "CannotTransferOwnershipToSelf()": [
6
- {
7
- "details": "Reverts when trying to transfer ownership to the `address(this)`."
8
- }
9
- ],
10
5
  "ERC725X_ContractDeploymentFailed()": [
11
6
  {
12
- "details": "reverts when contract deployment via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` failed. whether using operation type 1 (CREATE) or 2 (CREATE2)."
7
+ "details": "Reverts when contract deployment failed via {execute} or {executeBatch} functions, This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`)."
13
8
  }
14
9
  ],
15
10
  "ERC725X_CreateOperationsRequireEmptyRecipientAddress()": [
16
11
  {
17
- "details": "reverts when passing a `to` address while deploying a contract va `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` whether using operation type 1 (CREATE) or 2 (CREATE2)."
12
+ "details": "Reverts when passing a `to` address that is not `address(0)` (= address zero) while deploying a contract via {execute} or {executeBatch} functions. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`)."
18
13
  }
19
14
  ],
20
15
  "ERC725X_ExecuteParametersEmptyArray()": [
21
16
  {
22
- "details": "reverts when one of the array parameter provided to `executeBatch(uint256[],address[],uint256[],bytes[]) is an empty array"
17
+ "details": "Reverts when one of the array parameter provided to the {executeBatch} function is an empty array."
23
18
  }
24
19
  ],
25
20
  "ERC725X_ExecuteParametersLengthMismatch()": [
26
21
  {
27
- "details": "reverts when there is not the same number of operation, to addresses, value, and data."
22
+ "details": "Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the {executeBatch} function."
28
23
  }
29
24
  ],
30
25
  "ERC725X_InsufficientBalance(uint256,uint256)": [
31
26
  {
32
- "details": "reverts when trying to send more native tokens `value` than available in current `balance`.",
27
+ "details": "Reverts when trying to send more native tokens `value` than available in current `balance`.",
33
28
  "params": {
34
- "balance": "the balance of the ERC725X contract.",
35
- "value": "the amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`."
29
+ "balance": "The balance of native tokens of the ERC725X smart contract.",
30
+ "value": "The amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` that is greater than the contract's `balance`."
36
31
  }
37
32
  }
38
33
  ],
39
34
  "ERC725X_MsgValueDisallowedInDelegateCall()": [
40
35
  {
41
- "details": "the `value` parameter (= sending native tokens) is not allowed when making a delegatecall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because msg.value is persisting."
36
+ "details": "Reverts when trying to send native tokens (`value` / `values[]` parameter of {execute} or {executeBatch} functions) while making a `delegatecall` (`operationType == 4`). Sending native tokens via `staticcall` is not allowed because `msg.value` is persisting."
42
37
  }
43
38
  ],
44
39
  "ERC725X_MsgValueDisallowedInStaticCall()": [
45
40
  {
46
- "details": "the `value` parameter (= sending native tokens) is not allowed when making a staticcall via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because sending native tokens is a state changing operation."
41
+ "details": "Reverts when trying to send native tokens (`value` / `values[]` parameter of {execute} or {executeBatch} functions) while making a `staticcall` (`operationType == 3`). Sending native tokens via `staticcall` is not allowed because it is a state changing operation."
47
42
  }
48
43
  ],
49
44
  "ERC725X_NoContractBytecodeProvided()": [
50
45
  {
51
- "details": "reverts when no contract bytecode was provided as parameter when trying to deploy a contract via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`, whether using operation type 1 (CREATE) or 2 (CREATE2)."
46
+ "details": "Reverts when no contract bytecode was provided as parameter when trying to deploy a contract via {execute} or {executeBatch}. This error can occur using either operation type 1 (`CREATE`) or 2 (`CREATE2`)."
52
47
  }
53
48
  ],
54
49
  "ERC725X_UnknownOperationType(uint256)": [
55
50
  {
56
- "details": "reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)"
51
+ "details": "Reverts when the `operationTypeProvided` is none of the default operation types available. (CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4)",
52
+ "params": {
53
+ "operationTypeProvided": "The unrecognised operation type number provided to `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`."
54
+ }
55
+ }
56
+ ],
57
+ "ERC725Y_DataKeysValuesEmptyArray()": [
58
+ {
59
+ "details": "Reverts when one of the array parameter provided to {setDataBatch} function is an empty array."
57
60
  }
58
61
  ],
59
62
  "ERC725Y_DataKeysValuesLengthMismatch()": [
60
63
  {
61
- "details": "reverts when there is not the same number of elements in the lists of data keys and data values when calling setDataBatch."
64
+ "details": "Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the {setDataBatch} function."
65
+ }
66
+ ],
67
+ "LSP14CallerNotPendingOwner(address)": [
68
+ {
69
+ "details": "Reverts when the `caller` that is trying to accept ownership of the contract is not the pending owner.",
70
+ "params": {
71
+ "caller": "The address that tried to accept ownership."
72
+ }
73
+ }
74
+ ],
75
+ "LSP14CannotTransferOwnershipToSelf()": [
76
+ {
77
+ "details": "Reverts when trying to transfer ownership to the `address(this)`."
62
78
  }
63
79
  ],
64
80
  "LSP14MustAcceptOwnershipInSeparateTransaction()": [
@@ -66,43 +82,51 @@
66
82
  "details": "Reverts when pending owner accept ownership in the same transaction of transferring ownership."
67
83
  }
68
84
  ],
69
- "LSP20CallingVerifierFailed(bool)": [
85
+ "LSP14NotInRenounceOwnershipInterval(uint256,uint256)": [
70
86
  {
71
- "details": "reverts when the call to the owner fail with no revert reason",
87
+ "details": "Reverts when trying to renounce ownership before the initial confirmation delay.",
72
88
  "params": {
73
- "postCall": "True if the execution call was done, False otherwise"
89
+ "renounceOwnershipEnd": "The end timestamp when one can confirm the renouncement of ownership.",
90
+ "renounceOwnershipStart": "The start timestamp when one can confirm the renouncement of ownership."
74
91
  }
75
92
  }
76
93
  ],
77
- "LSP20InvalidMagicValue(bool,bytes)": [
94
+ "LSP20CallVerificationFailed(bool,bytes)": [
78
95
  {
79
- "details": "reverts when the call to the owner does not return the magic value",
96
+ "details": "reverts when the call to the owner does not return the LSP20 success value",
80
97
  "params": {
81
98
  "postCall": "True if the execution call was done, False otherwise",
82
99
  "returnedData": "The data returned by the call to the logic verifier"
83
100
  }
84
101
  }
85
102
  ],
86
- "NoExtensionFoundForFunctionSelector(bytes4)": [
103
+ "LSP20CallingVerifierFailed(bool)": [
87
104
  {
88
- "details": "reverts when there is no extension for the function selector being called with"
105
+ "details": "reverts when the call to the owner fail with no revert reason",
106
+ "params": {
107
+ "postCall": "True if the execution call was done, False otherwise"
108
+ }
89
109
  }
90
110
  ],
91
- "NotInRenounceOwnershipInterval(uint256,uint256)": [
111
+ "LSP20EOACannotVerifyCall(address)": [
92
112
  {
93
- "details": "Reverts when trying to renounce ownership before the initial confirmation delay.",
113
+ "details": "Reverts when the logic verifier is an Externally Owned Account (EOA) that cannot return the LSP20 success value.",
94
114
  "params": {
95
- "renounceOwnershipEnd": "The end timestamp when one can confirm the renouncement of ownership.",
96
- "renounceOwnershipStart": "The start timestamp when one can confirm the renouncement of ownership."
115
+ "logicVerifier": "The address of the logic verifier"
97
116
  }
98
117
  }
118
+ ],
119
+ "NoExtensionFoundForFunctionSelector(bytes4)": [
120
+ {
121
+ "details": "reverts when there is no extension for the function selector being called with"
122
+ }
99
123
  ]
100
124
  },
101
125
  "kind": "dev",
102
126
  "methods": {
103
127
  "acceptOwnership()": {
104
128
  "custom:requirements": "- Only the {pendingOwner} can call this function. - When notifying the previous owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_SenderNotification]. - When notifying the new owner via LSP1, the typeId used must be the `keccak256(...)` hash of [LSP0OwnershipTransferred_RecipientNotification].",
105
- "details": "Transfer ownership of the contract from the current {owner()} to the {pendingOwner()}. Once this function is called: - The current {owner()} will loose access to the functions restricted to the {owner()} only. - The {pendingOwner()} will gain access to the functions restricted to the {owner()} only."
129
+ "details": "Transfer ownership of the contract from the current {owner()} to the {pendingOwner()}. Once this function is called: - The current {owner()} will lose access to the functions restricted to the {owner()} only. - The {pendingOwner()} will gain access to the functions restricted to the {owner()} only."
106
130
  },
107
131
  "batchCalls(bytes[])": {
108
132
  "custom:info": "It's not possible to send value along the functions call due to the use of `delegatecall`.",
@@ -124,9 +148,9 @@
124
148
  "execute(uint256,address,uint256,bytes)": {
125
149
  "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2). - {ValueReceived} event when receiving native tokens.",
126
150
  "custom:requirements": "- Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. - If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. - If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.",
127
- "details": "Generic executor function to: - send native tokens to any address. - interact with any contract by passing an abi-encoded function call in the `data` parameter. - deploy a contract by providing its creation bytecode in the `data` parameter. Requirements: - SHOULD only be callable by the owner of the contract set via ERC173. - if a `value` is provided, the contract MUST have at least this amount in its balance to execute successfully. - if the operation type is STATICCALL or DELEGATECALL, `value` SHOULD be 0. - `target` SHOULD be address(0) when deploying a contract. Emits an {Executed} event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) Emits a {ContractCreated} event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2)",
151
+ "details": "Generic executor function to: - send native tokens to any address. - interact with any contract by passing an abi-encoded function call in the `data` parameter. - deploy a contract by providing its creation bytecode in the `data` parameter.",
128
152
  "params": {
129
- "data": "The call data, or the creation bytecode of the contract to deploy",
153
+ "data": "The call data, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`.",
130
154
  "operationType": "The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4",
131
155
  "target": "The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2)",
132
156
  "value": "The amount of native tokens to transfer (in Wei)"
@@ -135,23 +159,26 @@
135
159
  "executeBatch(uint256[],address[],uint256[],bytes[])": {
136
160
  "custom:events": "- {Executed} event for each call that uses under `operationType`: `CALL` (0), `STATICCALL` (3) and `DELEGATECALL` (4). (each iteration) - {ContractCreated} event, when a contract is created under `operationType`: `CREATE` (1) and `CREATE2` (2) (each iteration) - {ValueReceived} event when receiving native tokens.",
137
161
  "custom:requirements": "- The length of the parameters provided must be equal. - Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - If a `value` is provided, the contract must have at least this amount in its balance to execute successfully. - If the operation type is `CREATE` (1) or `CREATE2` (2), `target` must be `address(0)`. - If the operation type is `STATICCALL` (3) or `DELEGATECALL` (4), `value` transfer is disallowed and must be 0.",
138
- "details": "Generic batch executor function to: - send native tokens to any address. - interact with any contract by passing an abi-encoded function call in the `datas` parameter. - deploy a contract by providing its creation bytecode in the `datas` parameter. Requirements: - The length of the parameters provided MUST be equal - SHOULD only be callable by the owner of the contract set via ERC173. - if a `values` is provided, the contract MUST have at least this amount in its balance to execute successfully. - if the operation type is STATICCALL or DELEGATECALL, `values` SHOULD be 0. - `targets` SHOULD be address(0) when deploying a contract. Emits an {Executed} event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) Emits a {ContractCreated} event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2)",
162
+ "custom:warning": "- The `msg.value` should not be trusted for any method called within the batch with `operationType`: `DELEGATECALL` (4).",
163
+ "details": "Batch executor function that behaves the same as {execute} but allowing multiple operations in the same transaction.",
139
164
  "params": {
140
- "datas": "The list of call data, or the creation bytecode of the contract to deploy",
141
- "operationsType": "The list of operations type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4",
165
+ "datas": "The list of calldata, or the creation bytecode of the contract to deploy if `operationType` is `1` or `2`.",
166
+ "operationsType": "The list of operations type used: `CALL = 0`; `CREATE = 1`; `CREATE2 = 2`; `STATICCALL = 3`; `DELEGATECALL = 4`",
142
167
  "targets": "The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2).",
143
- "values": "The list of native token amounts to transfer (in Wei)"
168
+ "values": "The list of native token amounts to transfer (in Wei)."
144
169
  }
145
170
  },
146
171
  "getData(bytes32)": {
172
+ "details": "Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`.",
147
173
  "params": {
148
- "dataKey": "The key which value to retrieve"
174
+ "dataKey": "The data key for which to retrieve the value."
149
175
  },
150
176
  "returns": {
151
- "dataValue": "The data stored at the key"
177
+ "dataValue": "The bytes value stored under the specified data key."
152
178
  }
153
179
  },
154
180
  "getDataBatch(bytes32[])": {
181
+ "details": "Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`.",
155
182
  "params": {
156
183
  "dataKeys": "The array of keys which values to retrieve"
157
184
  },
@@ -160,13 +187,13 @@
160
187
  }
161
188
  },
162
189
  "isValidSignature(bytes32,bytes)": {
163
- "details": "Handles two cases: 1. If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the `magicValue` if the address recovered is the same as the owner, indicating that it was a valid signature. - If the address is different, it returns the fail value indicating that the signature is not valid. 2. If the owner is a smart contract, it forwards the call of {isValidSignature()} to the owner contract: - If the contract fails or returns the fail value, the {isValidSignature()} on the account returns the fail value, indicating that the signature is not valid. - If the {isValidSignature()} on the owner returned the `magicValue`, the {isValidSignature()} on the account returns the `magicValue`, indicating that it's a valid signature.",
190
+ "details": "Handles two cases: 1. If the owner is an EOA, recovers an address from the hash and the signature provided: - Returns the `_ERC1271_SUCCESSVALUE` if the address recovered is the same as the owner, indicating that it was a valid signature. - If the address is different, it returns the `_ERC1271_FAILVALUE` indicating that the signature is not valid. 2. If the owner is a smart contract, it forwards the call of {isValidSignature()} to the owner contract: - If the contract fails or returns the `_ERC1271_FAILVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_FAILVALUE`, indicating that the signature is not valid. - If the {isValidSignature()} on the owner returned the `_ERC1271_SUCCESSVALUE`, the {isValidSignature()} on the account returns the `_ERC1271_SUCCESSVALUE`, indicating that it's a valid signature.",
164
191
  "params": {
165
192
  "dataHash": "The hash of the data to be validated.",
166
193
  "signature": "A signature that can validate the previous parameter (Hash)."
167
194
  },
168
195
  "returns": {
169
- "magicValue": "A `bytes4` value that indicates if the signature is valid or not."
196
+ "returnedStatus": "A `bytes4` value that indicates if the signature is valid or not."
170
197
  }
171
198
  },
172
199
  "owner()": {
@@ -177,25 +204,26 @@
177
204
  "details": "The address that ownership of the contract is transferred to. This address may use {acceptOwnership()} to gain ownership of the contract."
178
205
  },
179
206
  "renounceOwnership()": {
180
- "custom:danger": "Leaves the contract without an owner. Once ownership of the contract has been renounced, any functions that are restricted to be called by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.",
207
+ "custom:danger": "Leaves the contract without an owner. Once ownership of the contract has been renounced, any functions that are restricted to be called by the owner or an address allowed by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.",
181
208
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
182
209
  "details": "Renounce ownership of the contract in a 2-step process. 1. The first call will initiate the process of renouncing ownership. 2. The second call is used as a confirmation and will leave the contract without an owner."
183
210
  },
184
211
  "setData(bytes32,bytes)": {
185
212
  "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
186
213
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
214
+ "details": "Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data.",
187
215
  "params": {
188
- "dataKey": "The key to retrieve stored value",
189
- "dataValue": "The value to set SHOULD only be callable by the owner of the contract set via ERC173 The function is marked as payable to enable flexibility on child contracts If the function is not intended to receive value, an additional check should be implemented to check that value equal 0. Emits a {DataChanged} event."
216
+ "dataKey": "The data key for which to set a new value.",
217
+ "dataValue": "The new bytes value to set."
190
218
  }
191
219
  },
192
220
  "setDataBatch(bytes32[],bytes[])": {
193
221
  "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
194
222
  "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
195
- "details": "Sets array of data for multiple given `dataKeys` SHOULD only be callable by the owner of the contract set via ERC173 The function is marked as payable to enable flexibility on child contracts If the function is not intended to receive value, an additional check should be implemented to check that value equal 0. Emits a {DataChanged} event.",
223
+ "details": "Batch data setting function that behaves the same as {setData} but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction.",
196
224
  "params": {
197
- "dataKeys": "The array of data keys for values to set",
198
- "dataValues": "The array of values to set"
225
+ "dataKeys": "An array of data keys to set bytes values for.",
226
+ "dataValues": "An array of bytes values to set for each `dataKeys`."
199
227
  }
200
228
  },
201
229
  "supportsInterface(bytes4)": {