@lukso/lsp-smart-contracts 0.11.0-rc.0 → 0.11.1

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 (199) hide show
  1. package/README.md +1 -0
  2. package/artifacts/LSP0ERC725Account.json +7 -2
  3. package/artifacts/LSP0ERC725AccountInit.json +7 -2
  4. package/artifacts/LSP11BasicSocialRecovery.json +2 -2
  5. package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
  6. package/artifacts/LSP1UniversalReceiverDelegateUP.json +3 -79
  7. package/artifacts/LSP1UniversalReceiverDelegateVault.json +3 -41
  8. package/artifacts/LSP23LinkedContractsFactory.json +544 -0
  9. package/artifacts/LSP6KeyManager.json +24 -19
  10. package/artifacts/LSP6KeyManagerInit.json +24 -19
  11. package/artifacts/LSP7CappedSupply.json +88 -0
  12. package/artifacts/LSP7CappedSupplyInitAbstract.json +88 -0
  13. package/artifacts/LSP7CompatibleERC20.json +88 -0
  14. package/artifacts/LSP7CompatibleERC20InitAbstract.json +88 -0
  15. package/artifacts/LSP7CompatibleERC20Mintable.json +90 -2
  16. package/artifacts/LSP7CompatibleERC20MintableInit.json +90 -2
  17. package/artifacts/LSP7DigitalAsset.json +88 -0
  18. package/artifacts/LSP7DigitalAssetInitAbstract.json +88 -0
  19. package/artifacts/LSP7Mintable.json +90 -2
  20. package/artifacts/LSP7MintableInit.json +90 -2
  21. package/artifacts/LSP8CappedSupply.json +59 -0
  22. package/artifacts/LSP8CappedSupplyInitAbstract.json +59 -0
  23. package/artifacts/LSP8CompatibleERC721.json +60 -1
  24. package/artifacts/LSP8CompatibleERC721InitAbstract.json +60 -1
  25. package/artifacts/LSP8CompatibleERC721Mintable.json +62 -3
  26. package/artifacts/LSP8CompatibleERC721MintableInit.json +62 -3
  27. package/artifacts/LSP8IdentifiableDigitalAsset.json +59 -0
  28. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +59 -0
  29. package/artifacts/LSP8Mintable.json +61 -2
  30. package/artifacts/LSP8MintableInit.json +61 -2
  31. package/artifacts/LSP9Vault.json +7 -2
  32. package/artifacts/LSP9VaultInit.json +7 -2
  33. package/artifacts/UniversalProfile.json +7 -2
  34. package/artifacts/UniversalProfileInit.json +7 -2
  35. package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +8 -36
  36. package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -1
  37. package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +15 -30
  38. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +122 -206
  39. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +18 -36
  40. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +8 -34
  41. package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +148 -177
  42. package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +21 -20
  43. package/contracts/LSP14Ownable2Step/LSP14Errors.sol +13 -2
  44. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +50 -20
  45. package/contracts/LSP17ContractExtension/LSP17Errors.sol +10 -0
  46. package/contracts/LSP17ContractExtension/LSP17Extendable.sol +16 -34
  47. package/contracts/LSP17ContractExtension/LSP17Utils.sol +1 -1
  48. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +16 -11
  49. package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +5 -10
  50. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +192 -177
  51. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +150 -88
  52. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +66 -48
  53. package/contracts/LSP20CallVerification/LSP20CallVerification.sol +1 -1
  54. package/contracts/LSP23LinkedContractsDeployment/ILSP23LinkedContractsFactory.sol +192 -0
  55. package/contracts/LSP23LinkedContractsDeployment/IPostDeploymentModule.sol +18 -0
  56. package/contracts/LSP23LinkedContractsDeployment/LSP23Errors.sol +24 -0
  57. package/contracts/LSP23LinkedContractsDeployment/LSP23LinkedContractsFactory.sol +392 -0
  58. package/contracts/{LSP23MultiChainDeployment → LSP23LinkedContractsDeployment}/modules/UniversalProfileInitPostDeploymentModule.sol +5 -1
  59. package/contracts/LSP23LinkedContractsDeployment/modules/UniversalProfilePostDeploymentModule.sol +61 -0
  60. package/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol +68 -0
  61. package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +8 -0
  62. package/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol +17 -0
  63. package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +143 -0
  64. package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +256 -61
  65. package/contracts/{LSP3UniversalProfile → LSP3ProfileMetadata}/LSP3Constants.sol +3 -3
  66. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +9 -8
  67. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +13 -6
  68. package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +4 -4
  69. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +148 -189
  70. package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +26 -54
  71. package/contracts/LSP6KeyManager/LSP6Constants.sol +1 -3
  72. package/contracts/LSP6KeyManager/LSP6Errors.sol +142 -63
  73. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +7 -4
  74. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +125 -80
  75. package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +8 -4
  76. package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +1 -1
  77. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +52 -84
  78. package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +59 -10
  79. package/contracts/LSP6KeyManager/LSP6Utils.sol +67 -46
  80. package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +116 -78
  81. package/contracts/LSP7DigitalAsset/LSP7Constants.sol +4 -1
  82. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +128 -6
  83. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +212 -80
  84. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +126 -3
  85. package/contracts/LSP7DigitalAsset/LSP7Errors.sol +7 -5
  86. package/contracts/LSP7DigitalAsset/extensions/ILSP7CompatibleERC20.sol +27 -14
  87. package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +2 -4
  88. package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +2 -4
  89. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +29 -11
  90. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +30 -9
  91. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +46 -14
  92. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +43 -12
  93. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +14 -0
  94. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +9 -4
  95. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +7 -1
  96. package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +8 -8
  97. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +7 -6
  98. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +10 -2
  99. package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +120 -92
  100. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +4 -1
  101. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +135 -6
  102. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +128 -38
  103. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +134 -5
  104. package/contracts/LSP8IdentifiableDigitalAsset/extensions/ILSP8CompatibleERC721.sol +83 -41
  105. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +13 -5
  106. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +24 -0
  107. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +30 -12
  108. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +31 -10
  109. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +96 -31
  110. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +98 -23
  111. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +21 -4
  112. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +12 -2
  113. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +21 -0
  114. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +9 -4
  115. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +13 -0
  116. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +15 -6
  117. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +7 -5
  118. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +17 -2
  119. package/contracts/LSP9Vault/ILSP9Vault.sol +10 -5
  120. package/contracts/LSP9Vault/LSP9Errors.sol +3 -2
  121. package/contracts/LSP9Vault/LSP9Vault.sol +12 -4
  122. package/contracts/LSP9Vault/LSP9VaultCore.sol +245 -182
  123. package/contracts/LSP9Vault/LSP9VaultInit.sol +10 -3
  124. package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +11 -6
  125. package/contracts/UniversalProfile.sol +8 -6
  126. package/contracts/UniversalProfileInit.sol +6 -6
  127. package/contracts/UniversalProfileInitAbstract.sol +10 -3
  128. package/devdocs/LSP0ERC725Account.json +54 -37
  129. package/devdocs/LSP0ERC725AccountInit.json +56 -38
  130. package/devdocs/LSP1UniversalReceiverDelegateUP.json +14 -55
  131. package/devdocs/LSP1UniversalReceiverDelegateVault.json +9 -33
  132. package/devdocs/LSP23LinkedContractsFactory.json +81 -0
  133. package/devdocs/LSP4DigitalAssetMetadata.json +5 -5
  134. package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +4 -4
  135. package/devdocs/LSP6KeyManager.json +109 -70
  136. package/devdocs/LSP6KeyManagerInit.json +109 -70
  137. package/devdocs/LSP7CappedSupply.json +90 -42
  138. package/devdocs/LSP7CappedSupplyInitAbstract.json +86 -40
  139. package/devdocs/LSP7CompatibleERC20.json +79 -43
  140. package/devdocs/LSP7CompatibleERC20InitAbstract.json +75 -39
  141. package/devdocs/LSP7CompatibleERC20Mintable.json +87 -40
  142. package/devdocs/LSP7CompatibleERC20MintableInit.json +82 -42
  143. package/devdocs/LSP7DigitalAsset.json +76 -40
  144. package/devdocs/LSP7DigitalAssetInitAbstract.json +73 -37
  145. package/devdocs/LSP7Mintable.json +79 -51
  146. package/devdocs/LSP7MintableInit.json +78 -49
  147. package/devdocs/LSP8CappedSupply.json +72 -43
  148. package/devdocs/LSP8CappedSupplyInitAbstract.json +68 -41
  149. package/devdocs/LSP8CompatibleERC721.json +85 -64
  150. package/devdocs/LSP8CompatibleERC721InitAbstract.json +81 -60
  151. package/devdocs/LSP8CompatibleERC721Mintable.json +98 -60
  152. package/devdocs/LSP8CompatibleERC721MintableInit.json +93 -62
  153. package/devdocs/LSP8IdentifiableDigitalAsset.json +58 -41
  154. package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +57 -40
  155. package/devdocs/LSP8Mintable.json +65 -48
  156. package/devdocs/LSP8MintableInit.json +64 -47
  157. package/devdocs/LSP9Vault.json +61 -18
  158. package/devdocs/LSP9VaultInit.json +59 -17
  159. package/devdocs/UniversalProfile.json +53 -35
  160. package/devdocs/UniversalProfileInit.json +53 -35
  161. package/dist/constants.cjs.js +6236 -2587
  162. package/dist/constants.d.ts +3851 -1129
  163. package/dist/constants.es.js +6236 -2587
  164. package/package.json +6 -4
  165. package/userdocs/LSP0ERC725Account.json +40 -8
  166. package/userdocs/LSP0ERC725AccountInit.json +40 -8
  167. package/userdocs/LSP1UniversalReceiverDelegateUP.json +18 -2
  168. package/userdocs/LSP1UniversalReceiverDelegateVault.json +18 -2
  169. package/userdocs/LSP23LinkedContractsFactory.json +29 -0
  170. package/userdocs/LSP4DigitalAssetMetadata.json +1 -1
  171. package/userdocs/LSP6KeyManager.json +144 -6
  172. package/userdocs/LSP6KeyManagerInit.json +147 -6
  173. package/userdocs/LSP7CappedSupply.json +18 -3
  174. package/userdocs/LSP7CappedSupplyInitAbstract.json +17 -2
  175. package/userdocs/LSP7CompatibleERC20.json +3 -9
  176. package/userdocs/LSP7CompatibleERC20InitAbstract.json +2 -8
  177. package/userdocs/LSP7CompatibleERC20Mintable.json +5 -8
  178. package/userdocs/LSP7CompatibleERC20MintableInit.json +3 -9
  179. package/userdocs/LSP7DigitalAsset.json +2 -2
  180. package/userdocs/LSP7DigitalAssetInitAbstract.json +2 -2
  181. package/userdocs/LSP7Mintable.json +3 -3
  182. package/userdocs/LSP7MintableInit.json +3 -3
  183. package/userdocs/LSP8CappedSupply.json +16 -1
  184. package/userdocs/LSP8CappedSupplyInitAbstract.json +15 -0
  185. package/userdocs/LSP8CompatibleERC721.json +24 -3
  186. package/userdocs/LSP8CompatibleERC721InitAbstract.json +23 -2
  187. package/userdocs/LSP8CompatibleERC721Mintable.json +29 -2
  188. package/userdocs/LSP8CompatibleERC721MintableInit.json +27 -3
  189. package/userdocs/LSP8Mintable.json +4 -1
  190. package/userdocs/LSP8MintableInit.json +4 -1
  191. package/userdocs/LSP9Vault.json +50 -4
  192. package/userdocs/LSP9VaultInit.json +50 -4
  193. package/userdocs/UniversalProfile.json +40 -8
  194. package/userdocs/UniversalProfileInit.json +40 -8
  195. package/contracts/LSP0ERC725Account/LSP0Utils.sol +0 -47
  196. package/contracts/LSP23MultiChainDeployment/IOwnerControlledContractDeployer.sol +0 -174
  197. package/contracts/LSP23MultiChainDeployment/IPostDeploymentModule.sol +0 -10
  198. package/contracts/LSP23MultiChainDeployment/LSP23Errors.sol +0 -24
  199. package/contracts/LSP23MultiChainDeployment/OwnerControlledContractDeployer.sol +0 -388
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  _LSP3_SUPPORTED_STANDARDS_KEY,
12
12
  _LSP3_SUPPORTED_STANDARDS_VALUE
13
- } from "./LSP3UniversalProfile/LSP3Constants.sol";
13
+ } from "./LSP3ProfileMetadata/LSP3Constants.sol";
14
14
 
15
15
  /**
16
16
  * @title Inheritable Proxy implementation of a LUKSO's Universal Profile based on LSP3
@@ -21,8 +21,15 @@ abstract contract UniversalProfileInitAbstract is
21
21
  LSP0ERC725AccountInitAbstract
22
22
  {
23
23
  /**
24
- * @inheritdoc LSP0ERC725AccountInitAbstract
25
- * @dev Set the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store.
24
+ * @dev Set `initialOwner` as the contract owner and the `SupportedStandards:LSP3UniversalProfile` data key in the ERC725Y data key/value store.
25
+ *
26
+ * @param initialOwner The owner of the contract.
27
+ *
28
+ * @custom:warning ERC725X & ERC725Y parent contracts are not initialised as they don't have non-zero initial state. If you decide to add non-zero initial state to any of those contracts, you must initialize them here.
29
+ *
30
+ * @custom:events
31
+ * - {ValueReceived} event when funding the contract on deployment.
32
+ * - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.
26
33
  */
27
34
  function _initialize(
28
35
  address initialOwner
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "author": "Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42)",
3
- "details": "A smart contract account including basic functionalities such as: - Detecting supported standards using ERC165 https://eips.ethereum.org/EIPS/eip-165 - Executing several operation on other addresses including creating contracts using ERC725X https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md - Storing data in a generic way using ERC725Y https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md - Validating signatures using ERC1271 https://eips.ethereum.org/EIPS/eip-1271 - Receiving notification and react on them using LSP1 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md - Secure ownership management using LSP14 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md - Extending the account with new functions and interfaceIds of future standards using LSP17 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md - Verifying calls on the owner to allow unified and standard interaction with the account using LSP20 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-20-CallVerification.md",
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
5
  "CannotTransferOwnershipToSelf()": [
6
6
  {
7
- "details": "reverts when trying to transfer ownership to the address(this)"
7
+ "details": "Reverts when trying to transfer ownership to the `address(this)`."
8
8
  }
9
9
  ],
10
10
  "ERC725X_ContractDeploymentFailed()": [
@@ -61,6 +61,11 @@
61
61
  "details": "reverts when there is not the same number of elements in the lists of data keys and data values when calling setDataBatch."
62
62
  }
63
63
  ],
64
+ "LSP14MustAcceptOwnershipInSeparateTransaction()": [
65
+ {
66
+ "details": "Reverts when pending owner accept ownership in the same transaction of transferring ownership."
67
+ }
68
+ ],
64
69
  "LSP20CallingVerifierFailed(bool)": [
65
70
  {
66
71
  "details": "reverts when the call to the owner fail with no revert reason",
@@ -85,52 +90,57 @@
85
90
  ],
86
91
  "NotInRenounceOwnershipInterval(uint256,uint256)": [
87
92
  {
88
- "details": "reverts when trying to renounce ownership before the initial confirmation delay"
93
+ "details": "Reverts when trying to renounce ownership before the initial confirmation delay.",
94
+ "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."
97
+ }
89
98
  }
90
99
  ]
91
100
  },
92
101
  "kind": "dev",
93
102
  "methods": {
94
103
  "acceptOwnership()": {
95
- "custom:requirements": "- MUST be called by the pendingOwner. - When notifying the previous owner via LSP1, the typeId used MUST be `keccak256('LSP0OwnershipTransferred_SenderNotification')`. - When notifying the new owner via LSP1, the typeId used MUST be `keccak256('LSP0OwnershipTransferred_RecipientNotification')`.",
96
- "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."
104
+ "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."
97
106
  },
98
107
  "batchCalls(bytes[])": {
99
- "details": "Allows a caller to batch different function calls in one call. Perform a delegatecall on self, to call different functions with preserving the context It is not possible to send value along the functions call due to the use of delegatecall.",
108
+ "custom:info": "It's not possible to send value along the functions call due to the use of `delegatecall`.",
109
+ "details": "Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context.",
100
110
  "params": {
101
111
  "data": "An array of ABI encoded function calls to be called on the contract."
102
112
  },
103
113
  "returns": {
104
- "results": "An array of values returned by the executed functions."
114
+ "results": "An array of abi-encoded data returned by the functions executed."
105
115
  }
106
116
  },
107
117
  "constructor": {
108
- "custom:events": "{ValueReceived} event when funding the contract on deployment.",
118
+ "custom:events": "- {ValueReceived} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
109
119
  "details": "Set `initialOwner` as the contract owner. The `constructor` also allows funding the contract on deployment.",
110
120
  "params": {
111
121
  "initialOwner": "The owner of the contract."
112
122
  }
113
123
  },
114
124
  "execute(uint256,address,uint256,bytes)": {
115
- "custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 - {ValueReceived} event when receiving native tokens.",
116
- "custom:requirements": "- 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. - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
117
- "details": "Executes any call on other addresses.",
125
+ "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
+ "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)",
118
128
  "params": {
119
- "data": "The call data to execute on `target`, or the bytecode of the contract to deploy.",
120
- "operationType": "The operation to execute: `CALL = 0`, `CREATE = 1` `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
121
- "target": "The address (smart contract/EOA) to interact with, `target` will be unused if a contract is created (`CREATE` & `CREATE2`).",
122
- "value": "The amount of native tokens to transfer (in Wei)."
129
+ "data": "The call data, or the creation bytecode of the contract to deploy",
130
+ "operationType": "The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4",
131
+ "target": "The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2)",
132
+ "value": "The amount of native tokens to transfer (in Wei)"
123
133
  }
124
134
  },
125
135
  "executeBatch(uint256[],address[],uint256[],bytes[])": {
126
- "custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 (each iteration) - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 (each iteration) - {ValueReceived} event when receiving native tokens.",
127
- "custom:requirements": "- The length of the parameters provided MUST be equal - 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. - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
128
- "details": "Generic batch executor function that executes any call on other addresses",
136
+ "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
+ "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)",
129
139
  "params": {
130
- "datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy.",
131
- "operationsType": "The list of operations type used: `CALL = 0`, `CREATE = 1`, `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
132
- "targets": "The list of addresses to call. `targets` will be unused if a contract is created (`CREATE` & `CREATE2`).",
133
- "values": "The list of native token amounts to transfer (in Wei)."
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",
142
+ "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)"
134
144
  }
135
145
  },
136
146
  "getData(bytes32)": {
@@ -150,56 +160,63 @@
150
160
  }
151
161
  },
152
162
  "isValidSignature(bytes32,bytes)": {
153
- "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.",
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.",
154
164
  "params": {
155
165
  "dataHash": "The hash of the data to be validated.",
156
166
  "signature": "A signature that can validate the previous parameter (Hash)."
157
167
  },
158
168
  "returns": {
159
- "magicValue": "A bytes4 value that indicates if the signature is valid or not."
169
+ "magicValue": "A `bytes4` value that indicates if the signature is valid or not."
160
170
  }
161
171
  },
162
172
  "owner()": {
163
173
  "details": "Returns the address of the current owner."
164
174
  },
165
175
  "pendingOwner()": {
176
+ "custom:info": "If no ownership transfer is in progress, the pendingOwner will be `address(0).`.",
166
177
  "details": "The address that ownership of the contract is transferred to. This address may use {acceptOwnership()} to gain ownership of the contract."
167
178
  },
168
179
  "renounceOwnership()": {
169
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.",
170
- "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 is used as a confirmation and will leave the contract without an owner. MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification"
181
+ "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
182
+ "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."
171
183
  },
172
184
  "setData(bytes32,bytes)": {
173
185
  "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
174
- "custom:requirements": "- MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
175
- "details": "Sets singular data for a given `dataKey`",
186
+ "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
176
187
  "params": {
177
188
  "dataKey": "The key to retrieve stored value",
178
- "dataValue": "The value to set"
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."
179
190
  }
180
191
  },
181
192
  "setDataBatch(bytes32[],bytes[])": {
182
193
  "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
183
- "custom:requirements": "- MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
184
- "details": "Sets array of data for multiple given `dataKeys`",
194
+ "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.",
185
196
  "params": {
186
197
  "dataKeys": "The array of data keys for values to set",
187
198
  "dataValues": "The array of values to set"
188
199
  }
189
200
  },
190
201
  "supportsInterface(bytes4)": {
191
- "details": "Returns true if this contract implements the interface defined by `interfaceId`. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to LSP17, and checks if the extension implements the interface defined by `interfaceId`."
202
+ "details": "Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`.",
203
+ "params": {
204
+ "interfaceId": "The interface ID to check if the contract supports it."
205
+ },
206
+ "returns": {
207
+ "_0": "`true` if this contract implements the interface defined by `interfaceId`, `false` otherwise."
208
+ }
192
209
  },
193
210
  "transferOwnership(address)": {
194
- "custom:requirements": "- MUST pass when called by the owner or by an authorized address that passes the verification check performed on the owner according to [LSP20-CallVerification] specification. - When notifying the new owner via LSP1, the `typeId` used MUST be `keccak256('LSP0OwnershipTransferStarted')`. - Pending owner cannot accept ownership in the same tx via the LSP1 hook.",
195
- "details": "Sets the address of the `pendingNewOwner` as a pending owner that should call {`acceptOwnership()`} in order to complete the ownership transfer to become the new {`owner()`} of the account. Notifies the pending owner via LSP1Standard by calling {universalReceiver()} on the pending owner if it's an address that supports LSP1.",
211
+ "custom:requirements": "- Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted]. - Pending owner cannot accept ownership in the same tx via the LSP1 hook.",
212
+ "details": "Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the {universalReceiver()} function on the `newOwner` contract.",
196
213
  "params": {
197
- "pendingNewOwner": "The address of the new pending owner."
214
+ "newOwner": "The address of the new owner."
198
215
  }
199
216
  },
200
217
  "universalReceiver(bytes32,bytes)": {
201
- "custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event.",
202
- "details": "The function performs the following steps: 1. Query the ERC725Y storage with the data key `[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]`. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the ERC725Y storage with the data key `[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY] + <bytes32 typeId>`. (Check [LSP2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
218
+ "custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
219
+ "details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
203
220
  "params": {
204
221
  "receivedData": "The data received.",
205
222
  "typeId": "The type of call received."
@@ -209,6 +226,6 @@
209
226
  }
210
227
  }
211
228
  },
212
- "title": "Deployable Implementation of LSP0-ERC725Account Standard https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md",
229
+ "title": "Deployable Implementation of [LSP-0-ERC725Account] Standard.",
213
230
  "version": 1
214
231
  }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "author": "Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42)",
3
- "details": "A smart contract account including basic functionalities such as: - Detecting supported standards using ERC165 https://eips.ethereum.org/EIPS/eip-165 - Executing several operation on other addresses including creating contracts using ERC725X https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md - Storing data in a generic way using ERC725Y https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md - Validating signatures using ERC1271 https://eips.ethereum.org/EIPS/eip-1271 - Receiving notification and react on them using LSP1 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-1-UniversalReceiver.md - Secure ownership management using LSP14 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-14-Ownable2Step.md - Extending the account with new functions and interfaceIds of future standards using LSP17 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-17-ContractExtension.md - Verifying calls on the owner to allow unified and standard interaction with the account using LSP20 https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-20-CallVerification.md",
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
5
  "CannotTransferOwnershipToSelf()": [
6
6
  {
7
- "details": "reverts when trying to transfer ownership to the address(this)"
7
+ "details": "Reverts when trying to transfer ownership to the `address(this)`."
8
8
  }
9
9
  ],
10
10
  "ERC725X_ContractDeploymentFailed()": [
@@ -61,6 +61,11 @@
61
61
  "details": "reverts when there is not the same number of elements in the lists of data keys and data values when calling setDataBatch."
62
62
  }
63
63
  ],
64
+ "LSP14MustAcceptOwnershipInSeparateTransaction()": [
65
+ {
66
+ "details": "Reverts when pending owner accept ownership in the same transaction of transferring ownership."
67
+ }
68
+ ],
64
69
  "LSP20CallingVerifierFailed(bool)": [
65
70
  {
66
71
  "details": "reverts when the call to the owner fail with no revert reason",
@@ -85,48 +90,53 @@
85
90
  ],
86
91
  "NotInRenounceOwnershipInterval(uint256,uint256)": [
87
92
  {
88
- "details": "reverts when trying to renounce ownership before the initial confirmation delay"
93
+ "details": "Reverts when trying to renounce ownership before the initial confirmation delay.",
94
+ "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."
97
+ }
89
98
  }
90
99
  ]
91
100
  },
92
101
  "kind": "dev",
93
102
  "methods": {
94
103
  "acceptOwnership()": {
95
- "custom:requirements": "- MUST be called by the pendingOwner. - When notifying the previous owner via LSP1, the typeId used MUST be `keccak256('LSP0OwnershipTransferred_SenderNotification')`. - When notifying the new owner via LSP1, the typeId used MUST be `keccak256('LSP0OwnershipTransferred_RecipientNotification')`.",
96
- "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."
104
+ "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."
97
106
  },
98
107
  "batchCalls(bytes[])": {
99
- "details": "Allows a caller to batch different function calls in one call. Perform a delegatecall on self, to call different functions with preserving the context It is not possible to send value along the functions call due to the use of delegatecall.",
108
+ "custom:info": "It's not possible to send value along the functions call due to the use of `delegatecall`.",
109
+ "details": "Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context.",
100
110
  "params": {
101
111
  "data": "An array of ABI encoded function calls to be called on the contract."
102
112
  },
103
113
  "returns": {
104
- "results": "An array of values returned by the executed functions."
114
+ "results": "An array of abi-encoded data returned by the functions executed."
105
115
  }
106
116
  },
107
117
  "constructor": {
108
118
  "details": "Locks the base contract on deployment, so that it cannot be initialized, owned and controlled by anyone after it has been deployed. This is intended so that the sole purpose of this contract is to be used as a base contract behind a proxy."
109
119
  },
110
120
  "execute(uint256,address,uint256,bytes)": {
111
- "custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 - {ValueReceived} event when receiving native tokens.",
112
- "custom:requirements": "- 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. - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
113
- "details": "Executes any call on other addresses.",
121
+ "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.",
122
+ "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.",
123
+ "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)",
114
124
  "params": {
115
- "data": "The call data to execute on `target`, or the bytecode of the contract to deploy.",
116
- "operationType": "The operation to execute: `CALL = 0`, `CREATE = 1` `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
117
- "target": "The address (smart contract/EOA) to interact with, `target` will be unused if a contract is created (`CREATE` & `CREATE2`).",
118
- "value": "The amount of native tokens to transfer (in Wei)."
125
+ "data": "The call data, or the creation bytecode of the contract to deploy",
126
+ "operationType": "The operation type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4",
127
+ "target": "The address of the EOA or smart contract. (unused if a contract is created via operation type 1 or 2)",
128
+ "value": "The amount of native tokens to transfer (in Wei)"
119
129
  }
120
130
  },
121
131
  "executeBatch(uint256[],address[],uint256[],bytes[])": {
122
- "custom:events": "- {Executed} event, when a call is executed under `operationType` 0, 3 and 4 (each iteration) - {ContractCreated} event, when a contract is created under `operationType` 1 and 2 (each iteration) - {ValueReceived} event when receiving native tokens.",
123
- "custom:requirements": "- The length of the parameters provided MUST be equal - 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. - MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
124
- "details": "Generic batch executor function that executes any call on other addresses",
132
+ "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.",
133
+ "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.",
134
+ "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)",
125
135
  "params": {
126
- "datas": "The list of call data to execute on `targets`, or the creation bytecode of the contracts to deploy.",
127
- "operationsType": "The list of operations type used: `CALL = 0`, `CREATE = 1`, `CREATE2 = 2`, `STATICCALL = 3`, `DELEGATECALL = 4`.",
128
- "targets": "The list of addresses to call. `targets` will be unused if a contract is created (`CREATE` & `CREATE2`).",
129
- "values": "The list of native token amounts to transfer (in Wei)."
136
+ "datas": "The list of call data, or the creation bytecode of the contract to deploy",
137
+ "operationsType": "The list of operations type used: CALL = 0; CREATE = 1; CREATE2 = 2; STATICCALL = 3; DELEGATECALL = 4",
138
+ "targets": "The list of addresses to call. `targets` will be unused if a contract is created (operation types 1 and 2).",
139
+ "values": "The list of native token amounts to transfer (in Wei)"
130
140
  }
131
141
  },
132
142
  "getData(bytes32)": {
@@ -146,62 +156,70 @@
146
156
  }
147
157
  },
148
158
  "initialize(address)": {
149
- "details": "Set `initialOwner` as the contract owner. The `initialOwner` will then be allowed to call protected functions marked with the `onlyOwner` modifier. The `initialize(address)` function also allows funding the contract on initialization. Emitted Events: - ValueReceived: when the contract is funded on initialization.",
159
+ "custom:events": "- {ValueReceived} event when funding the contract on deployment. - {OwnershipTransferred} event when `initialOwner` is set as the contract {owner}.",
160
+ "details": "Set `initialOwner` as the contract owner. The `initialize(address)` also allows funding the contract on deployment.",
150
161
  "params": {
151
- "initialOwner": "the owner of the contract"
162
+ "initialOwner": "The owner of the contract."
152
163
  }
153
164
  },
154
165
  "isValidSignature(bytes32,bytes)": {
155
- "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.",
166
+ "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.",
156
167
  "params": {
157
168
  "dataHash": "The hash of the data to be validated.",
158
169
  "signature": "A signature that can validate the previous parameter (Hash)."
159
170
  },
160
171
  "returns": {
161
- "magicValue": "A bytes4 value that indicates if the signature is valid or not."
172
+ "magicValue": "A `bytes4` value that indicates if the signature is valid or not."
162
173
  }
163
174
  },
164
175
  "owner()": {
165
176
  "details": "Returns the address of the current owner."
166
177
  },
167
178
  "pendingOwner()": {
179
+ "custom:info": "If no ownership transfer is in progress, the pendingOwner will be `address(0).`.",
168
180
  "details": "The address that ownership of the contract is transferred to. This address may use {acceptOwnership()} to gain ownership of the contract."
169
181
  },
170
182
  "renounceOwnership()": {
171
183
  "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.",
172
- "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 is used as a confirmation and will leave the contract without an owner. MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification"
184
+ "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
185
+ "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."
173
186
  },
174
187
  "setData(bytes32,bytes)": {
175
188
  "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event.",
176
- "custom:requirements": "- MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
177
- "details": "Sets singular data for a given `dataKey`",
189
+ "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
178
190
  "params": {
179
191
  "dataKey": "The key to retrieve stored value",
180
- "dataValue": "The value to set"
192
+ "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."
181
193
  }
182
194
  },
183
195
  "setDataBatch(bytes32[],bytes[])": {
184
196
  "custom:events": "- {ValueReceived} event when receiving native tokens. - {DataChanged} event. (on each iteration of setting data)",
185
- "custom:requirements": "- MUST pass when called by the owner or by an authorised address that pass the verification check performed on the owner accordinng to [LSP20-CallVerification] specification",
186
- "details": "Sets array of data for multiple given `dataKeys`",
197
+ "custom:requirements": "Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner.",
198
+ "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.",
187
199
  "params": {
188
200
  "dataKeys": "The array of data keys for values to set",
189
201
  "dataValues": "The array of values to set"
190
202
  }
191
203
  },
192
204
  "supportsInterface(bytes4)": {
193
- "details": "Returns true if this contract implements the interface defined by `interfaceId`. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to LSP17, and checks if the extension implements the interface defined by `interfaceId`."
205
+ "details": "Achieves the goal of [ERC-165] to detect supported interfaces and [LSP-17-ContractExtension] by checking if the interfaceId being queried is supported on another linked extension. If the contract doesn't support the `interfaceId`, it forwards the call to the `supportsInterface` extension according to [LSP-17-ContractExtension], and checks if the extension implements the interface defined by `interfaceId`.",
206
+ "params": {
207
+ "interfaceId": "The interface ID to check if the contract supports it."
208
+ },
209
+ "returns": {
210
+ "_0": "`true` if this contract implements the interface defined by `interfaceId`, `false` otherwise."
211
+ }
194
212
  },
195
213
  "transferOwnership(address)": {
196
- "custom:requirements": "- MUST pass when called by the owner or by an authorized address that passes the verification check performed on the owner according to [LSP20-CallVerification] specification. - When notifying the new owner via LSP1, the `typeId` used MUST be `keccak256('LSP0OwnershipTransferStarted')`. - Pending owner cannot accept ownership in the same tx via the LSP1 hook.",
197
- "details": "Sets the address of the `pendingNewOwner` as a pending owner that should call {`acceptOwnership()`} in order to complete the ownership transfer to become the new {`owner()`} of the account. Notifies the pending owner via LSP1Standard by calling {universalReceiver()} on the pending owner if it's an address that supports LSP1.",
214
+ "custom:requirements": "- Can be only called by the {owner} or by an authorised address that pass the verification check performed on the owner. - When notifying the new owner via LSP1, the `typeId` used must be the `keccak256(...)` hash of [LSP0OwnershipTransferStarted]. - Pending owner cannot accept ownership in the same tx via the LSP1 hook.",
215
+ "details": "Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the {universalReceiver()} function on the `newOwner` contract.",
198
216
  "params": {
199
- "pendingNewOwner": "The address of the new pending owner."
217
+ "newOwner": "The address of the new owner."
200
218
  }
201
219
  },
202
220
  "universalReceiver(bytes32,bytes)": {
203
- "custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event.",
204
- "details": "The function performs the following steps: 1. Query the ERC725Y storage with the data key `[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]`. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the ERC725Y storage with the data key `[_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY] + <bytes32 typeId>`. (Check [LSP2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
221
+ "custom:events": "- {ValueReceived} when receiving native tokens. - {UniversalReceiver} event with the function parameters, call options, and the response of the UniversalReceiverDelegates (URD) contract that was called.",
222
+ "details": "Achieves the goal of [LSP-1-UniversalReceiver] by allowing the account to be notified about incoming/outgoing transactions and enabling reactions to these actions. The reaction is achieved by having two external contracts ([LSP1UniversalReceiverDelegate]) that react on the whole transaction and on the specific typeId, respectively. The function performs the following steps: 1. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY]. - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function. 2. Query the [ERC-725Y] storage with the data key [_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX] + `bytes32(typeId)`. (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - If there is an address stored under the data key, check if this address supports the LSP1 interfaceId. - If yes, call this address with the typeId and data (params), along with additional calldata consisting of 20 bytes of `msg.sender` and 32 bytes of `msg.value`. If not, continue the execution of the function.",
205
223
  "params": {
206
224
  "receivedData": "The data received.",
207
225
  "typeId": "The type of call received."
@@ -211,6 +229,6 @@
211
229
  }
212
230
  }
213
231
  },
214
- "title": "Deployable Proxy Implementation of LSP0-ERC725Account Standard https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md",
232
+ "title": "Deployable Proxy Implementation of [LSP-0-ERC725Account] Standard.",
215
233
  "version": 1
216
234
  }
@@ -1,68 +1,18 @@
1
1
  {
2
2
  "author": "Fabian Vogelsteller, Yamen Merhi, Jean Cavallera",
3
- "details": "This UniversalReceiverDelegate follows the {LSP1-UniversalReceiver} standards and is designed for LSP0ERC725Account contracts.Handles two cases: - Registers the address of received assets (exclusively LSP7 and LSP8) and vaults (exclusively LSP9) according to {LSP5-ReceivedAssets} and {LSP10-ReceivedVaults} respectively https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-5-ReceivedAssets.md https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-10-ReceivedVaults.md - Removes the address of registered assets and vaults when the full balance is sent from the LSP0ERC725Account contract Requirements: - The contract should be able to setData the LSP5 and LSP10 data Keys according to the logic of the owner of the LSP0ERC725Account. For example, for contracts that are owned by an LSP6KeyManager, this contract should be granted the SUPER/SETDATA and REENTRANCY Permission. Assets and Vaults that are compliant with this version of the UniversalReceiverDelegate are: - LSP7-DigitalAsset: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-7-DigitalAsset.md - LSP8-IdentifiableDigitalAsset: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-8-IdentifiableDigitalAsset.md - LSP9-Vault: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-9-Vault.md",
3
+ "details": "The {LSP1UniversalReceiverDelegateUP} follows the [LSP-1-UniversalReceiver] standard and is designed for [LSP-0-ERC725Account] contracts. The {LSP1UniversalReceiverDelegateUP} is a contract called by the {universalReceiver(...)} function of the [LSP-0-ERC725Account] contract that: - Writes the data keys representing assets received from type [LSP-7-DigitalAsset] and [LSP-8-IdentifiableDigitalAsset] into the account storage, and removes them when the balance is zero according to the [LSP-5-ReceivedAssets] Standard. - Writes the data keys representing the owned vaults from type [LSP-9-Vault] into your account storage, and removes them when transferring ownership to other accounts according to the [LSP-10-ReceivedVaults] Standard.",
4
4
  "errors": {
5
5
  "CannotRegisterEOAsAsAssets(address)": [
6
6
  {
7
- "details": "reverts when EOA calls the `universalReceiver(..)` function with an asset/vault typeId",
7
+ "details": "Reverts when EOA calls the {universalReceiver(..)} function with an asset/vault typeId.",
8
8
  "params": {
9
9
  "caller": "The address of the EOA"
10
10
  }
11
11
  }
12
12
  ],
13
- "InvalidLSP10ReceivedVaultsArrayLength(bytes,uint256)": [
14
- {
15
- "details": "reverts when the value stored under the 'LSP10ReceivedVaults[]' data key is not valid. The value stored under this data key should be exactly 16 bytes long. Only possible valid values are: - any valid uint128 values i.e. 0x00000000000000000000000000000000 (zero), meaning empty array, no vaults received. i.e. 0x00000000000000000000000000000005 (non-zero), meaning 5 array elements, 5 vaults received. - 0x (nothing stored under this data key, equivalent to empty array)",
16
- "params": {
17
- "invalidValueLength": "the invalid number of bytes stored under the LSP10ReceivedVaults[] data key (MUST be 16 bytes long)",
18
- "invalidValueStored": "the invalid value stored under the LSP10ReceivedVaults[] data key"
19
- }
20
- }
21
- ],
22
- "InvalidLSP5ReceivedAssetsArrayLength(bytes,uint256)": [
23
- {
24
- "details": "reverts when the value stored under the 'LSP5ReceivedAssets[]' data key is not valid. The value stored under this data key should be exactly 16 bytes long. Only possible valid values are: - any valid uint128 values i.e. 0x00000000000000000000000000000000 (zero), empty array, no assets received. i.e. 0x00000000000000000000000000000005 (non-zero), 5 array elements, 5 assets received. - 0x (nothing stored under this data key, equivalent to empty array)",
25
- "params": {
26
- "invalidValueLength": "the invalid number of bytes stored under the LSP5ReceivedAssets[] data key (MUST be exactly 16 bytes long)",
27
- "invalidValueStored": "the invalid value stored under the LSP5ReceivedAssets[] data key"
28
- }
29
- }
30
- ],
31
- "MaxLSP10VaultsCountReached(address)": [
32
- {
33
- "details": "reverts when the `LSP10Vaults[]` array reaches its maximum limit (max(uint128))",
34
- "params": {
35
- "notRegisteredVault": "the address of the vault that could not be registered"
36
- }
37
- }
38
- ],
39
- "MaxLSP5ReceivedAssetsCountReached(address)": [
40
- {
41
- "details": "reverts when the `LSP5ReceivedAssets[]` array reaches its maximum limit (max(uint128))",
42
- "params": {
43
- "notRegisteredAsset": "the address of the asset that could not be registered"
44
- }
45
- }
46
- ],
47
13
  "NativeTokensNotAccepted()": [
48
14
  {
49
- "details": "reverts when `universalReceiver(...)` is called with a value different than 0"
50
- }
51
- ],
52
- "ReceivedAssetsIndexSuperiorToUint128(uint256)": [
53
- {
54
- "details": "reverts when the received assets index is superior to uint128",
55
- "params": {
56
- "index": "the received assets index"
57
- }
58
- }
59
- ],
60
- "VaultIndexSuperiorToUint128(uint256)": [
61
- {
62
- "details": "reverts when the vault index is superior to uint128",
63
- "params": {
64
- "index": "the vault index"
65
- }
15
+ "details": "Reverts when the {universalReceiver} function in the LSP1 Universal Receiver Delegate contract is called while sending some native tokens along the call (`msg.value` different than `0`)"
66
16
  }
67
17
  ]
68
18
  },
@@ -72,9 +22,18 @@
72
22
  "details": "See {IERC165-supportsInterface}."
73
23
  },
74
24
  "universalReceiver(bytes32,bytes)": {
75
- "details": "Handles two cases: - Registers the address of received assets (exclusively LSP7 and LSP8) and vaults (exclusively LSP9) according to {LSP5-ReceivedAssets} and {LSP10-ReceivedVaults} respectively - Removes the address of registered assets and vaults when the full balance is sent from the LSP0ERC725Account contract Requirements: - The contract should be able to setData the LSP5 and LSP10 data Keys according to the logic of the owner of the LSP0ERC725Account. - Cannot accept native tokens"
25
+ "custom:info": "- If some issues occured with generating the `dataKeys` or `dataValues` the `returnedMessage` will be an error message, otherwise it will be empty. - If an error occured when trying to use `setDataBatch(dataKeys,dataValues)`, it will return the raw error data back to the caller.",
26
+ "custom:requirements": "- This contract should be allowed to use the {setDataBatch(...)} function in order to update the LSP5 and LSP10 Data Keys. - Cannot accept native tokens",
27
+ "custom:warning": "When the data stored in the ERC725Y storage of the LSP0 contract is corrupted (_e.g: ([LSP-5-ReceivedAssets]'s Array length not 16 bytes long, the token received is already registered in `LSP5ReceivetAssets[]`, the token being sent is not sent as full balance, etc...), the function call will still pass and return (**not revert!**) and not modify any data key on the storage of the [LSP-0-ERC725Account].",
28
+ "details": "1. Writes the data keys of the received [LSP-7-DigitalAsset], [LSP-8-IdentifiableDigitalAsset] and [LSP-9-Vault] contract addresses into the account storage according to the [LSP-5-ReceivedAssets] and [LSP-10-ReceivedVaults] Standard. 2. The data keys representing an asset/vault are cleared when the asset/vault is no longer owned by the account.",
29
+ "params": {
30
+ "typeId": "Unique identifier for a specific notification."
31
+ },
32
+ "returns": {
33
+ "_0": "The result of the reaction for `typeId`."
34
+ }
76
35
  }
77
36
  },
78
- "title": "Implementation of a UniversalReceiverDelegate for LSP0ERC725Account",
37
+ "title": "Implementation of a UniversalReceiverDelegate for the [LSP-0-ERC725Account]",
79
38
  "version": 1
80
39
  }