@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,144 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // libraries
5
- import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
6
-
7
- // constants
8
- import {LSP25_VERSION} from "./LSP25Constants.sol";
9
-
10
- // errors
11
- import {RelayCallBeforeStartTime, RelayCallExpired} from "./LSP25Errors.sol";
12
-
13
- /**
14
- * @title Implementation of the multi channel nonce and the signature verification defined in the LSP25 standard.
15
- * @author Jean Cavallera (CJ42)
16
- * @dev This contract can be used as a backbone for other smart contracts to implement meta-transactions via the LSP25 Execute Relay Call interface.
17
- *
18
- * It contains a storage of nonces for signer addresses across various channel IDs, enabling these signers to submit signed transactions that order-independant.
19
- * (transactions that do not need to be submitted one after the other in a specific order).
20
- *
21
- * Finally, it contains internal functions to verify signatures for specific calldata according the signature format specified in the LSP25 standard.
22
- */
23
- abstract contract LSP25MultiChannelNonce {
24
- using ECDSA for *;
25
-
26
- // Mapping of signer -> channelId -> nonce in channel
27
- mapping(address => mapping(uint256 => uint256)) internal _nonceStore;
28
-
29
- /**
30
- * @dev Read the nonce for a `from` address on a specific `channelId`.
31
- * This will return an `idx`, which is the concatenation of two `uint128` as follow:
32
- * 1. the `channelId` where the nonce was queried for.
33
- * 2. the actual nonce of the given `channelId`.
34
- *
35
- * For example, if on `channelId` number `5`, the latest nonce is `1`, the `idx` returned by this function will be:
36
- *
37
- * ```
38
- * // in decimals = 1701411834604692317316873037158841057281
39
- * idx = 0x0000000000000000000000000000000500000000000000000000000000000001
40
- * ```
41
- *
42
- * This idx can be described as follow:
43
- *
44
- * ```
45
- * channelId => 5 nonce in this channel => 1
46
- * v------------------------------v-------------------------------v
47
- * 0x0000000000000000000000000000000500000000000000000000000000000001
48
- * ```
49
- *
50
- * @param from The address to read the nonce for.
51
- * @param channelId The channel in which to extract the nonce.
52
- *
53
- * @return idx The idx composed of two `uint128`: the channelId + nonce in channel concatenated together in a single `uint256` value.
54
- */
55
- function _getNonce(
56
- address from,
57
- uint128 channelId
58
- ) internal view virtual returns (uint256 idx) {
59
- return (uint256(channelId) << 128) | _nonceStore[from][channelId];
60
- }
61
-
62
- /**
63
- * @dev Recover the address of the signer that generated a `signature` using the parameters provided `nonce`, `validityTimestamps`, `msgValue` and `callData`.
64
- * The address of the signer will be recovered using the LSP25 signature format.
65
- *
66
- * @param signature A 65 bytes long signature generated according to the signature format specified in the LSP25 standard.
67
- * @param nonce The nonce that the signer used to generate the `signature`.
68
- * @param validityTimestamps The validity timestamp that the signer used to generate the signature (See {_verifyValidityTimestamps} to learn more).
69
- * @param msgValue The amount of native tokens intended to be sent for the relay transaction.
70
- * @param callData The calldata to execute as a relay transaction that the signer signed for.
71
- *
72
- * @return The address that signed, recovered from the `signature`.
73
- */
74
- function _recoverSignerFromLSP25Signature(
75
- bytes memory signature,
76
- uint256 nonce,
77
- uint256 validityTimestamps,
78
- uint256 msgValue,
79
- bytes calldata callData
80
- ) internal view returns (address) {
81
- bytes memory lsp25EncodedMessage = abi.encodePacked(
82
- LSP25_VERSION,
83
- block.chainid,
84
- nonce,
85
- validityTimestamps,
86
- msgValue,
87
- callData
88
- );
89
-
90
- bytes32 eip191Hash = address(this).toDataWithIntendedValidatorHash(
91
- lsp25EncodedMessage
92
- );
93
-
94
- return eip191Hash.recover(signature);
95
- }
96
-
97
- /**
98
- * @dev Verify that the current timestamp is within the date and time range provided by `validityTimestamps`.
99
- *
100
- * @param validityTimestamps Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed,
101
- * and the right-most `uint128` represents the timestamp after which the transaction expire.
102
- */
103
- function _verifyValidityTimestamps(
104
- uint256 validityTimestamps
105
- ) internal view {
106
- if (validityTimestamps == 0) return;
107
-
108
- uint128 startingTimestamp = uint128(validityTimestamps >> 128);
109
- uint128 endingTimestamp = uint128(validityTimestamps);
110
-
111
- // solhint-disable-next-line not-rely-on-time
112
- if (block.timestamp < startingTimestamp) {
113
- revert RelayCallBeforeStartTime();
114
- }
115
-
116
- // Allow `endingTimestamp` to be 0
117
- // Allow execution anytime past `startingTimestamp`
118
- if (endingTimestamp == 0) return;
119
-
120
- // solhint-disable-next-line not-rely-on-time
121
- if (block.timestamp > endingTimestamp) {
122
- revert RelayCallExpired();
123
- }
124
- }
125
-
126
- /**
127
- * @dev Verify that the nonce `_idx` for `_from` (obtained via {getNonce}) is valid in its channel ID.
128
- *
129
- * The "idx" is a 256bits (unsigned) integer, where:
130
- * - the 128 leftmost bits = channelId
131
- * - and the 128 rightmost bits = nonce within the channel
132
-
133
- * @param from The signer's address.
134
- * @param idx The concatenation of the `channelId` + `nonce` within a specific channel ID.
135
- *
136
- * @return true if the nonce is the latest nonce for the `signer`, false otherwise.
137
- */
138
- function _isValidNonce(
139
- address from,
140
- uint256 idx
141
- ) internal view virtual returns (bool) {
142
- return uint128(idx) == _nonceStore[from][idx >> 128];
143
- }
144
- }
4
+ import "@lukso/lsp25-contracts/contracts/LSP25MultiChannelNonce.sol";
@@ -1,448 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // interfaces
5
- import {
6
- IERC725Y
7
- } from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
8
-
9
- /**
10
- * @title LSP2 Utility library.
11
- * @author Jean Cavallera <CJ42>, Yamen Merhi <YamenMerhi>, Daniel Afteni <B00ste>
12
- * @dev LSP2Utils is a library of utility functions that can be used to encode data key of different key type
13
- * defined on the LSP2 standard.
14
- * Based on LSP2 ERC725Y JSON Schema standard.
15
- */
16
- library LSP2Utils {
17
- /**
18
- * @dev Generates a data key of keyType Singleton by hashing the string `keyName`. As:
19
- *
20
- * ```
21
- * keccak256("keyName")
22
- * ```
23
- *
24
- * @param keyName The string to hash to generate a Singleton data key.
25
- *
26
- * @return The generated `bytes32` data key of key type Singleton.
27
- */
28
- function generateSingletonKey(
29
- string memory keyName
30
- ) internal pure returns (bytes32) {
31
- return keccak256(bytes(keyName));
32
- }
33
-
34
- /**
35
- * @dev Generates a data key of keyType Array by hashing `arrayKeyName`. As:
36
- *
37
- * ```
38
- * keccak256("arrayKeyName[]")
39
- * ```
40
- *
41
- * @param arrayKeyName The string that will be used to generate a data key of key type Array.
42
- *
43
- * @return The generated `bytes32` data key of key type Array.
44
- *
45
- * @custom:requirements
46
- * - The `keyName` must include at the end of the string the square brackets `"[]"`.
47
- */
48
- function generateArrayKey(
49
- string memory arrayKeyName
50
- ) internal pure returns (bytes32) {
51
- bytes memory dataKey = bytes(arrayKeyName);
52
- require(dataKey.length >= 2, "MUST be longer than 2 characters");
53
- require(
54
- dataKey[dataKey.length - 2] == 0x5b && // "[" in utf8 encoded
55
- dataKey[dataKey.length - 1] == 0x5d, // "]" in utf8
56
- "Missing empty square brackets '[]' at the end of the key name"
57
- );
58
-
59
- return keccak256(dataKey);
60
- }
61
-
62
- /**
63
- * @dev Generates an Array data key at a specific `index` by concatenating together the first 16 bytes of `arrayKey`
64
- * with the 16 bytes of `index`. As:
65
- *
66
- * ```
67
- * arrayKey[index]
68
- * ```
69
- *
70
- * @param arrayKey The Array data key from which to generate the Array data key at a specific `index`.
71
- * @param index The index number in the `arrayKey`.
72
- *
73
- * @return The generated `bytes32` data key of key type Array at a specific `index`.
74
- */
75
- function generateArrayElementKeyAtIndex(
76
- bytes32 arrayKey,
77
- uint128 index
78
- ) internal pure returns (bytes32) {
79
- bytes memory elementInArray = bytes.concat(
80
- bytes16(arrayKey),
81
- bytes16(index)
82
- );
83
- return bytes32(elementInArray);
84
- }
85
-
86
- /**
87
- * @dev Generates a data key of key type Mapping that map `firstWord` to `lastWord`. This is done by hashing two strings words `firstWord` and `lastWord`. As:
88
- *
89
- * ```
90
- * bytes10(firstWordHash):0000:bytes20(lastWordHash)
91
- * ```
92
- *
93
- * @param firstWord The word to retrieve the first 10 bytes of its hash.
94
- * @param lastWord The word to retrieve the first 10 bytes of its hash.
95
- *
96
- * @return The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific `lastWord`.
97
- */
98
- function generateMappingKey(
99
- string memory firstWord,
100
- string memory lastWord
101
- ) internal pure returns (bytes32) {
102
- bytes32 firstWordHash = keccak256(bytes(firstWord));
103
- bytes32 lastWordHash = keccak256(bytes(lastWord));
104
-
105
- bytes memory temporaryBytes = bytes.concat(
106
- bytes10(firstWordHash),
107
- bytes2(0),
108
- bytes20(lastWordHash)
109
- );
110
-
111
- return bytes32(temporaryBytes);
112
- }
113
-
114
- /**
115
- * @dev Generates a data key of key type Mapping that map `firstWord` to an address `addr`.
116
- * This is done by hashing the string word `firstWord` and concatenating its first 10 bytes with `addr`. As:
117
- *
118
- * ```
119
- * bytes10(firstWordHash):0000:<address>
120
- * ```
121
- *
122
- * @param firstWord The word to retrieve the first 10 bytes of its hash.
123
- * @param addr An address to map `firstWord` to.
124
- *
125
- * @return The generated `bytes32` data key of key type Mapping that map `firstWord` to a specific address `addr`.
126
- */
127
- function generateMappingKey(
128
- string memory firstWord,
129
- address addr
130
- ) internal pure returns (bytes32) {
131
- bytes32 firstWordHash = keccak256(bytes(firstWord));
132
-
133
- bytes memory temporaryBytes = bytes.concat(
134
- bytes10(firstWordHash),
135
- bytes2(0),
136
- bytes20(addr)
137
- );
138
-
139
- return bytes32(temporaryBytes);
140
- }
141
-
142
- /**
143
- * @dev Generate a data key of key type Mapping that map a 10 bytes `keyPrefix` to a `bytes20Value`. As:
144
- *
145
- * ```
146
- * keyPrefix:bytes20Value
147
- * ```
148
- *
149
- * @param keyPrefix The first part of the data key of key type Mapping.
150
- * @param bytes20Value The second part of the data key of key type Mapping.
151
- *
152
- * @return The generated `bytes32` data key of key type Mapping that map a `keyPrefix` to a specific `bytes20Value`.
153
- */
154
- function generateMappingKey(
155
- bytes10 keyPrefix,
156
- bytes20 bytes20Value
157
- ) internal pure returns (bytes32) {
158
- bytes memory generatedKey = bytes.concat(
159
- keyPrefix,
160
- bytes2(0),
161
- bytes20Value
162
- );
163
- return bytes32(generatedKey);
164
- }
165
-
166
- /**
167
- * @dev Generate a data key of key type MappingWithGrouping by using two strings `firstWord`
168
- * mapped to a `secondWord` mapped itself to a specific address `addr`. As:
169
- *
170
- * ```
171
- * bytes6(keccak256("firstWord")):bytes4(keccak256("secondWord")):0000:<address>
172
- * ```
173
- *
174
- * @param firstWord The word to retrieve the first 6 bytes of its hash.
175
- * @param secondWord The word to retrieve the first 4 bytes of its hash.
176
- * @param addr The address that makes the last part of the MappingWithGrouping.
177
- *
178
- * @return The generated `bytes32` data key of key type MappingWithGrouping that map a `firstWord` to a `secondWord` to a specific address `addr`.
179
- */
180
- function generateMappingWithGroupingKey(
181
- string memory firstWord,
182
- string memory secondWord,
183
- address addr
184
- ) internal pure returns (bytes32) {
185
- bytes32 firstWordHash = keccak256(bytes(firstWord));
186
- bytes32 secondWordHash = keccak256(bytes(secondWord));
187
-
188
- bytes memory temporaryBytes = bytes.concat(
189
- bytes6(firstWordHash),
190
- bytes4(secondWordHash),
191
- bytes2(0),
192
- bytes20(addr)
193
- );
194
-
195
- return bytes32(temporaryBytes);
196
- }
197
-
198
- /**
199
- * @dev Generate a data key of key type MappingWithGrouping that map a `keyPrefix` to an other `mapPrefix` to a specific `subMapKey`. As:
200
- *
201
- * ```
202
- * keyPrefix:mapPrefix:0000:subMapKey
203
- * ```
204
- *
205
- * @param keyPrefix The first part (6 bytes) of the data key of keyType MappingWithGrouping.
206
- * @param mapPrefix The second part (4 bytes) of the data key of keyType MappingWithGrouping.
207
- * @param subMapKey The last part (bytes20) of the data key of keyType MappingWithGrouping.
208
- *
209
- * @return The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix` to a `mapPrefix` to a specific `subMapKey`.
210
- */
211
- function generateMappingWithGroupingKey(
212
- bytes6 keyPrefix,
213
- bytes4 mapPrefix,
214
- bytes20 subMapKey
215
- ) internal pure returns (bytes32) {
216
- bytes memory generatedKey = bytes.concat(
217
- keyPrefix,
218
- mapPrefix,
219
- bytes2(0),
220
- subMapKey
221
- );
222
- return bytes32(generatedKey);
223
- }
224
-
225
- /**
226
- * @dev Generate a data key of key type MappingWithGrouping that map a 10 bytes `keyPrefix` to a specific `bytes20Value`. As:
227
- *
228
- * @param keyPrefix The first part of the data key of keyType MappingWithGrouping.
229
- * @param bytes20Value The last of the data key of keyType MappingWithGrouping.
230
- *
231
- * @return The generated `bytes32` data key of key type MappingWithGrouping that map a `keyPrefix`
232
- * (containing the first and second mapped word) to a specific `bytes20Value`.
233
- */
234
- function generateMappingWithGroupingKey(
235
- bytes10 keyPrefix,
236
- bytes20 bytes20Value
237
- ) internal pure returns (bytes32) {
238
- bytes memory generatedKey = bytes.concat(
239
- keyPrefix,
240
- bytes2(0),
241
- bytes20Value
242
- );
243
- return bytes32(generatedKey);
244
- }
245
-
246
- /**
247
- * @dev Generate a JSONURL value content.
248
- * @param hashFunction The function used to hash the JSON file.
249
- * @param json Bytes value of the JSON file.
250
- * @param url The URL where the JSON file is hosted.
251
- */
252
- function generateJSONURLValue(
253
- string memory hashFunction,
254
- string memory json,
255
- string memory url
256
- ) internal pure returns (bytes memory) {
257
- bytes32 hashFunctionDigest = keccak256(bytes(hashFunction));
258
- bytes32 jsonDigest = keccak256(bytes(json));
259
-
260
- return abi.encodePacked(bytes4(hashFunctionDigest), jsonDigest, url);
261
- }
262
-
263
- /**
264
- * @dev Generate a ASSETURL value content.
265
- *
266
- * @param hashFunction The function used to hash the JSON file.
267
- * @param assetBytes Bytes value of the JSON file.
268
- * @param url The URL where the JSON file is hosted.
269
- *
270
- * @return The encoded value as an `ASSETURL`.
271
- */
272
- function generateASSETURLValue(
273
- string memory hashFunction,
274
- string memory assetBytes,
275
- string memory url
276
- ) internal pure returns (bytes memory) {
277
- bytes32 hashFunctionDigest = keccak256(bytes(hashFunction));
278
- bytes32 jsonDigest = keccak256(bytes(assetBytes));
279
-
280
- return abi.encodePacked(bytes4(hashFunctionDigest), jsonDigest, url);
281
- }
282
-
283
- /**
284
- * @dev Verify if `data` is a valid array of value encoded as a `CompactBytesArray` according to the LSP2 `CompactBytesArray` valueType specification.
285
- *
286
- * @param compactBytesArray The bytes value to verify.
287
- *
288
- * @return `true` if the `data` is correctly encoded CompactBytesArray, `false` otherwise.
289
- */
290
- function isCompactBytesArray(
291
- bytes memory compactBytesArray
292
- ) internal pure returns (bool) {
293
- /**
294
- * Pointer will always land on these values:
295
- *
296
- * ↓↓↓↓
297
- * 0003 a00000
298
- * 0005 fff83a0011
299
- * 0020 aa0000000000000000000000000000000000000000000000000000000000cafe
300
- * 0012 bb000000000000000000000000000000beef
301
- * 0019 cc00000000000000000000000000000000000000000000deed
302
- * ↑↑↑↑
303
- *
304
- * The pointer can only land on the length of the following bytes value.
305
- */
306
- uint256 pointer = 0;
307
-
308
- /**
309
- * Check each length byte and make sure that when you reach the last length byte.
310
- * Make sure that the last length describes exactly the last bytes value and you do not get out of bounds.
311
- */
312
- while (pointer < compactBytesArray.length) {
313
- if (pointer + 1 >= compactBytesArray.length) return false;
314
- uint256 elementLength = uint16(
315
- bytes2(
316
- abi.encodePacked(
317
- compactBytesArray[pointer],
318
- compactBytesArray[pointer + 1]
319
- )
320
- )
321
- );
322
- pointer += elementLength + 2;
323
- }
324
- if (pointer == compactBytesArray.length) return true;
325
- return false;
326
- }
327
-
328
- /**
329
- * @dev Validates if the bytes `arrayLength` are exactly 16 bytes long, and are of the exact size of an LSP2 Array length value
330
- *
331
- * @param arrayLength Plain bytes that should be validated.
332
- *
333
- * @return `true` if the value is 16 bytes long, `false` otherwise.
334
- */
335
- function isValidLSP2ArrayLengthValue(
336
- bytes memory arrayLength
337
- ) internal pure returns (bool) {
338
- if (arrayLength.length == 16) {
339
- return true;
340
- }
341
- return false;
342
- }
343
-
344
- /**
345
- * @dev Generates Data Key/Value pairs for removing the last element from an LSP2 Array and a mapping Data Key.
346
- *
347
- * @param arrayKey The Data Key of Key Type Array.
348
- * @param newArrayLength The new Array Length for the `arrayKey`.
349
- * @param removedElementIndexKey The Data Key of Key Type Array Index for the removed element.
350
- * @param removedElementMapKey The Data Key of a mapping to be removed.
351
- */
352
- function removeLastElementFromArrayAndMap(
353
- bytes32 arrayKey,
354
- uint128 newArrayLength,
355
- bytes32 removedElementIndexKey,
356
- bytes32 removedElementMapKey
357
- )
358
- internal
359
- pure
360
- returns (bytes32[] memory dataKeys, bytes[] memory dataValues)
361
- {
362
- dataKeys = new bytes32[](3);
363
- dataValues = new bytes[](3);
364
-
365
- // store the number of received assets decremented by 1
366
- dataKeys[0] = arrayKey;
367
- dataValues[0] = abi.encodePacked(newArrayLength);
368
-
369
- // remove the data value for the map key of the element
370
- dataKeys[1] = removedElementMapKey;
371
- dataValues[1] = "";
372
-
373
- // remove the data value for the map key of the element
374
- dataKeys[2] = removedElementIndexKey;
375
- dataValues[2] = "";
376
- }
377
-
378
- /**
379
- * @dev Generates Data Key/Value pairs for removing an element from an LSP2 Array and a mapping Data Key.
380
- *
381
- * @custom:info The function assumes that the Data Value stored under the mapping Data Key is of length 20 where the last 16 bytes are the index of the element in the array.
382
- *
383
- * @param erc725YContract The ERC725Y contract.
384
- * @param arrayKey The Data Key of Key Type Array.
385
- * @param newArrayLength The new Array Length for the `arrayKey`.
386
- * @param removedElementIndexKey The Data Key of Key Type Array Index for the removed element.
387
- * @param removedElementIndex the index of the removed element.
388
- * @param removedElementMapKey The Data Key of a mapping to be removed.
389
- */
390
- function removeElementFromArrayAndMap(
391
- IERC725Y erc725YContract,
392
- bytes32 arrayKey,
393
- uint128 newArrayLength,
394
- bytes32 removedElementIndexKey,
395
- uint128 removedElementIndex,
396
- bytes32 removedElementMapKey
397
- )
398
- internal
399
- view
400
- returns (bytes32[] memory dataKeys, bytes[] memory dataValues)
401
- {
402
- dataKeys = new bytes32[](5);
403
- dataValues = new bytes[](5);
404
-
405
- // store the number of received assets decremented by 1
406
- dataKeys[0] = arrayKey;
407
- dataValues[0] = abi.encodePacked(newArrayLength);
408
-
409
- // remove the data value for the map key of the element
410
- dataKeys[1] = removedElementMapKey;
411
- dataValues[1] = "";
412
-
413
- // Generate the key of the last element in the array
414
- bytes32 lastElementIndexKey = LSP2Utils.generateArrayElementKeyAtIndex(
415
- arrayKey,
416
- newArrayLength
417
- );
418
-
419
- // Get the data value from the key of the last element in the array
420
- bytes20 lastElementIndexValue = bytes20(
421
- erc725YContract.getData(lastElementIndexKey)
422
- );
423
-
424
- // Set data value of the last element instead of the element from the array that will be removed
425
- dataKeys[2] = removedElementIndexKey;
426
- dataValues[2] = bytes.concat(lastElementIndexValue);
427
-
428
- // Remove the data value for the swapped array element
429
- dataKeys[3] = lastElementIndexKey;
430
- dataValues[3] = "";
431
-
432
- // Generate mapping key for the swapped array element
433
- bytes32 lastElementMapKey = LSP2Utils.generateMappingKey(
434
- bytes10(removedElementMapKey),
435
- lastElementIndexValue
436
- );
437
-
438
- // Generate the mapping value for the swapped array element
439
- bytes memory lastElementMapValue = abi.encodePacked(
440
- bytes4(erc725YContract.getData(lastElementMapKey)),
441
- removedElementIndex
442
- );
443
-
444
- // Update the map value of the swapped array element to the new index
445
- dataKeys[4] = lastElementMapKey;
446
- dataValues[4] = lastElementMapValue;
447
- }
448
- }
4
+ import "@lukso/lsp2-contracts/contracts/LSP2Utils.sol";
@@ -1,11 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP3Profile'))
5
- bytes32 constant _LSP3_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347;
6
-
7
- // bytes4(keccak256('LSP3UniversalProfile'))
8
- bytes constant _LSP3_SUPPORTED_STANDARDS_VALUE = hex"5ef83ad9";
9
-
10
- // bytes32(keccak256("LSP3Profile"))
11
- bytes32 constant _LSP3_PROFILE_KEY = 0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5;
4
+ import "@lukso/lsp3-contracts/contracts/LSP3Constants.sol";
@@ -1,34 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.4;
3
3
 
4
- // Token types
5
-
6
- uint256 constant _LSP4_TOKEN_TYPE_TOKEN = 0;
7
- uint256 constant _LSP4_TOKEN_TYPE_NFT = 1;
8
- uint256 constant _LSP4_TOKEN_TYPE_COLLECTION = 2;
9
-
10
- // --- ERC725Y entries
11
-
12
- // bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP4DigitalAsset'))
13
- bytes32 constant _LSP4_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b60000a4d96624a38f7ac2d8d9a604ecf07c12c77e480c;
14
-
15
- // bytes4(keccak256('LSP4DigitalAsset'))
16
- bytes constant _LSP4_SUPPORTED_STANDARDS_VALUE = hex"a4d96624";
17
-
18
- // keccak256('LSP4TokenName')
19
- bytes32 constant _LSP4_TOKEN_NAME_KEY = 0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac56cad5194b6ecceaf653468af1;
20
-
21
- // keccak256('LSP4TokenSymbol')
22
- bytes32 constant _LSP4_TOKEN_SYMBOL_KEY = 0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756;
23
-
24
- // keccak256('LSP4TokenType')
25
- bytes32 constant _LSP4_TOKEN_TYPE_KEY = 0xe0261fa95db2eb3b5439bd033cda66d56b96f92f243a8228fd87550ed7bdfdb3;
26
-
27
- // keccak256('LSP4Creators[]')
28
- bytes32 constant _LSP4_CREATORS_ARRAY_KEY = 0x114bd03b3a46d48759680d81ebb2b414fda7d030a7105a851867accf1c2352e7;
29
-
30
- // bytes10(keccak256('LSP4CreatorsMap')) + bytes2(0)
31
- bytes12 constant _LSP4_CREATORS_MAP_KEY_PREFIX = 0x6de85eaf5d982b4e5da00000;
32
-
33
- // keccak256('LSP4Metadata')
34
- bytes32 constant _LSP4_METADATA_KEY = 0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e;
4
+ import "@lukso/lsp4-contracts/contracts/LSP4Constants.sol";