@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,246 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.12;
3
3
 
4
- // interfaces
5
- import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
6
-
7
- // modules
8
- import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
9
- import {
10
- LSP8IdentifiableDigitalAssetCore
11
- } from "./LSP8IdentifiableDigitalAssetCore.sol";
12
- import {
13
- LSP4DigitalAssetMetadataInitAbstract
14
- } from "../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol";
15
-
16
- import {
17
- LSP4DigitalAssetMetadataCore
18
- } from "../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol";
19
-
20
- import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
21
-
22
- // libraries
23
- import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
24
-
25
- // constants
26
- import {_INTERFACEID_LSP8, _LSP8_TOKENID_SCHEMA_KEY} from "./LSP8Constants.sol";
27
-
28
- // errors
29
- import {
30
- LSP8TokenContractCannotHoldValue,
31
- LSP8TokenIdSchemaNotEditable
32
- } from "./LSP8Errors.sol";
33
-
34
- import {
35
- _LSP17_EXTENSION_PREFIX
36
- } from "../LSP17ContractExtension/LSP17Constants.sol";
37
-
38
- // errors
39
-
40
- import {
41
- NoExtensionFoundForFunctionSelector,
42
- InvalidFunctionSelector,
43
- InvalidExtensionAddress
44
- } from "../LSP17ContractExtension/LSP17Errors.sol";
45
-
46
- /**
47
- * @title Implementation of a LSP8 Identifiable Digital Asset, a contract that represents a non-fungible token.
48
- * @author Matthew Stevens
49
- *
50
- * @dev Inheritable proxy implementation contract of the LSP8 standard.
51
- *
52
- * Minting and transferring are done using by giving a unique `tokenId`.
53
- * This implementation is agnostic to the way tokens are created.
54
- * A supply mechanism has to be added in a derived contract using {_mint}
55
- * For a generic mechanism, see {LSP7Mintable}.
56
- */
57
- abstract contract LSP8IdentifiableDigitalAssetInitAbstract is
58
- LSP4DigitalAssetMetadataInitAbstract,
59
- LSP8IdentifiableDigitalAssetCore,
60
- LSP17Extendable
61
- {
62
- /**
63
- * @dev Initialize a `LSP8IdentifiableDigitalAsset` contract and set the tokenId schema inside the ERC725Y storage of the contract.
64
- * This will also set the token `name_` and `symbol_` under the ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol`.
65
- *
66
- * @param name_ The name of the token
67
- * @param symbol_ The symbol of the token
68
- * @param newOwner_ The owner of the the token-Metadata
69
- * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection).
70
- * @param lsp8TokenIdSchema_ The schema of tokenIds (= NFTs) that this contract will create.
71
- *
72
- * @custom:warning Make sure the tokenId schema provided on deployment is correct, as it can only be set once
73
- * and cannot be changed in the ERC725Y storage after the contract has been initialized.
74
- */
75
- function _initialize(
76
- string memory name_,
77
- string memory symbol_,
78
- address newOwner_,
79
- uint256 lsp4TokenType_,
80
- uint256 lsp8TokenIdSchema_
81
- ) internal virtual onlyInitializing {
82
- LSP4DigitalAssetMetadataInitAbstract._initialize(
83
- name_,
84
- symbol_,
85
- newOwner_,
86
- lsp4TokenType_
87
- );
88
-
89
- LSP4DigitalAssetMetadataInitAbstract._setData(
90
- _LSP8_TOKENID_SCHEMA_KEY,
91
- abi.encode(lsp8TokenIdSchema_)
92
- );
93
- }
94
-
95
- // fallback function
96
-
97
- /**
98
- * @notice The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`.
99
- *
100
- * @dev Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively,
101
- * forwarding the function call to the extension address mapped to the function being called.
102
- *
103
- * This function is executed when:
104
- * - Sending data of length less than 4 bytes to the contract.
105
- * - The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI.
106
- * - Receiving native tokens
107
- *
108
- * 1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key)
109
- *
110
- * - If there is no address stored under the following data key, revert with {NoExtensionFoundForFunctionSelector(bytes4)}. The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it.
111
- *
112
- * - If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed.
113
- *
114
- * 2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert.
115
- */
116
- // solhint-disable-next-line no-complex-fallback
117
- fallback(
118
- bytes calldata callData
119
- ) external payable virtual returns (bytes memory) {
120
- if (msg.data.length < 4) {
121
- revert InvalidFunctionSelector(callData);
122
- }
123
- return _fallbackLSP17Extendable(callData);
124
- }
125
-
126
- /**
127
- * @dev Reverts whenever someone tries to send native tokens to a LSP8 contract.
128
- * @notice LSP8 contract cannot receive native tokens.
129
- */
130
- receive() external payable virtual {
131
- // revert on empty calls with no value
132
- if (msg.value == 0) {
133
- revert InvalidFunctionSelector(hex"00000000");
134
- }
135
-
136
- revert LSP8TokenContractCannotHoldValue();
137
- }
138
-
139
- /**
140
- * @dev Forwards the call with the received value to an extension mapped to a function selector.
141
- *
142
- * Calls {_getExtensionAndForwardValue} to get the address of the extension mapped to the function selector being
143
- * called on the account. If there is no extension, the address(0) will be returned.
144
- * We will always forward the value to the extension, as the LSP8 contract is not supposed to hold any native tokens.
145
- *
146
- * Reverts if there is no extension for the function being called.
147
- *
148
- * If there is an extension for the function selector being called, it calls the extension with the
149
- * CALL opcode, passing the {msg.data} appended with the 20 bytes of the {msg.sender} and
150
- * 32 bytes of the {msg.value}
151
- *
152
- * @custom:info The LSP8 Token contract should not hold any native tokens. Any native tokens received by the contract
153
- * will be forwarded to the extension address mapped to the selector from `msg.sig`.
154
- */
155
- function _fallbackLSP17Extendable(
156
- bytes calldata callData
157
- ) internal virtual override returns (bytes memory) {
158
- // If there is a function selector
159
- (address extension, ) = _getExtensionAndForwardValue(msg.sig);
160
-
161
- // if no extension was found, revert
162
- if (extension == address(0))
163
- revert NoExtensionFoundForFunctionSelector(msg.sig);
164
-
165
- (bool success, bytes memory result) = extension.call{value: msg.value}(
166
- abi.encodePacked(callData, msg.sender, msg.value)
167
- );
168
-
169
- if (success) {
170
- return result;
171
- } else {
172
- // `mload(result)` -> offset in memory where `result.length` is located
173
- // `add(result, 32)` -> offset in memory where `result` data starts
174
- // solhint-disable no-inline-assembly
175
- /// @solidity memory-safe-assembly
176
- assembly {
177
- let resultdata_size := mload(result)
178
- revert(add(result, 32), resultdata_size)
179
- }
180
- }
181
- }
182
-
183
- /**
184
- * @dev Returns the extension address stored under the following data key:
185
- * - {_LSP17_EXTENSION_PREFIX} + `<bytes4>` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
186
- * - If no extension is stored, returns the address(0).
187
- */
188
- function _getExtensionAndForwardValue(
189
- bytes4 functionSelector
190
- ) internal view virtual override returns (address, bool) {
191
- // Generate the data key relevant for the functionSelector being called
192
- bytes32 mappedExtensionDataKey = LSP2Utils.generateMappingKey(
193
- _LSP17_EXTENSION_PREFIX,
194
- functionSelector
195
- );
196
-
197
- // Check if there is an extension stored under the generated data key
198
- bytes memory extensionAddress = ERC725YCore._getData(
199
- mappedExtensionDataKey
200
- );
201
- if (extensionAddress.length != 20 && extensionAddress.length != 0)
202
- revert InvalidExtensionAddress(extensionAddress);
203
-
204
- return (address(bytes20(extensionAddress)), true);
205
- }
206
-
207
- /**
208
- * @dev See {IERC165-supportsInterface}.
209
- */
210
- function supportsInterface(
211
- bytes4 interfaceId
212
- )
213
- public
214
- view
215
- virtual
216
- override(IERC165, ERC725YCore, LSP17Extendable)
217
- returns (bool)
218
- {
219
- return
220
- interfaceId == _INTERFACEID_LSP8 ||
221
- super.supportsInterface(interfaceId) ||
222
- LSP17Extendable._supportsInterfaceInERC165Extension(interfaceId);
223
- }
224
-
225
- /**
226
- * @inheritdoc LSP4DigitalAssetMetadataInitAbstract
227
- * @dev The ERC725Y data key `_LSP8_TOKENID_SCHEMA_KEY` cannot be changed
228
- * once the identifiable digital asset contract has been deployed.
229
- */
230
- function _setData(
231
- bytes32 dataKey,
232
- bytes memory dataValue
233
- )
234
- internal
235
- virtual
236
- override(
237
- LSP4DigitalAssetMetadataInitAbstract,
238
- LSP4DigitalAssetMetadataCore
239
- )
240
- {
241
- if (dataKey == _LSP8_TOKENID_SCHEMA_KEY) {
242
- revert LSP8TokenIdSchemaNotEditable();
243
- }
244
- LSP4DigitalAssetMetadataInitAbstract._setData(dataKey, dataValue);
245
- }
246
- }
4
+ import "@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol";
@@ -1,30 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.4;
2
+ pragma solidity ^0.8.12;
3
3
 
4
- import {
5
- LSP8IdentifiableDigitalAsset
6
- } from "../LSP8IdentifiableDigitalAsset.sol";
7
-
8
- // errors
9
- import {LSP8NotTokenOperator} from "../LSP8Errors.sol";
10
-
11
- /**
12
- * @dev LSP8 token extension that allows token holders to destroy both
13
- * their own tokens and those that they have an allowance for as an operator.
14
- */
15
- abstract contract LSP8Burnable is LSP8IdentifiableDigitalAsset {
16
- /**
17
- * @notice Burning tokenId `tokenId`. This tokenId will not be recoverable! (additional data sent: `data`).
18
- *
19
- * @dev See internal {_burn} function for details.
20
- *
21
- * @param tokenId The tokenId to burn.
22
- * @param data Any extra data to be sent alongside burning the tokenId.
23
- */
24
- function burn(bytes32 tokenId, bytes memory data) public {
25
- if (!_isOperatorOrOwner(msg.sender, tokenId)) {
26
- revert LSP8NotTokenOperator(tokenId, msg.sender);
27
- }
28
- _burn(tokenId, data);
29
- }
30
- }
4
+ import "@lukso/lsp8-contracts/contracts/extensions/LSP8Burnable.sol";
@@ -1,24 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.4;
2
+ pragma solidity ^0.8.12;
3
3
 
4
- import {
5
- LSP8IdentifiableDigitalAssetInitAbstract
6
- } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
7
-
8
- // errors
9
- import {LSP8NotTokenOperator} from "../LSP8Errors.sol";
10
-
11
- /**
12
- * @dev LSP8 extension (proxy version) that allows token holders to destroy both
13
- * their own tokens and those that they have an allowance for as an operator.
14
- */
15
- abstract contract LSP8BurnableInitAbstract is
16
- LSP8IdentifiableDigitalAssetInitAbstract
17
- {
18
- function burn(bytes32 tokenId, bytes memory data) public virtual {
19
- if (!_isOperatorOrOwner(msg.sender, tokenId)) {
20
- revert LSP8NotTokenOperator(tokenId, msg.sender);
21
- }
22
- _burn(tokenId, data);
23
- }
24
- }
4
+ import "@lukso/lsp8-contracts/contracts/extensions/LSP8BurnableInitAbstract.sol";
@@ -1,86 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.12;
2
3
 
3
- pragma solidity ^0.8.4;
4
-
5
- // modules
6
- import {
7
- LSP8IdentifiableDigitalAsset
8
- } from "../LSP8IdentifiableDigitalAsset.sol";
9
-
10
- /**
11
- * @dev LSP8 token extension to add a max token supply cap.
12
- */
13
- abstract contract LSP8CappedSupply is LSP8IdentifiableDigitalAsset {
14
- // --- Errors
15
-
16
- /**
17
- * @notice The `tokenSupplyCap` must be set and cannot be `0`.
18
- * @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
19
- */
20
- error LSP8CappedSupplyRequired();
21
-
22
- /**
23
- * @notice Cannot mint anymore as total supply reached the maximum cap.
24
- * @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
25
- */
26
- error LSP8CappedSupplyCannotMintOverCap();
27
-
28
- // --- Storage
29
- uint256 private immutable _TOKEN_SUPPLY_CAP;
30
-
31
- /**
32
- * @notice Deploying a `LSP8CappedSupply` token contract with max token supply cap set to `tokenSupplyCap_`.
33
- * @dev Deploy a `LSP8CappedSupply` token contract and set the maximum token supply token cap up to which
34
- * it is not possible to mint more tokens.
35
- *
36
- * @param tokenSupplyCap_ The maximum token supply.
37
- *
38
- * @custom:requirements
39
- * - `tokenSupplyCap_` MUST NOT be 0.
40
- */
41
- constructor(uint256 tokenSupplyCap_) {
42
- if (tokenSupplyCap_ == 0) {
43
- revert LSP8CappedSupplyRequired();
44
- }
45
-
46
- _TOKEN_SUPPLY_CAP = tokenSupplyCap_;
47
- }
48
-
49
- // --- Token queries
50
-
51
- /**
52
- * @notice The maximum supply amount of tokens allowed to exist is `_TOKEN_SUPPLY_CAP`.
53
- *
54
- * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
55
- * reaches {totalSuuplyCap}, it is not possible to mint more tokens.
56
- *
57
- * @return The maximum number of tokens that can exist in the contract.
58
- */
59
- function tokenSupplyCap() public view virtual returns (uint256) {
60
- return _TOKEN_SUPPLY_CAP;
61
- }
62
-
63
- // --- Transfer functionality
64
-
65
- /**
66
- * @dev Same as {_mint} but allows to mint only if newly minted `tokenId` does not increase the {totalSupply}
67
- * over the {tokenSupplyCap}.
68
- * after a new `tokenId` has of tokens have been minted.
69
- *
70
- * @custom:requirements
71
- * - {totalSupply} + 1 must not be greater than the {tokenSupplyCap} when calling this function.
72
- * - `to` cannot be the zero address.
73
- */
74
- function _mint(
75
- address to,
76
- bytes32 tokenId,
77
- bool force,
78
- bytes memory data
79
- ) internal virtual override {
80
- if (totalSupply() + 1 > tokenSupplyCap()) {
81
- revert LSP8CappedSupplyCannotMintOverCap();
82
- }
83
-
84
- super._mint(to, tokenId, force, data);
85
- }
86
- }
4
+ import "@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol";
@@ -1,89 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.12;
2
3
 
3
- pragma solidity ^0.8.4;
4
-
5
- // modules
6
- import {
7
- LSP8IdentifiableDigitalAssetInitAbstract
8
- } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
9
-
10
- /**
11
- * @dev LSP8 token extension to add a max token supply cap.
12
- */
13
- abstract contract LSP8CappedSupplyInitAbstract is
14
- LSP8IdentifiableDigitalAssetInitAbstract
15
- {
16
- // --- Errors
17
-
18
- /**
19
- * @notice The `tokenSupplyCap` must be set and cannot be `0`.
20
- * @dev Reverts when setting `0` for the {tokenSupplyCap}. The max token supply MUST be set to a number greater than 0.
21
- */
22
- error LSP8CappedSupplyRequired();
23
-
24
- /**
25
- * @notice Cannot mint anymore as total supply reached the maximum cap.
26
- * @dev Reverts when trying to mint tokens but the {totalSupply} has reached the maximum {tokenSupplyCap}.
27
- */
28
- error LSP8CappedSupplyCannotMintOverCap();
29
-
30
- // --- Storage
31
- uint256 private _tokenSupplyCap;
32
-
33
- /**
34
- * @dev Initialize a `LSP8CappedSupplyInitAbstract` token contract and set the maximum token supply token cap up to which
35
- * it is not possible to mint more tokens.
36
- *
37
- * @param tokenSupplyCap_ The maximum token supply.
38
- *
39
- * @custom:requirements
40
- * - `tokenSupplyCap_` MUST NOT be 0.
41
- */
42
- function _initialize(
43
- uint256 tokenSupplyCap_
44
- ) internal virtual onlyInitializing {
45
- if (tokenSupplyCap_ == 0) {
46
- revert LSP8CappedSupplyRequired();
47
- }
48
-
49
- _tokenSupplyCap = tokenSupplyCap_;
50
- }
51
-
52
- // --- Token queries
53
-
54
- /**
55
- * @notice The maximum supply amount of tokens allowed to exist is `_tokenSupplyCap`.
56
- *
57
- * @dev Get the maximum number of tokens that can exist to circulate. Once {totalSupply} reaches
58
- * reaches {totalSuuplyCap}, it is not possible to mint more tokens.
59
- *
60
- * @return The maximum number of tokens that can exist in the contract.
61
- */
62
- function tokenSupplyCap() public view virtual returns (uint256) {
63
- return _tokenSupplyCap;
64
- }
65
-
66
- // --- Transfer functionality
67
-
68
- /**
69
- * @dev Same as {_mint} but allows to mint only if newly minted `tokenId` does not increase the {totalSupply}
70
- * over the {tokenSupplyCap}.
71
- * after a new `tokenId` has of tokens have been minted.
72
- *
73
- * @custom:requirements
74
- * - {totalSupply} + 1 must not be greater than the {tokenSupplyCap} when calling this function.
75
- * - `to` cannot be the zero address.
76
- */
77
- function _mint(
78
- address to,
79
- bytes32 tokenId,
80
- bool force,
81
- bytes memory data
82
- ) internal virtual override {
83
- if (totalSupply() + 1 > tokenSupplyCap()) {
84
- revert LSP8CappedSupplyCannotMintOverCap();
85
- }
86
-
87
- super._mint(to, tokenId, force, data);
88
- }
89
- }
4
+ import "@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol";
@@ -1,70 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.12;
2
3
 
3
- pragma solidity ^0.8.4;
4
-
5
- // modules
6
- import {
7
- LSP8IdentifiableDigitalAsset,
8
- LSP8IdentifiableDigitalAssetCore
9
- } from "../LSP8IdentifiableDigitalAsset.sol";
10
-
11
- /**
12
- * @dev LSP8 extension that enables to enumerate over all the `tokenIds` ever minted.
13
- *
14
- * @custom:warning Note that in this extension contract, any `tokenId` that been burnt is removed from the set of the enumerable tokenIds.
15
- */
16
- abstract contract LSP8Enumerable is LSP8IdentifiableDigitalAsset {
17
- // Mapping from token index to token id
18
- mapping(uint256 => bytes32) private _indexToken;
19
-
20
- // Mapping from token id to index
21
- mapping(bytes32 => uint256) private _tokenIndex;
22
-
23
- /**
24
- * @notice Retrieving the `tokenId` for `msg.sender` located in its list at index number `index`.
25
- *
26
- * @dev Returns a token id at index. See {totalSupply} to get total number of minted tokens.
27
- * @param index The index to search to search in the enumerable mapping.
28
- * @return TokenId or `bytes32(0)` if no tokenId exist at `index`.
29
- */
30
- function tokenAt(uint256 index) public view returns (bytes32) {
31
- return _indexToken[index];
32
- }
33
-
34
- /**
35
- * @inheritdoc LSP8IdentifiableDigitalAssetCore
36
- *
37
- * @param from The address sending the `tokenId` (`address(0)` when `tokenId` is being minted).
38
- * @param to The address receiving the `tokenId` (`address(0)` when `tokenId` is being burnt).
39
- * @param tokenId The bytes32 identifier of the token being transferred.
40
- * @param data The data sent alongside the the token transfer.
41
- */
42
- function _beforeTokenTransfer(
43
- address from,
44
- address to,
45
- bytes32 tokenId,
46
- bytes memory data
47
- ) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
48
- // `tokenId` being minted
49
- if (from == address(0)) {
50
- uint256 index = totalSupply();
51
- _indexToken[index] = tokenId;
52
- _tokenIndex[tokenId] = index;
53
- }
54
-
55
- // `tokenId` being burnt
56
- if (to == address(0)) {
57
- uint256 lastIndex = totalSupply() - 1;
58
- uint256 index = _tokenIndex[tokenId];
59
- if (index < lastIndex) {
60
- bytes32 lastTokenId = _indexToken[lastIndex];
61
- _indexToken[index] = lastTokenId;
62
- _tokenIndex[lastTokenId] = index;
63
- }
64
- delete _indexToken[lastIndex];
65
- delete _tokenIndex[tokenId];
66
- }
67
-
68
- super._beforeTokenTransfer(from, to, tokenId, data);
69
- }
70
- }
4
+ import "@lukso/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol";
@@ -1,65 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.12;
2
3
 
3
- pragma solidity ^0.8.4;
4
-
5
- // modules
6
- import {
7
- LSP8IdentifiableDigitalAssetInitAbstract,
8
- LSP8IdentifiableDigitalAssetCore
9
- } from "../LSP8IdentifiableDigitalAssetInitAbstract.sol";
10
-
11
- /**
12
- * @dev LSP8 extension.
13
- */
14
- abstract contract LSP8EnumerableInitAbstract is
15
- LSP8IdentifiableDigitalAssetInitAbstract
16
- {
17
- // Mapping from token index to token id
18
- mapping(uint256 => bytes32) private _indexToken;
19
-
20
- // Mapping from token id to index
21
- mapping(bytes32 => uint256) private _tokenIndex;
22
-
23
- /**
24
- * @notice Retrieving the `tokenId` for `msg.sender` located in its list at index number `index`.
25
- *
26
- * @dev Returns a token id at index. See {totalSupply} to get total number of minted tokens.
27
- * @param index The index to search to search in the enumerable mapping.
28
- * @return TokenId or `bytes32(0)` if no tokenId exist at `index`.
29
- */
30
- function tokenAt(uint256 index) public view returns (bytes32) {
31
- return _indexToken[index];
32
- }
33
-
34
- /**
35
- * @inheritdoc LSP8IdentifiableDigitalAssetCore
36
- *
37
- * @param from The address sending the `tokenId` (`address(0)` when `tokenId` is being minted).
38
- * @param to The address receiving the `tokenId` (`address(0)` when `tokenId` is being burnt).
39
- * @param tokenId The bytes32 identifier of the token being transferred.
40
- * @param data The data sent alongside the the token transfer.
41
- */
42
- function _beforeTokenTransfer(
43
- address from,
44
- address to,
45
- bytes32 tokenId,
46
- bytes memory data
47
- ) internal virtual override(LSP8IdentifiableDigitalAssetCore) {
48
- if (from == address(0)) {
49
- uint256 index = totalSupply();
50
- _indexToken[index] = tokenId;
51
- _tokenIndex[tokenId] = index;
52
- } else if (to == address(0)) {
53
- uint256 lastIndex = totalSupply() - 1;
54
- uint256 index = _tokenIndex[tokenId];
55
- if (index < lastIndex) {
56
- bytes32 lastTokenId = _indexToken[lastIndex];
57
- _indexToken[index] = lastTokenId;
58
- _tokenIndex[lastTokenId] = index;
59
- }
60
- delete _indexToken[lastIndex];
61
- delete _tokenIndex[tokenId];
62
- }
63
- super._beforeTokenTransfer(from, to, tokenId, data);
64
- }
65
- }
4
+ import "@lukso/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol";
@@ -1,34 +1,4 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
-
3
2
  pragma solidity ^0.8.4;
4
3
 
5
- // interfaces
6
- import {
7
- ILSP8IdentifiableDigitalAsset
8
- } from "../ILSP8IdentifiableDigitalAsset.sol";
9
-
10
- /**
11
- * @dev LSP8 extension, mintable.
12
- */
13
- interface ILSP8Mintable is ILSP8IdentifiableDigitalAsset {
14
- /**
15
- * @param to The address to mint tokens
16
- * @param tokenId The tokenId to mint
17
- * @param force When set to TRUE, to may be any address but
18
- * when set to FALSE to must be a contract that supports LSP1 UniversalReceiver
19
- * @param data Additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
20
- * @dev Mints `amount` tokens and transfers it to `to`.
21
- *
22
- * Requirements:
23
- *
24
- * - `to` cannot be the zero address.
25
- *
26
- * Emits a {Transfer} event.
27
- */
28
- function mint(
29
- address to,
30
- bytes32 tokenId,
31
- bool force,
32
- bytes memory data
33
- ) external;
34
- }
4
+ import "@lukso/lsp8-contracts/contracts/presets/ILSP8Mintable.sol";