@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,215 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // interfaces
5
- import {ILSP14Ownable2Step} from "./ILSP14Ownable2Step.sol";
6
-
7
- // modules
8
- import {
9
- OwnableUnset
10
- } from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
11
-
12
- // libraries
13
- import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
14
-
15
- // errors
16
- import {
17
- LSP14CallerNotPendingOwner,
18
- LSP14MustAcceptOwnershipInSeparateTransaction,
19
- LSP14CannotTransferOwnershipToSelf,
20
- LSP14NotInRenounceOwnershipInterval
21
- } from "./LSP14Errors.sol";
22
-
23
- // constants
24
- import {
25
- _TYPEID_LSP14_OwnershipTransferStarted,
26
- _TYPEID_LSP14_OwnershipTransferred_SenderNotification,
27
- _TYPEID_LSP14_OwnershipTransferred_RecipientNotification
28
- } from "./LSP14Constants.sol";
29
-
30
- /**
31
- * @title LSP14Ownable2Step
32
- * @author Fabian Vogelsteller <fabian@lukso.network>, Jean Cavallera (CJ42), Yamen Merhi (YamenMerhi), Daniel Afteni (B00ste)
33
- * @dev This contract is a modified version of the [`OwnableUnset.sol`] implementation, where transferring and renouncing ownership works as a 2-step process. This can be used as a confirmation mechanism to prevent potential mistakes when transferring ownership of the contract, where the control of the contract could be lost forever. (_e.g: providing the wrong address as a parameter to the function, transferring ownership to an EOA for which the user lost its private key, etc..._)
34
- */
35
- abstract contract LSP14Ownable2Step is ILSP14Ownable2Step, OwnableUnset {
36
- using LSP1Utils for address;
37
-
38
- /**
39
- * @dev The number of block that MUST pass before one is able to confirm renouncing ownership.
40
- * @return Number of blocks.
41
- */
42
- uint256 public constant RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY = 200;
43
-
44
- /**
45
- * @dev The number of blocks during which one can renounce ownership.
46
- * @return Number of blocks.
47
- */
48
- uint256 public constant RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD = 200;
49
-
50
- /**
51
- * @dev The block number saved when initiating the process of renouncing ownerhsip.
52
- */
53
- uint256 internal _renounceOwnershipStartedAt;
54
-
55
- /**
56
- * @dev see {pendingOwner()}
57
- */
58
- address internal _pendingOwner;
59
-
60
- /**
61
- * @dev The boolean that indicates whether the contract is in an active ownership transfer phase
62
- */
63
- bool internal _inTransferOwnership;
64
-
65
- /**
66
- * @dev reverts when {_inTransferOwnership} variable is true
67
- */
68
- modifier notInTransferOwnership() virtual {
69
- if (_inTransferOwnership) {
70
- revert LSP14MustAcceptOwnershipInSeparateTransaction();
71
- }
72
- _;
73
- }
74
-
75
- /**
76
- * @inheritdoc ILSP14Ownable2Step
77
- *
78
- * @custom:info If no ownership transfer is in progress, the pendingOwner will be `address(0).`.
79
- */
80
- function pendingOwner() public view virtual override returns (address) {
81
- return _pendingOwner;
82
- }
83
-
84
- /**
85
- * @inheritdoc ILSP14Ownable2Step
86
- *
87
- * @custom:requirements `newOwner` cannot accept ownership of the contract in the same transaction. (For instance, via a callback from its {universalReceiver(...)} function).
88
- */
89
- function transferOwnership(
90
- address newOwner
91
- ) public virtual override(OwnableUnset, ILSP14Ownable2Step) onlyOwner {
92
- // set the transfer ownership lock
93
- _inTransferOwnership = true;
94
-
95
- _transferOwnership(newOwner);
96
-
97
- address currentOwner = owner();
98
- emit OwnershipTransferStarted(currentOwner, newOwner);
99
-
100
- newOwner.notifyUniversalReceiver(
101
- _TYPEID_LSP14_OwnershipTransferStarted,
102
- abi.encode(currentOwner, newOwner)
103
- );
104
-
105
- // reset the transfer ownership lock
106
- _inTransferOwnership = false;
107
- }
108
-
109
- /**
110
- * @inheritdoc ILSP14Ownable2Step
111
- *
112
- * @custom:requirements This function can only be called by the {pendingOwner()}.
113
- */
114
- function acceptOwnership() public virtual override notInTransferOwnership {
115
- address previousOwner = owner();
116
-
117
- _acceptOwnership();
118
-
119
- previousOwner.notifyUniversalReceiver(
120
- _TYPEID_LSP14_OwnershipTransferred_SenderNotification,
121
- abi.encode(previousOwner, msg.sender)
122
- );
123
-
124
- msg.sender.notifyUniversalReceiver(
125
- _TYPEID_LSP14_OwnershipTransferred_RecipientNotification,
126
- abi.encode(previousOwner, msg.sender)
127
- );
128
- }
129
-
130
- /**
131
- * @inheritdoc ILSP14Ownable2Step
132
- *
133
- * @custom:danger Leaves the contract without an owner. Once ownership of the contract has been renounced, any function that is restricted to be called only by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.
134
- */
135
- function renounceOwnership()
136
- public
137
- virtual
138
- override(OwnableUnset, ILSP14Ownable2Step)
139
- onlyOwner
140
- {
141
- address previousOwner = owner();
142
- _renounceOwnership();
143
-
144
- if (owner() == address(0)) {
145
- previousOwner.notifyUniversalReceiver(
146
- _TYPEID_LSP14_OwnershipTransferred_SenderNotification,
147
- abi.encode(previousOwner, address(0))
148
- );
149
- }
150
- }
151
-
152
- // --- Internal methods
153
-
154
- /**
155
- * @dev Set the pending owner of the contract and cancel any renounce ownership process that was previously started.
156
- *
157
- * @param newOwner The address of the new pending owner.
158
- *
159
- * @custom:requirements `newOwner` cannot be the address of the contract itself.
160
- */
161
- function _transferOwnership(address newOwner) internal virtual {
162
- if (newOwner == address(this))
163
- revert LSP14CannotTransferOwnershipToSelf();
164
-
165
- _pendingOwner = newOwner;
166
- delete _renounceOwnershipStartedAt;
167
- }
168
-
169
- /**
170
- * @dev Set the pending owner of the contract as the new owner.
171
- */
172
- function _acceptOwnership() internal virtual {
173
- if (msg.sender != pendingOwner())
174
- revert LSP14CallerNotPendingOwner(msg.sender);
175
-
176
- _setOwner(msg.sender);
177
- delete _pendingOwner;
178
- delete _renounceOwnershipStartedAt;
179
- }
180
-
181
- /**
182
- * @dev Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed.
183
- */
184
- function _renounceOwnership() internal virtual {
185
- uint256 currentBlock = block.number;
186
- uint256 confirmationPeriodStart = _renounceOwnershipStartedAt +
187
- RENOUNCE_OWNERSHIP_CONFIRMATION_DELAY;
188
- uint256 confirmationPeriodEnd = confirmationPeriodStart +
189
- RENOUNCE_OWNERSHIP_CONFIRMATION_PERIOD;
190
-
191
- // On the creation of a new network, `currentBlock` will be smaller than `confirmationPeriodEnd`,
192
- // `_renounceOwnershipStartedAt == 0` will indicate that a renounceOwnership call is happening for the first time
193
- if (
194
- currentBlock > confirmationPeriodEnd ||
195
- _renounceOwnershipStartedAt == 0
196
- ) {
197
- _renounceOwnershipStartedAt = currentBlock;
198
- delete _pendingOwner;
199
- emit RenounceOwnershipStarted();
200
- return;
201
- }
202
-
203
- if (currentBlock < confirmationPeriodStart) {
204
- revert LSP14NotInRenounceOwnershipInterval(
205
- confirmationPeriodStart,
206
- confirmationPeriodEnd
207
- );
208
- }
209
-
210
- _setOwner(address(0));
211
- delete _renounceOwnershipStartedAt;
212
- delete _pendingOwner;
213
- emit OwnershipRenounced();
214
- }
215
- }
4
+ import "@lukso/lsp14-contracts/contracts/LSP14Ownable2Step.sol";
@@ -1,420 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // libraries
5
- import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
6
- import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
7
-
8
- // errors
9
-
10
- /**
11
- * @notice Couldn't initialize the contract.
12
- * @dev Reverts when there is no revert reason bubbled up by the created contract when initializing
13
- */
14
- error ContractInitializationFailed();
15
-
16
- /**
17
- * @dev Reverts when `msg.value` sent to {deployCreate2AndInitialize(..)} function is not equal to the sum of the `initializeCalldataMsgValue` and `constructorMsgValue`
18
- */
19
- error InvalidValueSum();
20
-
21
- /**
22
- * @title LSP16 Universal Factory
23
- * @dev Factory contract to deploy different types of contracts using the CREATE2 opcode
24
- * standardized as LSP16 - UniversalFactory:
25
- * https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md
26
- *
27
- * The UniversalFactory will be deployed using Nick's Factory (0x4e59b44847b379578588920ca78fbf26c0b4956c)
28
- *
29
- * The deployed address can be found in the LSP16 specification.
30
- * Please refer to the LSP16 Specification to obtain the exact bytecode and salt that
31
- * should be used to produce the address of the UniversalFactory on different chains.
32
- *
33
- * This factory contract is designed to deploy contracts at the same address on multiple chains.
34
- *
35
- * The UniversalFactory can deploy 2 types of contracts:
36
- * - non-initializable (normal deployment)
37
- * - initializable (external call after deployment, e.g: proxy contracts)
38
- *
39
- * The `providedSalt` parameter given by the deployer is not used directly as the salt by the CREATE2 opcode.
40
- * Instead, it is used along with these parameters:
41
- * - `initializable` boolean
42
- * - `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`).
43
- * These three parameters are concatenated together and hashed to generate the final salt for CREATE2.
44
- *
45
- * See {generateSalt} function for more details.
46
- *
47
- * The constructor and `initializeCalldata` SHOULD NOT include any network-specific parameters (e.g: chain-id,
48
- * a local token contract address), otherwise the deployed contract will not be recreated at the same address
49
- * across different networks, thus defeating the purpose of the UniversalFactory.
50
- *
51
- * One way to solve this problem is to set an EOA owner in the `initializeCalldata`/constructor
52
- * that can later call functions that set these parameters as variables in the contract.
53
- *
54
- * The UniversalFactory must be deployed at the same address on different chains to successfully deploy
55
- * contracts at the same address across different chains.
56
- */
57
- contract LSP16UniversalFactory {
58
- /**
59
- * @dev placeholder for the `initializeCallData` param when the `initializable` boolean is set to `false`.
60
- */
61
- bytes private constant _EMPTY_BYTE = "";
62
-
63
- /**
64
- * @notice Contract created. Contract address: `createdContract`.
65
- * @dev Emitted whenever a contract is created.
66
- *
67
- * @param createdContract The address of the contract created.
68
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment.
69
- * @param generatedSalt The salt used by the `CREATE2` opcode for contract deployment.
70
- * @param initialized The Boolean that specifies if the contract must be initialized or not.
71
- * @param initializeCalldata The bytes provided as initializeCalldata (Empty string when `initialized` is set to false).
72
- */
73
- event ContractCreated(
74
- address indexed createdContract,
75
- bytes32 indexed providedSalt,
76
- bytes32 generatedSalt,
77
- bool indexed initialized,
78
- bytes initializeCalldata
79
- );
80
-
81
- /**
82
- * @notice Contract deployed. Salt, `providedSalt`, used.
83
- *
84
- * @dev Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeAddress} function.
85
- *
86
- * This function deploys contracts without initialization (external call after deployment).
87
- *
88
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See {generateSalt} function for more details.
89
- *
90
- * Using the same `byteCode` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address.
91
- *
92
- * If the constructor of the contract to deploy is payable, value can be sent to this function to fund the created contract. However, sending value to this function while the constructor is not payable will result in a revert.
93
- *
94
- * @param byteCode The bytecode of the contract to be deployed
95
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment
96
- *
97
- * @return The address of the deployed contract
98
- */
99
- function deployCreate2(
100
- bytes calldata byteCode,
101
- bytes32 providedSalt
102
- ) public payable virtual returns (address) {
103
- bytes32 generatedSalt = generateSalt(providedSalt, false, _EMPTY_BYTE);
104
- address contractCreated = Create2.deploy(
105
- msg.value,
106
- generatedSalt,
107
- byteCode
108
- );
109
- emit ContractCreated(
110
- contractCreated,
111
- providedSalt,
112
- generatedSalt,
113
- false,
114
- _EMPTY_BYTE
115
- );
116
-
117
- return contractCreated;
118
- }
119
-
120
- /**
121
- * @notice Contract deployed. Salt, `providedSalt`, used.
122
- *
123
- * @dev Deploys a contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeAddress} function.
124
- *
125
- * This function deploys contracts with initialization (external call after deployment).
126
- *
127
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`. See {generateSalt} function for more details.
128
- *
129
- * Using the same `byteCode`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address.
130
- *
131
- * If the constructor or the initialize function of the contract to deploy is payable, value can be sent along with the deployment/initialization to fund the created contract. However, sending value to this function while the constructor/initialize function is not payable will result in a revert.
132
- *
133
- * Will revert if the `msg.value` sent to the function is not equal to the sum of `constructorMsgValue` and `initializeCalldataMsgValue`.
134
- *
135
- * @param byteCode The bytecode of the contract to be deployed
136
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment
137
- * @param initializeCalldata The calldata to be executed on the created contract
138
- * @param constructorMsgValue The value sent to the contract during deployment
139
- * @param initializeCalldataMsgValue The value sent to the contract during initialization
140
- *
141
- * @return The address of the deployed contract
142
- */
143
- function deployCreate2AndInitialize(
144
- bytes calldata byteCode,
145
- bytes32 providedSalt,
146
- bytes calldata initializeCalldata,
147
- uint256 constructorMsgValue,
148
- uint256 initializeCalldataMsgValue
149
- ) public payable virtual returns (address) {
150
- if (constructorMsgValue + initializeCalldataMsgValue != msg.value)
151
- revert InvalidValueSum();
152
-
153
- bytes32 generatedSalt = generateSalt(
154
- providedSalt,
155
- true,
156
- initializeCalldata
157
- );
158
- address contractCreated = Create2.deploy(
159
- constructorMsgValue,
160
- generatedSalt,
161
- byteCode
162
- );
163
- emit ContractCreated(
164
- contractCreated,
165
- providedSalt,
166
- generatedSalt,
167
- true,
168
- initializeCalldata
169
- );
170
-
171
- (bool success, bytes memory returndata) = contractCreated.call{
172
- value: initializeCalldataMsgValue
173
- }(initializeCalldata);
174
- _verifyCallResult(success, returndata);
175
-
176
- return contractCreated;
177
- }
178
-
179
- /**
180
- * @notice Proxy deployed. Salt, `providedSalt`, used.
181
- *
182
- * @dev Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed can be known in advance via the {computeERC1167Address} function.
183
- *
184
- * This function deploys contracts without initialization (external call after deployment).
185
- *
186
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(false, providedSalt))`. See {generateSalt} function for more details.
187
- *
188
- * See {generateSalt} function for more details.
189
- *
190
- * Using the same `implementationContract` and `providedSalt` multiple times will revert, as the contract cannot be deployed twice at the same address.
191
- *
192
- * Sending value to the contract created is not possible since the constructor of the ERC1167 minimal proxy is not payable.
193
- *
194
- * @param implementationContract The contract address to use as the base implementation behind the proxy that will be deployed
195
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment
196
- *
197
- * @return The address of the minimal proxy deployed
198
- */
199
- function deployERC1167Proxy(
200
- address implementationContract,
201
- bytes32 providedSalt
202
- ) public virtual returns (address) {
203
- bytes32 generatedSalt = generateSalt(providedSalt, false, _EMPTY_BYTE);
204
-
205
- address proxy = Clones.cloneDeterministic(
206
- implementationContract,
207
- generatedSalt
208
- );
209
- emit ContractCreated(
210
- proxy,
211
- providedSalt,
212
- generatedSalt,
213
- false,
214
- _EMPTY_BYTE
215
- );
216
-
217
- return proxy;
218
- }
219
-
220
- /**
221
- * @notice Proxy deployed & initialized. Salt, `providedSalt`, used.
222
- *
223
- * @dev Deploys an ERC1167 minimal proxy contract using the CREATE2 opcode. The address where the contract will be deployed
224
- * can be known in advance via the {computeERC1167Address} function.
225
- *
226
- * This function deploys contracts with initialization (external call after deployment).
227
- *
228
- * The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is hashed with keccak256: `keccak256(abi.encodePacked(true, initializeCalldata, providedSalt))`.
229
- * See {generateSalt} function for more details.
230
- *
231
- * Using the same `implementationContract`, `providedSalt` and `initializeCalldata` multiple times will revert, as the contract cannot be deployed twice at the same address.
232
- *
233
- * If the initialize function of the contract to deploy is payable, value can be sent along to fund the created contract while initializing. However, sending value to this function while the initialize function is not payable will result in a revert.
234
- *
235
- * @param implementationContract The contract address to use as the base implementation behind the proxy that will be deployed
236
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment
237
- * @param initializeCalldata The calldata to be executed on the created contract
238
- *
239
- * @return The address of the minimal proxy deployed
240
- */
241
- function deployERC1167ProxyAndInitialize(
242
- address implementationContract,
243
- bytes32 providedSalt,
244
- bytes calldata initializeCalldata
245
- ) public payable virtual returns (address) {
246
- bytes32 generatedSalt = generateSalt(
247
- providedSalt,
248
- true,
249
- initializeCalldata
250
- );
251
-
252
- address proxy = Clones.cloneDeterministic(
253
- implementationContract,
254
- generatedSalt
255
- );
256
- emit ContractCreated(
257
- proxy,
258
- providedSalt,
259
- generatedSalt,
260
- true,
261
- initializeCalldata
262
- );
263
-
264
- (bool success, bytes memory returndata) = proxy.call{value: msg.value}(
265
- initializeCalldata
266
- );
267
- _verifyCallResult(success, returndata);
268
-
269
- return proxy;
270
- }
271
-
272
- /**
273
- * @dev Computes the address of a contract to be deployed using CREATE2, based on the input parameters.
274
- *
275
- * Any change in one of these parameters will result in a different address. When the `initializable` boolean is set to `false`, `initializeCalldata` will not affect the function output.
276
- *
277
- * @param byteCodeHash The keccak256 hash of the bytecode to be deployed
278
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment
279
- * @param initializable A boolean that indicates whether an external call should be made to initialize the contract after deployment
280
- * @param initializeCalldata The calldata to be executed on the created contract if `initializable` is set to `true`
281
- *
282
- * @return The address where the contract will be deployed
283
- */
284
- function computeAddress(
285
- bytes32 byteCodeHash,
286
- bytes32 providedSalt,
287
- bool initializable,
288
- bytes calldata initializeCalldata
289
- ) public view virtual returns (address) {
290
- bytes32 generatedSalt = generateSalt(
291
- providedSalt,
292
- initializable,
293
- initializeCalldata
294
- );
295
- return Create2.computeAddress(generatedSalt, byteCodeHash);
296
- }
297
-
298
- /**
299
- * @dev Computes the address of an ERC1167 proxy contract based on the input parameters.
300
- *
301
- * Any change in one of these parameters will result in a different address. When the `initializable` boolean is set to `false`, `initializeCalldata` will not affect the function output.
302
- *
303
- * @param implementationContract The contract to create a clone of according to ERC1167
304
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt that will be used by the `CREATE2` opcode for contract deployment
305
- * @param initializable A boolean that indicates whether an external call should be made to initialize the proxy contract after deployment
306
- * @param initializeCalldata The calldata to be executed on the created contract if `initializable` is set to `true`
307
- *
308
- * @return The address where the ERC1167 proxy contract will be deployed
309
- */
310
- function computeERC1167Address(
311
- address implementationContract,
312
- bytes32 providedSalt,
313
- bool initializable,
314
- bytes calldata initializeCalldata
315
- ) public view virtual returns (address) {
316
- bytes32 generatedSalt = generateSalt(
317
- providedSalt,
318
- initializable,
319
- initializeCalldata
320
- );
321
- return
322
- Clones.predictDeterministicAddress(
323
- implementationContract,
324
- generatedSalt
325
- );
326
- }
327
-
328
- /**
329
- * @dev Generates the salt used to deploy the contract by hashing the following parameters (concatenated together) with keccak256:
330
- * 1. the `providedSalt`
331
- * 2. the `initializable` boolean
332
- * 3. the `initializeCalldata`, only if the contract is initializable (the `initializable` boolean is set to `true`)
333
- *
334
- * - The `providedSalt` parameter is not used directly as the salt by the CREATE2 opcode. Instead, it is used along with these parameters:
335
- * 1. `initializable` boolean
336
- * 2. `initializeCalldata` (when the contract is initializable and `initializable` is set to `true`).
337
- *
338
- * - This approach ensures that in order to reproduce an initializable contract at the same address on another chain, not only the `providedSalt` is required to be the same, but also the initialize parameters within the `initializeCalldata` must also be the same. This maintains consistent deployment behaviour. Users are required to initialize contracts with the same parameters across different chains to ensure contracts are deployed at the same address across different chains.
339
- *
340
- * 1. Example (for initializable contracts)
341
- *
342
- * - For an existing contract A on chain 1 owned by X, to replicate the same contract at the same address with
343
- * the same owner X on chain 2, the salt used to generate the address should include the initializeCalldata
344
- * that assigns X as the owner of contract A.
345
- *
346
- * - For instance, if another user, Y, tries to deploy the contract at the same address
347
- * on chain 2 using the same providedSalt, but with a different initializeCalldata to make Y the owner instead of X,
348
- * the generated address would be different, preventing Y from deploying the contract with different ownership
349
- * at the same address.
350
- *
351
- * - However, for non-initializable contracts, if the constructor has arguments that specify the deployment behavior, they
352
- * will be included in the bytecode. Any change in the constructor arguments will lead to a different contract's bytecode
353
- * which will result in a different address on other chains.
354
- *
355
- * 2. Example (for non-initializable contracts)
356
- *
357
- * - If a contract is deployed with specific constructor arguments on chain 1, these arguments are embedded within the bytecode.
358
- * For instance, if contract B is deployed with a specific `tokenName` and `tokenSymbol` on chain 1, and a user wants to deploy
359
- * the same contract with the same `tokenName` and `tokenSymbol` on chain 2, they must use the same constructor arguments to
360
- * produce the same bytecode. This ensures that the same deployment behaviour is maintained across different chains,
361
- * as long as the same bytecode is used.
362
- *
363
- * - If another user Z, tries to deploy the same contract B at the same address on chain 2 using the same `providedSalt`
364
- * but different constructor arguments (a different `tokenName` and/or `tokenSymbol`), the generated address will be different.
365
- * This prevents user Z from deploying the contract with different constructor arguments at the same address on chain 2.
366
- *
367
- * - The providedSalt was hashed to produce the salt used by CREATE2 opcode to prevent users from deploying initializable contracts
368
- * using non-initializable functions such as {deployCreate2} without having the initialization call.
369
- *
370
- * - In other words, if the providedSalt was not hashed and was used as it is as the salt by the CREATE2 opcode, malicious users
371
- * can check the generated salt used for the already deployed initializable contract on chain 1, and deploy the contract
372
- * from {deployCreate2} function on chain 2, with passing the generated salt of the deployed contract as providedSalt
373
- * that will produce the same address but without the initialization, where the malicious user can initialize after.
374
- *
375
- * @param initializable The Boolean that specifies if the contract must be initialized or not
376
- * @param initializeCalldata The calldata to be executed on the created contract if `initializable` is set to `true`
377
- * @param providedSalt The salt provided by the deployer, which will be used to generate the final salt
378
- * that will be used by the `CREATE2` opcode for contract deployment
379
- *
380
- * @return The generated salt which will be used for CREATE2 deployment
381
- */
382
- function generateSalt(
383
- bytes32 providedSalt,
384
- bool initializable,
385
- bytes memory initializeCalldata
386
- ) public pure virtual returns (bytes32) {
387
- if (initializable) {
388
- return
389
- keccak256(
390
- abi.encodePacked(true, initializeCalldata, providedSalt)
391
- );
392
- } else {
393
- return keccak256(abi.encodePacked(false, providedSalt));
394
- }
395
- }
396
-
397
- /**
398
- * @dev Verifies that the contract created was initialized correctly.
399
- * Bubble the revert reason if present, revert with `ContractInitializationFailed` otherwise.
400
- */
401
- function _verifyCallResult(
402
- bool success,
403
- bytes memory returndata
404
- ) internal pure virtual {
405
- if (!success) {
406
- // Look for revert reason and bubble it up if present
407
- if (returndata.length != 0) {
408
- // The easiest way to bubble the revert reason is using memory via assembly
409
- // solhint-disable no-inline-assembly
410
- /// @solidity memory-safe-assembly
411
- assembly {
412
- let returndata_size := mload(returndata)
413
- revert(add(32, returndata), returndata_size)
414
- }
415
- } else {
416
- revert ContractInitializationFailed();
417
- }
418
- }
419
- }
420
- }
4
+ import "@lukso/lsp16-contracts/contracts/LSP16UniversalFactory.sol";
@@ -1,17 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // --- ERC165 interface ids
5
-
6
- // bytes4(keccack256("LSP17Extendable"))
7
- bytes4 constant _INTERFACEID_LSP17_EXTENDABLE = 0xa918fa6b;
8
-
9
- // bytes4(keccack256("LSP17Extension"))
10
- bytes4 constant _INTERFACEID_LSP17_EXTENSION = 0xcee78b40;
11
-
12
- // --- ERC725Y Data Keys
13
-
14
- // Extension Handler Prefix
15
-
16
- // bytes10(keccak256('LSP17Extension'))
17
- bytes10 constant _LSP17_EXTENSION_PREFIX = 0xcee78b4094da86011096;
4
+ import "@lukso/lsp17contractextension-contracts/contracts/LSP17Constants.sol";
@@ -1,17 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- /**
5
- * @dev reverts when there is no extension for the function selector being called with
6
- */
7
- error NoExtensionFoundForFunctionSelector(bytes4 functionSelector);
8
-
9
- /**
10
- * @dev reverts when the contract is called with a function selector not valid (less than 4 bytes of data)
11
- */
12
- error InvalidFunctionSelector(bytes data);
13
-
14
- /**
15
- * @dev reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes)
16
- */
17
- error InvalidExtensionAddress(bytes storedData);
4
+ import "@lukso/lsp17contractextension-contracts/contracts/LSP17Errors.sol";