@lukso/lsp-smart-contracts 0.13.0 → 0.15.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 (300) hide show
  1. package/README.md +2 -191
  2. package/artifacts/LSP0ERC725Account.json +3 -3
  3. package/artifacts/LSP0ERC725AccountInit.json +3 -3
  4. package/artifacts/LSP11BasicSocialRecovery.json +2 -2
  5. package/artifacts/LSP11BasicSocialRecoveryInit.json +2 -2
  6. package/artifacts/LSP1UniversalReceiverDelegateUP.json +3 -3
  7. package/artifacts/LSP1UniversalReceiverDelegateVault.json +3 -3
  8. package/artifacts/LSP23LinkedContractsFactory.json +3 -3
  9. package/artifacts/LSP4DigitalAssetMetadata.json +1 -1
  10. package/artifacts/LSP4DigitalAssetMetadataInitAbstract.json +1 -1
  11. package/artifacts/LSP6KeyManager.json +3 -3
  12. package/artifacts/LSP6KeyManagerInit.json +3 -3
  13. package/artifacts/LSP7CappedSupply.json +53 -6
  14. package/artifacts/LSP7CappedSupplyInitAbstract.json +53 -6
  15. package/artifacts/LSP7DigitalAsset.json +52 -5
  16. package/artifacts/LSP7DigitalAssetInitAbstract.json +52 -5
  17. package/artifacts/LSP7Mintable.json +54 -7
  18. package/artifacts/LSP7MintableInit.json +54 -7
  19. package/artifacts/LSP8CappedSupply.json +85 -48
  20. package/artifacts/LSP8CappedSupplyInitAbstract.json +85 -48
  21. package/artifacts/LSP8IdentifiableDigitalAsset.json +85 -48
  22. package/artifacts/LSP8IdentifiableDigitalAssetInitAbstract.json +85 -48
  23. package/artifacts/LSP8Mintable.json +88 -51
  24. package/artifacts/LSP8MintableInit.json +88 -51
  25. package/artifacts/LSP9Vault.json +3 -3
  26. package/artifacts/LSP9VaultInit.json +3 -3
  27. package/artifacts/UniversalProfile.json +3 -3
  28. package/artifacts/UniversalProfileInit.json +3 -3
  29. package/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol +1 -17
  30. package/contracts/LSP0ERC725Account/LSP0Constants.sol +1 -23
  31. package/contracts/LSP0ERC725Account/LSP0ERC725Account.sol +1 -53
  32. package/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol +1 -873
  33. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol +1 -47
  34. package/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol +1 -49
  35. package/contracts/LSP10ReceivedVaults/LSP10Constants.sol +1 -7
  36. package/contracts/LSP10ReceivedVaults/LSP10Utils.sol +1 -208
  37. package/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol +4 -2
  38. package/contracts/LSP12IssuedAssets/LSP12Constants.sol +4 -0
  39. package/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol +1 -75
  40. package/contracts/LSP14Ownable2Step/LSP14Constants.sol +1 -12
  41. package/contracts/LSP14Ownable2Step/LSP14Errors.sol +1 -29
  42. package/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol +1 -212
  43. package/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol +1 -417
  44. package/contracts/LSP17ContractExtension/LSP17Constants.sol +1 -14
  45. package/contracts/LSP17ContractExtension/LSP17Errors.sol +1 -14
  46. package/contracts/LSP17ContractExtension/LSP17Extendable.sol +1 -117
  47. package/contracts/LSP17ContractExtension/LSP17Extension.sol +1 -55
  48. package/contracts/LSP17ContractExtension/LSP17Utils.sol +1 -16
  49. package/contracts/LSP17Extensions/Extension4337.sol +1 -123
  50. package/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol +1 -13
  51. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol +1 -37
  52. package/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol +1 -21
  53. package/contracts/LSP1UniversalReceiver/LSP1Constants.sol +1 -11
  54. package/contracts/LSP1UniversalReceiver/LSP1Errors.sol +1 -7
  55. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +1 -292
  56. package/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +1 -217
  57. package/contracts/LSP1UniversalReceiver/LSP1Utils.sol +1 -84
  58. package/contracts/LSP20CallVerification/ILSP20CallVerifier.sol +1 -36
  59. package/contracts/LSP20CallVerification/LSP20CallVerification.sol +1 -117
  60. package/contracts/LSP20CallVerification/LSP20Constants.sol +1 -14
  61. package/contracts/LSP20CallVerification/LSP20Errors.sol +1 -18
  62. package/contracts/LSP23LinkedContractsFactory/ILSP23LinkedContractsFactory.sol +1 -189
  63. package/contracts/LSP23LinkedContractsFactory/IPostDeploymentModule.sol +1 -15
  64. package/contracts/LSP23LinkedContractsFactory/LSP23Errors.sol +1 -21
  65. package/contracts/LSP23LinkedContractsFactory/LSP23LinkedContractsFactory.sol +1 -393
  66. package/contracts/LSP23LinkedContractsFactory/modules/README.md +23 -0
  67. package/contracts/LSP23LinkedContractsFactory/modules/UniversalProfileInitPostDeploymentModule.sol +1 -60
  68. package/contracts/LSP23LinkedContractsFactory/modules/UniversalProfilePostDeploymentModule.sol +1 -58
  69. package/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol +1 -65
  70. package/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol +1 -5
  71. package/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol +1 -14
  72. package/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol +1 -141
  73. package/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol +1 -445
  74. package/contracts/LSP3ProfileMetadata/LSP3Constants.sol +1 -8
  75. package/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol +1 -31
  76. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol +1 -59
  77. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol +1 -44
  78. package/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol +1 -65
  79. package/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol +1 -20
  80. package/contracts/LSP5ReceivedAssets/LSP5Constants.sol +1 -7
  81. package/contracts/LSP5ReceivedAssets/LSP5Utils.sol +1 -206
  82. package/contracts/LSP6KeyManager/ILSP6KeyManager.sol +1 -60
  83. package/contracts/LSP6KeyManager/LSP6Constants.sol +1 -61
  84. package/contracts/LSP6KeyManager/LSP6Errors.sol +1 -222
  85. package/contracts/LSP6KeyManager/LSP6KeyManager.sol +1 -23
  86. package/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol +1 -694
  87. package/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol +1 -29
  88. package/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol +1 -21
  89. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol +1 -411
  90. package/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol +1 -24
  91. package/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol +1 -27
  92. package/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol +1 -848
  93. package/contracts/LSP6KeyManager/LSP6Utils.sol +1 -293
  94. package/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol +1 -302
  95. package/contracts/LSP7DigitalAsset/LSP7Constants.sol +1 -13
  96. package/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol +1 -193
  97. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol +1 -728
  98. package/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol +1 -189
  99. package/contracts/LSP7DigitalAsset/LSP7Errors.sol +1 -87
  100. package/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol +1 -23
  101. package/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol +1 -24
  102. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol +1 -80
  103. package/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol +1 -83
  104. package/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol +1 -29
  105. package/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol +1 -50
  106. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol +1 -41
  107. package/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol +1 -54
  108. package/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol +1 -326
  109. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol +1 -38
  110. package/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol +1 -102
  111. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol +1 -236
  112. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol +1 -787
  113. package/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol +1 -243
  114. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol +2 -28
  115. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol +2 -22
  116. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol +2 -84
  117. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol +2 -87
  118. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol +2 -68
  119. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol +2 -63
  120. package/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol +1 -31
  121. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol +2 -59
  122. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol +2 -42
  123. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol +2 -61
  124. package/contracts/LSP9Vault/ILSP9Vault.sol +1 -16
  125. package/contracts/LSP9Vault/LSP9Constants.sol +1 -26
  126. package/contracts/LSP9Vault/LSP9Errors.sol +1 -6
  127. package/contracts/LSP9Vault/LSP9Vault.sol +1 -63
  128. package/contracts/LSP9Vault/LSP9VaultCore.sol +1 -684
  129. package/contracts/LSP9Vault/LSP9VaultInit.sol +1 -33
  130. package/contracts/LSP9Vault/LSP9VaultInitAbstract.sol +1 -65
  131. package/contracts/UniversalProfile.sol +1 -37
  132. package/contracts/UniversalProfileInit.sol +1 -39
  133. package/contracts/UniversalProfileInitAbstract.sol +1 -44
  134. package/dist/constants.cjs +75 -0
  135. package/dist/constants.d.cts +121 -0
  136. package/dist/constants.d.mts +121 -0
  137. package/dist/constants.d.ts +107 -40105
  138. package/dist/constants.mjs +70 -0
  139. package/package.json +58 -116
  140. package/types/@lukso/lsp0-contracts/contracts/LSP0ERC725Account.ts +694 -0
  141. package/types/@lukso/lsp0-contracts/contracts/LSP0ERC725AccountInit.ts +740 -0
  142. package/types/@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.ts +139 -0
  143. package/types/@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.ts +139 -0
  144. package/types/@lukso/lsp23-contracts/contracts/LSP23LinkedContractsFactory.ts +448 -0
  145. package/types/@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.ts +274 -0
  146. package/types/@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.ts +309 -0
  147. package/types/@lukso/lsp6-contracts/contracts/LSP6KeyManager.ts +355 -0
  148. package/types/@lukso/lsp6-contracts/contracts/LSP6KeyManagerInit.ts +398 -0
  149. package/types/@lukso/lsp7-contracts/contracts/LSP7DigitalAsset.ts +698 -0
  150. package/types/@lukso/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.ts +729 -0
  151. package/types/@lukso/lsp7-contracts/contracts/extensions/LSP7CappedSupply.ts +712 -0
  152. package/types/@lukso/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.ts +743 -0
  153. package/types/@lukso/lsp7-contracts/contracts/presets/LSP7Mintable.ts +717 -0
  154. package/types/@lukso/lsp7-contracts/contracts/presets/LSP7MintableInit.ts +779 -0
  155. package/types/@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.ts +778 -0
  156. package/types/@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.ts +813 -0
  157. package/types/@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupply.ts +792 -0
  158. package/types/@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.ts +824 -0
  159. package/types/@lukso/lsp8-contracts/contracts/presets/LSP8Mintable.ts +797 -0
  160. package/types/@lukso/lsp8-contracts/contracts/presets/LSP8MintableInit.ts +860 -0
  161. package/types/@lukso/lsp9-contracts/contracts/LSP9Vault.ts +672 -0
  162. package/types/@lukso/lsp9-contracts/contracts/LSP9VaultInit.ts +714 -0
  163. package/types/@lukso/universalprofile-contracts/contracts/UniversalProfile.ts +694 -0
  164. package/types/@lukso/universalprofile-contracts/contracts/UniversalProfileInit.ts +740 -0
  165. package/types/LSP0ERC725Account.ts +694 -0
  166. package/types/LSP0ERC725AccountInit.ts +740 -0
  167. package/types/LSP11BasicSocialRecovery.ts +596 -0
  168. package/types/LSP11BasicSocialRecoveryInit.ts +646 -0
  169. package/types/LSP1UniversalReceiverDelegateUP.ts +139 -0
  170. package/types/LSP1UniversalReceiverDelegateVault.ts +139 -0
  171. package/types/LSP23LinkedContractsFactory.ts +448 -0
  172. package/types/LSP4DigitalAssetMetadata.ts +274 -0
  173. package/types/LSP4DigitalAssetMetadataInitAbstract.ts +309 -0
  174. package/types/LSP6KeyManager.ts +355 -0
  175. package/types/LSP6KeyManagerInit.ts +398 -0
  176. package/types/LSP7CappedSupply.ts +712 -0
  177. package/types/LSP7CappedSupplyInitAbstract.ts +743 -0
  178. package/types/LSP7DigitalAsset.ts +698 -0
  179. package/types/LSP7DigitalAssetInitAbstract.ts +729 -0
  180. package/types/LSP7Mintable.ts +717 -0
  181. package/types/LSP7MintableInit.ts +779 -0
  182. package/types/LSP8CappedSupply.ts +792 -0
  183. package/types/LSP8CappedSupplyInitAbstract.ts +824 -0
  184. package/types/LSP8IdentifiableDigitalAsset.ts +778 -0
  185. package/types/LSP8IdentifiableDigitalAssetInitAbstract.ts +813 -0
  186. package/types/LSP8Mintable.ts +797 -0
  187. package/types/LSP8MintableInit.ts +860 -0
  188. package/types/LSP9Vault.ts +672 -0
  189. package/types/LSP9VaultInit.ts +714 -0
  190. package/types/UniversalProfile.ts +694 -0
  191. package/types/UniversalProfileInit.ts +740 -0
  192. package/types/common.ts +131 -0
  193. package/types/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.ts +596 -0
  194. package/types/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.ts +646 -0
  195. package/types/index.ts +58 -0
  196. package/LICENSE +0 -201
  197. package/artifacts/Create2Factory.json +0 -107
  198. package/artifacts/LSP16UniversalFactory.json +0 -271
  199. package/artifacts/LSP7CompatibleERC20.json +0 -935
  200. package/artifacts/LSP7CompatibleERC20InitAbstract.json +0 -948
  201. package/artifacts/LSP7CompatibleERC20Mintable.json +0 -989
  202. package/artifacts/LSP7CompatibleERC20MintableInit.json +0 -1009
  203. package/artifacts/LSP8CompatibleERC721.json +0 -1191
  204. package/artifacts/LSP8CompatibleERC721InitAbstract.json +0 -1204
  205. package/artifacts/LSP8CompatibleERC721Mintable.json +0 -1261
  206. package/artifacts/LSP8CompatibleERC721MintableInit.json +0 -1281
  207. package/artifacts/UniversalReceiverAddressStore.json +0 -209
  208. package/contracts/Factories/Create2Factory.sol +0 -88
  209. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol +0 -260
  210. package/contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20InitAbstract.sol +0 -273
  211. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol +0 -37
  212. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInit.sol +0 -44
  213. package/contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20MintableInitAbstract.sol +0 -43
  214. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721.sol +0 -512
  215. package/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CompatibleERC721InitAbstract.sol +0 -514
  216. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721Mintable.sol +0 -54
  217. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInit.sol +0 -47
  218. package/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8CompatibleERC721MintableInitAbstract.sol +0 -52
  219. package/contracts/Legacy/Registries/AddressRegistry.sol +0 -52
  220. package/contracts/Legacy/Registries/AddressRegistryRequiresERC725.sol +0 -37
  221. package/contracts/Legacy/UniversalReceiverAddressStore.sol +0 -64
  222. package/contracts/Version.sol +0 -17
  223. package/devdocs/Create2Factory.json +0 -16
  224. package/devdocs/LSP0ERC725Account.json +0 -260
  225. package/devdocs/LSP0ERC725AccountInit.json +0 -263
  226. package/devdocs/LSP11BasicSocialRecovery.json +0 -159
  227. package/devdocs/LSP11BasicSocialRecoveryInit.json +0 -159
  228. package/devdocs/LSP16UniversalFactory.json +0 -116
  229. package/devdocs/LSP1UniversalReceiverDelegateUP.json +0 -34
  230. package/devdocs/LSP1UniversalReceiverDelegateVault.json +0 -33
  231. package/devdocs/LSP23LinkedContractsFactory.json +0 -81
  232. package/devdocs/LSP4DigitalAssetMetadata.json +0 -112
  233. package/devdocs/LSP4DigitalAssetMetadataInitAbstract.json +0 -104
  234. package/devdocs/LSP6KeyManager.json +0 -305
  235. package/devdocs/LSP6KeyManagerInit.json +0 -308
  236. package/devdocs/LSP7CappedSupply.json +0 -306
  237. package/devdocs/LSP7CappedSupplyInitAbstract.json +0 -299
  238. package/devdocs/LSP7CompatibleERC20.json +0 -346
  239. package/devdocs/LSP7CompatibleERC20InitAbstract.json +0 -338
  240. package/devdocs/LSP7CompatibleERC20Mintable.json +0 -349
  241. package/devdocs/LSP7CompatibleERC20MintableInit.json +0 -352
  242. package/devdocs/LSP7DigitalAsset.json +0 -294
  243. package/devdocs/LSP7DigitalAssetInitAbstract.json +0 -285
  244. package/devdocs/LSP7Mintable.json +0 -296
  245. package/devdocs/LSP7MintableInit.json +0 -298
  246. package/devdocs/LSP8CappedSupply.json +0 -356
  247. package/devdocs/LSP8CappedSupplyInitAbstract.json +0 -349
  248. package/devdocs/LSP8CompatibleERC721.json +0 -437
  249. package/devdocs/LSP8CompatibleERC721InitAbstract.json +0 -428
  250. package/devdocs/LSP8CompatibleERC721Mintable.json +0 -446
  251. package/devdocs/LSP8CompatibleERC721MintableInit.json +0 -449
  252. package/devdocs/LSP8IdentifiableDigitalAsset.json +0 -346
  253. package/devdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +0 -335
  254. package/devdocs/LSP8Mintable.json +0 -356
  255. package/devdocs/LSP8MintableInit.json +0 -359
  256. package/devdocs/LSP9Vault.json +0 -236
  257. package/devdocs/LSP9VaultInit.json +0 -239
  258. package/devdocs/UniversalProfile.json +0 -260
  259. package/devdocs/UniversalProfileInit.json +0 -263
  260. package/devdocs/UniversalReceiverAddressStore.json +0 -9
  261. package/dist/constants.cjs.js +0 -40758
  262. package/dist/constants.es.js +0 -40737
  263. package/userdocs/Create2Factory.json +0 -5
  264. package/userdocs/LSP0ERC725Account.json +0 -91
  265. package/userdocs/LSP0ERC725AccountInit.json +0 -94
  266. package/userdocs/LSP11BasicSocialRecovery.json +0 -29
  267. package/userdocs/LSP11BasicSocialRecoveryInit.json +0 -29
  268. package/userdocs/LSP16UniversalFactory.json +0 -30
  269. package/userdocs/LSP1UniversalReceiverDelegateUP.json +0 -19
  270. package/userdocs/LSP1UniversalReceiverDelegateVault.json +0 -19
  271. package/userdocs/LSP23LinkedContractsFactory.json +0 -29
  272. package/userdocs/LSP4DigitalAssetMetadata.json +0 -26
  273. package/userdocs/LSP4DigitalAssetMetadataInitAbstract.json +0 -23
  274. package/userdocs/LSP6KeyManager.json +0 -154
  275. package/userdocs/LSP6KeyManagerInit.json +0 -157
  276. package/userdocs/LSP7CappedSupply.json +0 -60
  277. package/userdocs/LSP7CappedSupplyInitAbstract.json +0 -57
  278. package/userdocs/LSP7CompatibleERC20.json +0 -47
  279. package/userdocs/LSP7CompatibleERC20InitAbstract.json +0 -44
  280. package/userdocs/LSP7CompatibleERC20Mintable.json +0 -47
  281. package/userdocs/LSP7CompatibleERC20MintableInit.json +0 -47
  282. package/userdocs/LSP7DigitalAsset.json +0 -47
  283. package/userdocs/LSP7DigitalAssetInitAbstract.json +0 -44
  284. package/userdocs/LSP7Mintable.json +0 -47
  285. package/userdocs/LSP7MintableInit.json +0 -47
  286. package/userdocs/LSP8CappedSupply.json +0 -66
  287. package/userdocs/LSP8CappedSupplyInitAbstract.json +0 -63
  288. package/userdocs/LSP8CompatibleERC721.json +0 -80
  289. package/userdocs/LSP8CompatibleERC721InitAbstract.json +0 -77
  290. package/userdocs/LSP8CompatibleERC721Mintable.json +0 -83
  291. package/userdocs/LSP8CompatibleERC721MintableInit.json +0 -83
  292. package/userdocs/LSP8IdentifiableDigitalAsset.json +0 -53
  293. package/userdocs/LSP8IdentifiableDigitalAssetInitAbstract.json +0 -50
  294. package/userdocs/LSP8Mintable.json +0 -56
  295. package/userdocs/LSP8MintableInit.json +0 -56
  296. package/userdocs/LSP9Vault.json +0 -93
  297. package/userdocs/LSP9VaultInit.json +0 -93
  298. package/userdocs/UniversalProfile.json +0 -91
  299. package/userdocs/UniversalProfileInit.json +0 -94
  300. package/userdocs/UniversalReceiverAddressStore.json +0 -5
@@ -1,697 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.5;
3
3
 
4
- // interfaces
5
- import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.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 {ILSP6KeyManager as ILSP6} from "./ILSP6KeyManager.sol";
13
- import {
14
- ILSP20CallVerifier as ILSP20
15
- } from "../LSP20CallVerification/ILSP20CallVerifier.sol";
16
- import {
17
- ILSP25ExecuteRelayCall as ILSP25
18
- } from "../LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol";
19
-
20
- // modules
21
- import {ILSP14Ownable2Step} from "../LSP14Ownable2Step/ILSP14Ownable2Step.sol";
22
- import {ERC725Y} from "@erc725/smart-contracts/contracts/ERC725Y.sol";
23
- import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
24
- import {LSP6SetDataModule} from "./LSP6Modules/LSP6SetDataModule.sol";
25
- import {LSP6ExecuteModule} from "./LSP6Modules/LSP6ExecuteModule.sol";
26
- import {
27
- LSP6ExecuteRelayCallModule
28
- } from "./LSP6Modules/LSP6ExecuteRelayCallModule.sol";
29
- import {LSP6OwnershipModule} from "./LSP6Modules/LSP6OwnershipModule.sol";
30
- import {
31
- LSP25MultiChannelNonce
32
- } from "../LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol";
33
-
34
- // libraries
35
- import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
36
- import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
37
- import {Address} from "@openzeppelin/contracts/utils/Address.sol";
38
- import {LSP6Utils} from "./LSP6Utils.sol";
39
-
40
- // errors
41
- import {
42
- ERC725X_ExecuteParametersLengthMismatch,
43
- ERC725X_ExecuteParametersEmptyArray
44
- } from "@erc725/smart-contracts/contracts/errors.sol";
45
- import {
46
- BatchExecuteParamsLengthMismatch,
47
- BatchExecuteRelayCallParamsLengthMismatch,
48
- LSP6BatchExcessiveValueSent,
49
- LSP6BatchInsufficientValueSent,
50
- InvalidPayload,
51
- InvalidRelayNonce,
52
- NoPermissionsSet,
53
- InvalidERC725Function
54
- } from "./LSP6Errors.sol";
55
-
56
- import {
57
- _INTERFACEID_ERC1271,
58
- _ERC1271_SUCCESSVALUE,
59
- _ERC1271_FAILVALUE
60
- } from "../LSP0ERC725Account/LSP0Constants.sol";
61
- import {
62
- _INTERFACEID_LSP6,
63
- _PERMISSION_SIGN,
64
- _PERMISSION_REENTRANCY
65
- } from "./LSP6Constants.sol";
66
- import {
67
- _INTERFACEID_LSP20_CALL_VERIFIER,
68
- _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITHOUT_POST_VERIFICATION,
69
- _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITH_POST_VERIFICATION,
70
- _LSP20_VERIFY_CALL_RESULT_SUCCESS_VALUE
71
- } from "../LSP20CallVerification/LSP20Constants.sol";
72
- import {_INTERFACEID_LSP25} from "../LSP25ExecuteRelayCall/LSP25Constants.sol";
73
-
74
- /**
75
- * @title Core implementation of the LSP6 Key Manager standard.
76
- * @author Fabian Vogelsteller <frozeman>, Jean Cavallera (CJ42), Yamen Merhi (YamenMerhi)
77
- * @dev This contract acts as a controller for an ERC725 Account.
78
- * Permissions for controllers are stored in the ERC725Y storage of the ERC725 Account and can be updated using `setData(...)`.
79
- *
80
- * @custom:danger Because of its potential malicious impact on the linked contract, the current implementation of the Key Manager
81
- * disallows the operation type **[DELEGATECALL](../universal-profile/lsp6-key-manager.md#permissions-value)** operation via the
82
- * `execute(...)` function of the linked contract.
83
- */
84
- abstract contract LSP6KeyManagerCore is
85
- ERC165,
86
- IERC1271,
87
- ILSP6,
88
- ILSP20,
89
- ILSP25,
90
- LSP6SetDataModule,
91
- LSP6ExecuteModule,
92
- LSP6ExecuteRelayCallModule,
93
- LSP6OwnershipModule,
94
- LSP25MultiChannelNonce
95
- {
96
- using LSP6Utils for *;
97
- using ECDSA for *;
98
- using BytesLib for bytes;
99
-
100
- address internal _target;
101
-
102
- mapping(address => bool) internal _reentrancyStatus;
103
-
104
- /**
105
- * @inheritdoc ILSP6
106
- */
107
- function target() public view override returns (address) {
108
- return _target;
109
- }
110
-
111
- /**
112
- * @inheritdoc ERC165
113
- */
114
- function supportsInterface(
115
- bytes4 interfaceId
116
- ) public view virtual override returns (bool) {
117
- return
118
- interfaceId == _INTERFACEID_LSP6 ||
119
- interfaceId == _INTERFACEID_ERC1271 ||
120
- interfaceId == _INTERFACEID_LSP20_CALL_VERIFIER ||
121
- interfaceId == _INTERFACEID_LSP25 ||
122
- super.supportsInterface(interfaceId);
123
- }
124
-
125
- /**
126
- * @inheritdoc ILSP25
127
- *
128
- * @custom:hint A signer can choose its channel number arbitrarily. The recommended practice is to:
129
- * - use `channelId == 0` for transactions for which the ordering of execution matters.abi
130
- *
131
- * _Example: you have two transactions A and B, and transaction A must be executed first and complete successfully before
132
- * transaction B should be executed)._
133
- *
134
- * - use any other `channelId` number for transactions that you want to be order independant (out-of-order execution, execution _"in parallel"_).
135
- *
136
- * _Example: you have two transactions A and B. You want transaction B to be executed a) without having to wait for transaction A to complete,
137
- * or b) regardless if transaction A completed successfully or not.
138
- */
139
- function getNonce(
140
- address from,
141
- uint128 channelId
142
- ) public view virtual override returns (uint256) {
143
- return LSP25MultiChannelNonce._getNonce(from, channelId);
144
- }
145
-
146
- /**
147
- * @inheritdoc IERC1271
148
- *
149
- * @dev Checks if a signature was signed by a controller that has the permission `SIGN`.
150
- * If the signer is a controller with the permission `SIGN`, it will return the ERC1271 success value.
151
- *
152
- * @return returnedStatus `0x1626ba7e` on success, or `0xffffffff` on failure.
153
- *
154
- * @custom:warning This function does not enforce by default the inclusion of the address of this contract in the signature digest.
155
- * It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign.
156
- * To ensure that a signature is valid for a specific LSP6KeyManager and prevent signatures from the same EOA to be replayed
157
- * across different LSP6KeyManager.
158
- */
159
- function isValidSignature(
160
- bytes32 dataHash,
161
- bytes memory signature
162
- ) public view virtual override returns (bytes4 returnedStatus) {
163
- // if isValidSignature fail, the error is catched in returnedError
164
- (address recoveredAddress, ECDSA.RecoverError returnedError) = ECDSA
165
- .tryRecover(dataHash, signature);
166
-
167
- // if recovering throws an error, return the fail value
168
- if (returnedError != ECDSA.RecoverError.NoError)
169
- return _ERC1271_FAILVALUE;
170
-
171
- // if the address recovered has SIGN permission return the ERC1271 success value, otherwise the fail value
172
- return (
173
- ERC725Y(_target).getPermissionsFor(recoveredAddress).hasPermission(
174
- _PERMISSION_SIGN
175
- )
176
- ? _ERC1271_SUCCESSVALUE
177
- : _ERC1271_FAILVALUE
178
- );
179
- }
180
-
181
- /**
182
- * @inheritdoc ILSP6
183
- *
184
- * @custom:events {PermissionsVerified} event when the permissions related to `payload` have been verified successfully.
185
- */
186
- function execute(
187
- bytes calldata payload
188
- ) public payable virtual override returns (bytes memory) {
189
- return _execute(msg.value, payload);
190
- }
191
-
192
- /**
193
- * @inheritdoc ILSP6
194
- *
195
- * @custom:events {PermissionsVerified} event for each permissions related to each `payload` that have been verified successfully.
196
- */
197
- function executeBatch(
198
- uint256[] calldata values,
199
- bytes[] calldata payloads
200
- ) public payable virtual override returns (bytes[] memory) {
201
- if (values.length != payloads.length) {
202
- revert BatchExecuteParamsLengthMismatch();
203
- }
204
-
205
- bytes[] memory results = new bytes[](payloads.length);
206
- uint256 totalValues;
207
-
208
- for (uint256 ii; ii < payloads.length; ) {
209
- if ((totalValues += values[ii]) > msg.value) {
210
- revert LSP6BatchInsufficientValueSent(totalValues, msg.value);
211
- }
212
-
213
- results[ii] = _execute(values[ii], payloads[ii]);
214
-
215
- unchecked {
216
- ++ii;
217
- }
218
- }
219
-
220
- if (totalValues < msg.value) {
221
- revert LSP6BatchExcessiveValueSent(totalValues, msg.value);
222
- }
223
-
224
- return results;
225
- }
226
-
227
- /**
228
- * @inheritdoc ILSP25
229
- *
230
- * @dev Allows any address (executor) to execute a payload (= abi-encoded function call), given they have a valid signature from a signer address and a valid `nonce` for this signer.
231
- * The signature MUST be generated according to the signature format defined by the LSP25 standard.
232
- *
233
- * The signer that generated the `signature` MUST be a controller with some permissions on the linked {target}.
234
- * The `payload` will be executed on the {target} contract once the LSP25 signature and the permissions of the signer have been verified.
235
- *
236
- * @custom:events {PermissionsVerified} event when the permissions related to `payload` have been verified successfully.
237
- *
238
- * @custom:hint If you are looking to learn how to sign and execute relay transactions via the Key Manager,
239
- * see our Javascript step by step guide [_"Execute Relay Transactions"_](../../../learn/expert-guides/key-manager/execute-relay-transactions.md).
240
- * See the LSP6 Standard page for more details on how to
241
- * [generate a valid signature for Execute Relay Call](../../../standards/universal-profile/lsp6-key-manager.md#how-to-sign-relay-transactions).
242
- */
243
- function executeRelayCall(
244
- bytes memory signature,
245
- uint256 nonce,
246
- uint256 validityTimestamps,
247
- bytes calldata payload
248
- ) public payable virtual override returns (bytes memory) {
249
- return
250
- _executeRelayCall(
251
- signature,
252
- nonce,
253
- validityTimestamps,
254
- msg.value,
255
- payload
256
- );
257
- }
258
-
259
- /**
260
- * @inheritdoc ILSP25
261
- *
262
- * @dev Same as {executeRelayCall} but execute a batch of signed calldata payloads (abi-encoded function calls) in a single transaction.
263
- *
264
- * The `signatures` can be from multiple controllers, not necessarely the same controller, as long as each of these controllers
265
- * that signed have the right permissions related to the calldata `payload` they signed.
266
- *
267
- * @custom:requirements
268
- * - the length of `signatures`, `nonces`, `validityTimestamps`, `values` and `payloads` MUST be the same.
269
- * - the value sent to this function (`msg.value`) MUST be equal to the sum of all `values` in the batch.
270
- * There should not be any excess value sent to this function.
271
- */
272
- function executeRelayCallBatch(
273
- bytes[] memory signatures,
274
- uint256[] calldata nonces,
275
- uint256[] calldata validityTimestamps,
276
- uint256[] calldata values,
277
- bytes[] calldata payloads
278
- ) public payable virtual override returns (bytes[] memory) {
279
- if (
280
- signatures.length != nonces.length ||
281
- nonces.length != validityTimestamps.length ||
282
- validityTimestamps.length != values.length ||
283
- values.length != payloads.length
284
- ) {
285
- revert BatchExecuteRelayCallParamsLengthMismatch();
286
- }
287
-
288
- bytes[] memory results = new bytes[](payloads.length);
289
- uint256 totalValues;
290
-
291
- for (uint256 ii; ii < payloads.length; ) {
292
- if ((totalValues += values[ii]) > msg.value) {
293
- revert LSP6BatchInsufficientValueSent(totalValues, msg.value);
294
- }
295
-
296
- results[ii] = _executeRelayCall(
297
- signatures[ii],
298
- nonces[ii],
299
- validityTimestamps[ii],
300
- values[ii],
301
- payloads[ii]
302
- );
303
-
304
- unchecked {
305
- ++ii;
306
- }
307
- }
308
-
309
- if (totalValues < msg.value) {
310
- revert LSP6BatchExcessiveValueSent(totalValues, msg.value);
311
- }
312
-
313
- return results;
314
- }
315
-
316
- /**
317
- * @inheritdoc ILSP20
318
- *
319
- * @custom:hint This function can call by any other address than the {`target`}.
320
- * This allows to verify permissions in a _"read-only"_ manner.
321
- *
322
- * Anyone can call this function to verify if the `caller` has the right permissions to perform the abi-encoded function call `data`
323
- * on the {`target`} contract (while sending `msgValue` alongside the call).
324
- *
325
- * If the permissions have been verified successfully and `caller` is authorized, one of the following two LSP20 success value will be returned:
326
- * - `0x1a238000`: LSP20 success value **without** post verification (last byte is `0x00`).
327
- * - `0x1a238001`: LSP20 success value **with** post-verification (last byte is `0x01`).
328
- */
329
- function lsp20VerifyCall(
330
- address /* requestor */,
331
- address targetContract,
332
- address caller,
333
- uint256 msgValue,
334
- bytes calldata callData
335
- ) external virtual override returns (bytes4) {
336
- bool isSetData = bytes4(callData) == IERC725Y.setData.selector ||
337
- bytes4(callData) == IERC725Y.setDataBatch.selector;
338
-
339
- // If target is invoking the verification, emit the event and change the reentrancy guard
340
- if (msg.sender == targetContract) {
341
- bool reentrancyStatus = _nonReentrantBefore(
342
- targetContract,
343
- isSetData,
344
- caller
345
- );
346
-
347
- _verifyPermissions(targetContract, caller, false, callData);
348
-
349
- emit PermissionsVerified(caller, msgValue, bytes4(callData));
350
-
351
- // if it's a setData call, do not invoke the `lsp20VerifyCallResult(..)` function
352
- return
353
- isSetData || reentrancyStatus
354
- ? _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITHOUT_POST_VERIFICATION
355
- : _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITH_POST_VERIFICATION;
356
- }
357
- /// @dev If a different address is invoking the verification,
358
- /// do not change the state or emit the event to allow read-only verification
359
- else {
360
- bool reentrancyStatus = _reentrancyStatus[targetContract];
361
-
362
- if (reentrancyStatus) {
363
- _requirePermissions(
364
- caller,
365
- ERC725Y(targetContract).getPermissionsFor(caller),
366
- _PERMISSION_REENTRANCY
367
- );
368
- }
369
-
370
- _verifyPermissions(targetContract, caller, false, callData);
371
-
372
- // if it's a setData call, do not invoke the `lsp20VerifyCallResult(..)` function
373
- return
374
- isSetData || reentrancyStatus
375
- ? _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITHOUT_POST_VERIFICATION
376
- : _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITH_POST_VERIFICATION;
377
- }
378
- }
379
-
380
- /**
381
- * @inheritdoc ILSP20
382
- */
383
- function lsp20VerifyCallResult(
384
- bytes32 /* callHash */,
385
- bytes memory /* callResult */
386
- ) external virtual override returns (bytes4) {
387
- // If it's the target calling, set back the reentrancy guard
388
- // to false, if not return the success value
389
- if (msg.sender == _target) {
390
- _nonReentrantAfter(msg.sender);
391
- }
392
- return _LSP20_VERIFY_CALL_RESULT_SUCCESS_VALUE;
393
- }
394
-
395
- function _execute(
396
- uint256 msgValue,
397
- bytes calldata payload
398
- ) internal virtual returns (bytes memory) {
399
- if (payload.length < 4) {
400
- revert InvalidPayload(payload);
401
- }
402
-
403
- bool isSetData = bytes4(payload) == IERC725Y.setData.selector ||
404
- bytes4(payload) == IERC725Y.setDataBatch.selector;
405
-
406
- address targetContract = _target;
407
-
408
- bool reentrancyStatus = _nonReentrantBefore(
409
- targetContract,
410
- isSetData,
411
- msg.sender
412
- );
413
-
414
- _verifyPermissions(targetContract, msg.sender, false, payload);
415
-
416
- emit PermissionsVerified(msg.sender, msgValue, bytes4(payload));
417
-
418
- bytes memory result = _executePayload(
419
- targetContract,
420
- msgValue,
421
- payload
422
- );
423
-
424
- if (!reentrancyStatus && !isSetData) {
425
- _nonReentrantAfter(targetContract);
426
- }
427
-
428
- return result;
429
- }
430
-
431
- /**
432
- * @dev Validate that the `nonce` given for the `signature` signed and the `payload` to execute is valid
433
- * and conform to the signature format according to the LSP25 standard.
434
- *
435
- * @param signature A valid signature for a signer, generated according to the signature format specified in the LSP25 standard.
436
- * @param nonce The nonce that the signer used to generate the `signature`.
437
- * @param validityTimestamps Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed,
438
- * and the right-most `uint128` represents the timestamp after which the transaction expire.
439
- * @param payload The abi-encoded function call to execute.
440
- *
441
- * @custom:warning Be aware that this function can also throw an error if the `callData` was signed incorrectly (not conforming to the signature format defined in the LSP25 standard).
442
- * This is because the contract cannot distinguish if the data is signed correctly or not. Instead, it will recover an incorrect signer address from the signature
443
- * and throw an {InvalidRelayNonce} error with the incorrect signer address as the first parameter.
444
- */
445
- function _executeRelayCall(
446
- bytes memory signature,
447
- uint256 nonce,
448
- uint256 validityTimestamps,
449
- uint256 msgValue,
450
- bytes calldata payload
451
- ) internal virtual returns (bytes memory) {
452
- if (payload.length < 4) {
453
- revert InvalidPayload(payload);
454
- }
455
-
456
- address targetContract = _target;
457
-
458
- address signer = LSP25MultiChannelNonce
459
- ._recoverSignerFromLSP25Signature(
460
- signature,
461
- nonce,
462
- validityTimestamps,
463
- msgValue,
464
- payload
465
- );
466
-
467
- if (!_isValidNonce(signer, nonce)) {
468
- revert InvalidRelayNonce(signer, nonce, signature);
469
- }
470
-
471
- // increase nonce after successful verification
472
- _nonceStore[signer][nonce >> 128]++;
473
-
474
- LSP25MultiChannelNonce._verifyValidityTimestamps(validityTimestamps);
475
-
476
- bool isSetData = bytes4(payload) == IERC725Y.setData.selector ||
477
- bytes4(payload) == IERC725Y.setDataBatch.selector;
478
-
479
- bool reentrancyStatus = _nonReentrantBefore(
480
- targetContract,
481
- isSetData,
482
- signer
483
- );
484
-
485
- _verifyPermissions(targetContract, signer, true, payload);
486
-
487
- emit PermissionsVerified(signer, msgValue, bytes4(payload));
488
-
489
- bytes memory result = _executePayload(
490
- targetContract,
491
- msgValue,
492
- payload
493
- );
494
-
495
- if (!reentrancyStatus && !isSetData) {
496
- _nonReentrantAfter(targetContract);
497
- }
498
-
499
- return result;
500
- }
501
-
502
- /**
503
- * @notice Execute the `payload` passed to `execute(...)` or `executeRelayCall(...)`
504
- * @param payload The abi-encoded function call to execute on the {target} contract.
505
- * @return bytes The data returned by the call made to the linked {target} contract.
506
- */
507
- function _executePayload(
508
- address targetContract,
509
- uint256 msgValue,
510
- bytes calldata payload
511
- ) internal virtual returns (bytes memory) {
512
- (bool success, bytes memory returnData) = targetContract.call{
513
- value: msgValue,
514
- gas: gasleft()
515
- }(payload);
516
-
517
- bytes memory result = Address.verifyCallResult(
518
- success,
519
- returnData,
520
- "LSP6: failed executing payload"
521
- );
522
-
523
- return result;
524
- }
525
-
526
- /**
527
- * @dev Verify if the `from` address is allowed to execute the `payload` on the {target} contract linked to this Key Manager.
528
- * @param targetContract The contract that is owned by the Key Manager
529
- * @param from Either the caller of {execute} or the signer of {executeRelayCall}.
530
- * @param payload The abi-encoded function call to execute on the {target} contract.
531
- */
532
- function _verifyPermissions(
533
- address targetContract,
534
- address from,
535
- bool isRelayedCall,
536
- bytes calldata payload
537
- ) internal view virtual {
538
- bytes32 permissions = ERC725Y(targetContract).getPermissionsFor(from);
539
- if (permissions == bytes32(0)) revert NoPermissionsSet(from);
540
-
541
- if (isRelayedCall) {
542
- LSP6ExecuteRelayCallModule._verifyExecuteRelayCallPermission(
543
- from,
544
- permissions
545
- );
546
- }
547
-
548
- bytes4 erc725Function = bytes4(payload);
549
-
550
- // ERC725Y.setData(bytes32,bytes)
551
- if (erc725Function == IERC725Y.setData.selector) {
552
- (bytes32 inputKey, bytes memory inputValue) = abi.decode(
553
- payload[4:],
554
- (bytes32, bytes)
555
- );
556
-
557
- LSP6SetDataModule._verifyCanSetData(
558
- targetContract,
559
- from,
560
- permissions,
561
- inputKey,
562
- inputValue
563
- );
564
-
565
- // ERC725Y.setDataBatch(bytes32[],bytes[])
566
- } else if (erc725Function == IERC725Y.setDataBatch.selector) {
567
- (bytes32[] memory inputKeys, bytes[] memory inputValues) = abi
568
- .decode(payload[4:], (bytes32[], bytes[]));
569
-
570
- LSP6SetDataModule._verifyCanSetData(
571
- targetContract,
572
- from,
573
- permissions,
574
- inputKeys,
575
- inputValues
576
- );
577
-
578
- // ERC725X.execute(uint256,address,uint256,bytes)
579
- } else if (erc725Function == IERC725X.execute.selector) {
580
- (
581
- uint256 operationType,
582
- address to,
583
- uint256 value,
584
- bytes memory callData
585
- ) = abi.decode(payload[4:], (uint256, address, uint256, bytes));
586
-
587
- LSP6ExecuteModule._verifyCanExecute(
588
- targetContract,
589
- from,
590
- permissions,
591
- operationType,
592
- to,
593
- value,
594
- callData
595
- );
596
- } else if (erc725Function == IERC725X.executeBatch.selector) {
597
- (
598
- uint256[] memory operationTypes,
599
- address[] memory targets,
600
- uint256[] memory values,
601
- bytes[] memory callDatas
602
- ) = abi.decode(
603
- payload[4:],
604
- (uint256[], address[], uint256[], bytes[])
605
- );
606
-
607
- if (
608
- operationTypes.length != targets.length ||
609
- targets.length != values.length ||
610
- values.length != callDatas.length
611
- ) {
612
- revert ERC725X_ExecuteParametersLengthMismatch();
613
- }
614
-
615
- if (operationTypes.length == 0) {
616
- revert ERC725X_ExecuteParametersEmptyArray();
617
- }
618
-
619
- for (uint256 ii; ii < operationTypes.length; ii++) {
620
- LSP6ExecuteModule._verifyCanExecute(
621
- targetContract,
622
- from,
623
- permissions,
624
- operationTypes[ii],
625
- targets[ii],
626
- values[ii],
627
- callDatas[ii]
628
- );
629
- }
630
- } else if (
631
- erc725Function == ILSP14Ownable2Step.transferOwnership.selector ||
632
- erc725Function == ILSP14Ownable2Step.acceptOwnership.selector ||
633
- erc725Function == ILSP14Ownable2Step.renounceOwnership.selector
634
- ) {
635
- LSP6OwnershipModule._verifyOwnershipPermissions(from, permissions);
636
- } else {
637
- revert InvalidERC725Function(erc725Function);
638
- }
639
- }
640
-
641
- /**
642
- * @dev Check if we are in the context of a reentrant call, by checking if the reentrancy status is `true`.
643
- * - If the status is `true`, the caller (or signer for relay call) MUST have the `REENTRANCY` permission. Otherwise, the call is reverted.
644
- * - If the status is `false`, it is set to `true` only if we are not dealing with a call to the functions `setData` or `setDataBatch`.
645
- * Used at the beginning of the {`lsp20VerifyCall`}, {`_execute`} and {`_executeRelayCall`} functions, before the methods execution starts.
646
- *
647
- */
648
- function _nonReentrantBefore(
649
- address targetContract,
650
- bool isSetData,
651
- address from
652
- ) internal virtual returns (bool reentrancyStatus) {
653
- reentrancyStatus = _reentrancyStatus[targetContract];
654
-
655
- if (reentrancyStatus) {
656
- // CHECK the caller has REENTRANCY permission
657
- _requirePermissions(
658
- from,
659
- ERC725Y(targetContract).getPermissionsFor(from),
660
- _PERMISSION_REENTRANCY
661
- );
662
- } else {
663
- if (!isSetData) {
664
- _reentrancyStatus[targetContract] = true;
665
- }
666
- }
667
- }
668
-
669
- /**
670
- * @dev Resets the reentrancy status to `false`
671
- * Used at the end of the {`lsp20VerifyCall`}, {`_execute`} and {`_executeRelayCall`} functions after the functions' execution is terminated.
672
- */
673
- function _nonReentrantAfter(address targetContract) internal virtual {
674
- // By storing the original value once again, a refund is triggered (see
675
- // https://eips.ethereum.org/EIPS/eip-2200)
676
- _reentrancyStatus[targetContract] = false;
677
- }
678
-
679
- /**
680
- * @dev Check if the `controller` has the `permissionRequired` among its permission listed in `controllerPermissions`
681
- * If not, this function will revert with the error `NotAuthorised` and the name of the permission missing by the controller.
682
- * @param controller the caller address
683
- * @param addressPermissions the caller's permissions BitArray
684
- * @param permissionRequired the required permission
685
- */
686
- function _requirePermissions(
687
- address controller,
688
- bytes32 addressPermissions,
689
- bytes32 permissionRequired
690
- ) internal pure override(LSP6ExecuteModule, LSP6SetDataModule) {
691
- LSP6ExecuteModule._requirePermissions(
692
- controller,
693
- addressPermissions,
694
- permissionRequired
695
- );
696
- }
697
- }
4
+ import "@lukso/lsp6-contracts/contracts/LSP6KeyManagerCore.sol";